Error : Max retries exceeded with url: /v3/auth/tokens - python

I'm trying to use the Openstack API for the first time with the Python SDK.
But I am getting below error:
Unable to establish connection to https://172.23.13.30/v3/auth/tokens: HTTPSConnectionPool(host='172.23.13.30', port=443): Max retries exceeded with url: /v3/auth/tokens (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff031441040>: Failed to establish a new connection: [Errno 101] Network unreachable'))
What should I do?

Related

Max retries exceeded with url: /api/json. Failed to establish a new connection: [Errno 111] Connection refused

I am using jenkins package of python to fetch job details from jenkins server. For most of the servers I am able to fetch the job data but for few servers I am getting below error.
Unable to authenticate with any scheme: auth(kerberos) HTTPConnectionPool(host='xxxxxxxx', port=8080): Max retries exceeded with url: /api/json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb1d4b55898>: Failed to establish a new connection: [Errno 111] Connection refused',)) auth(anonymous) HTTPConnectionPool(host='xxxxxxxx', port=8080): Max retries exceeded with url: /api/json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb1cbce20f0>: Failed to establish a new connection: [Errno 111] Connection refused',))
I have below code where the error is occuring.
server_object = jenkins.Jenkins("http://"+["jenkins_hostname"]+":"+['jenkins_port'], username=xxxxx, password=xxxxx, timeout=120,)
I tried to login in to the server with userid and password, Its working when using browser.
I am not able to figure out what exactly the issue as I am able to login in to the jenkins using browser. Now I am stuck as this error is not coming for all servers. Please help in resolving the error.

Connecting to TM1 via Python, Where to find "Address" and "Port" Arguments

I am trying to connect to IBM TM1 via a Pythonscript. However I am not sure how to configure the Address and Port parts of my script below.
I am running python on a work pc. I did create a file with a proxy address in order to install a python package.
Does anyone know how to find the address and port?
from TM1py.Services import TM1Service
with TM1Service(address='localhost', port=8001, user='excelguy', password='WordPass', ssl=True) as tm1:
content = tm1.cubes.cells.get_view_content(cube_name='Stack', view_name='OverFlow', private=False)
print(content)
I am getting the error message:
ConnectionError: HTTPSConnectionPool(host='localhost', port=8001): Max retries exceeded with url: /api/v1/Configuration/ProductVersion/$value (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000263C25C7A88>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
I think I am getting closer, getting a new error msg after getting the address and port from admin.
SSLError: HTTPSConnectionPool(host='host', port=port): Max retries exceeded with url: /api/v1/Configuration/ProductVersion/$value (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')")))

Getting this error when I use IBM Watson Tone Analyzer API. How can I resolve this?

requests.exceptions.ConnectionError:
HTTPSConnectionPool(host='api.eu-gb.tone-analyzer.watson.cloud.ibm.com', port=443):
Max retries exceeded with url:
/instances/76db955a-ebbb-46c9-a9ca-121542253a0c/v3/tone?version=2017-09-21&sentences=true
(Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x05533928>:
Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))`
The output console shows a part of the output I am getting while printing at runtime and then this max retries exceeded error message pops up. Please revert back as soon as possible.

Unable to call Azure Cognitive Services Computer Vision OCR API via python requests

I am getting a list of these errors when I execute the exact code from here:
gaierror: [Errno -3] Temporary failure in name resolution
NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f193b2d9048>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
MaxRetryError: HTTPSConnectionPool(host='mike-test.cognitiveservices.azure.com', port=443): Max retries exceeded with url: /vision/v2.1/ocr/?language=en&detectOrientation=false (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f193b2d9048>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
ConnectionError: HTTPSConnectionPool(host='mike-test.cognitiveservices.azure.com', port=443): Max retries exceeded with url: /vision/v2.1/ocr/?language=en&detectOrientation=false (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f193b2d9048>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
This is the list errors when I execute:
response = requests.post(ocr_url, headers=headers, params=params, data=image_data)
The request is working from Postman, but when I try it from python requests, it gives this error.

Max retries exceeded - Elasticsearch

I am trying to establish an elasticsearch connection and creating an index. But i get the following error:
elasticsearch.exceptions.ConnectionError: ConnectionError(HTTPConnectionPool(host='localhost', port=9200): Max retries exceeded with url: /test-index (Caused by <class 'socket.error'>: [Errno 111] Connection refused)) caused by: MaxRetryError(HTTPConnectionPool(host='localhost', port=9200): Max retries exceeded with url: /test-index (Caused by <class 'socket.error'>: [Errno 111] Connection refused))
My code is as follows:
self.es = Elasticsearch(hosts=[{"host": "http://192.168.0.5:9200", "port": 9200}], timeout=10)
self.es.indices.create(index='test-index', ignore=400 )
You do not configure the client correctly. It still tries to connect to localhost:9200. Since 9200 is the default port you can omit it.
Try this instead:
self.es = Elasticsearch(hosts=[{"host": "192.168.0.5"}], timeout=10)
You can find more info in the documentation

Categories

Resources