google-cloud-profiler metadata server WARNING - python

I am trying to use Google Cloud Profiler in a python script running locally. It seems it is having problems to connect with a metadata server:
WARNING:googlecloudprofiler.client:Failed to fetch instance/zone from GCE metadata server: HTTPConnectionPool(host='metadata', port=80): Max retries exceeded with url: /computeMetadata/v1/instance/zone (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',))
WARNING:googlecloudprofiler.client:Failed to fetch instance/name from
GCE metadata server: HTTPConnectionPool(host='metadata', port=80): Max
retries exceeded with url: /computeMetadata/v1/instance/name (Caused
by NewConnectionError(': Failed to establish a new connection: [Errno -2] Name
or service not known',))
Since the app seems to be running correctly and the profiler is collecting data successfully, is it OK if I just ignore the warnings or will I likely encounter some problems in the future?

If you're running locally (and haven't, for example, manually zone in the config), these warnings are expected, so ignoring them is definitely okay.
(Disclosure: I work at Google on Stackdriver Profiler)

Related

Connect to Apache Phoenix Docker Container Using Python

I am running an Apache Phoenix container along with Hbase using the following command,
docker run -it --name phoenix -p 8765:8765 avapno/apache-phoenix
This is done as explained here,
https://hub.docker.com/r/avapno/apache-phoenix
The containers run without a problem.
Now, I want to connect to Phoenix using Python. This is the code I have used to do so,
import phoenixdb
database_url = 'http://localhost:8765/'
conn = phoenixdb.connect(database_url, autocommit=True)
This does not, however, seem to work. I keep getting the following error,
ConnectionError: HTTPConnectionPool(host='localhost', port=8765): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffb03782080>: Failed to establish a new connection: [Errno 111] Connection refused'))
How exactly do I get this done correctly?
Also, is there a better way to get Hbase + Phoenix running?

Getting "Failed to establish a new connection: [Errno -3] Temporary failure in name resolution" in Uvicorn server in Docker environment

I am getting the below exception while making a call from my project-
My code is deployed on Docker and inside it running python uvicorn server.
I have double check the URL, there is no error in that.
Below is the exception mentioned.
Exception raised HTTPSConnectionPool(host='XXXXXX', port=443): Max
retries exceeded with url:
/oauth2/auth?response_type=code&state=test_state&client_id=110438&redirect_uri=https://XXXXX.com/plugin/callback (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection
object at 0x7f0bd835a6d0>: Failed to establish a new connection:
[Errno -3] Temporary failure in name resolution'))
Could someone please help me?
Thanks

error setting anaconda python 3.7 interpreter on pycharm

I'm having trouble to set anaconda python 3.7 on pycharm , and i get this error:
CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://repo.anaconda.com/pkgs/r/noarch/repodata.json.bz2
from the excuted command :
C:\Users\Matan\Anaconda3\Scripts\conda.exe create -p C:\Users\Matan\Anaconda3\envs\untitled2 -y python=3.7
Command output:
Collecting package metadata: ...working... failed
WARNING: The conda.compat module is deprecated and will be removed in a future release.
CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://repo.anaconda.com/pkgs/r/noarch/repodata.json.bz2
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/r/noarch/repodata.json.bz2 (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))'))

Python Request to SSL enabled server genetates SSL Handshake failure

I am using youtube-dl which makes a request to a server , but now I am getting a SSL error like this:
ERROR: Unable to download JSON metadata: <urlopen error [Errno 1] _ssl.c:504:
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake
failure> (caused by URLError(SSLError(1, '_ssl.c:504: error:14077410:SSL
routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure'),))
Is there a way to fix this?
I'm using Python 2.7.3 and requests==2.13.0

Openshift python requests proxy permission denied

I'm trying to use a proxy with the python 'requests' package on an Openshift server. I am getting a permission denied error. See below.
Is Openshift blocking the connection or am I not configuring it correctly? Something else? Openshift doesn't want to let me connect to a proxy because the code works fine locally and on Heroku.
Code
from ssl import PROTOCOL_TLSv1
import ssladapter
proxies = {'https': 'http://{}:{}#96.44.147.34:6060'.format(CFG.proxy_username, CFG.proxy_password)}
url1 = 'https://reservaciones.volaris.com/Flight/DeepLinkSearch'
session = requests.Session()
session.mount('https://', ssladapter.SSLAdapter(ssl_version=PROTOCOL_TLSv1))
request1 = session.get(url1, proxies=proxies)
Traceback
requests.exceptions.ProxyError: HTTPSConnectionPool(host='reservaciones.volaris.com', port=443): Max retries exceeded with url: /Flight/DeepLinkSearch (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f4e78386ad0>: Failed to establish a new connection: [Errno 13] Permission denied',)))
Most probably OpenShift blocks uncommon outgoing ports for security reasons. your proxy is listening on 6060. You should try to ssh into your gear and try telnet
In my gear, post 6060 is blocked. See the attached screenshot. portquiz listens on all TCP ports.

Categories