Max retries exceed with url (Failed to establish a new connection: [Errno 110] Connection timed out)
Asked Answered
C

2

6
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='mycompanyurl.in',     
port=443): Max retries exceeded with url: /api/v1/issues.json (Caused by 
NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object 
at 0x51047d0>: Failed to establish a new connection: [Errno 110] Connection timed out',))

However, mycompanyurl.in is fine & I can open it in a browser as well. I'm using Python 2.7.5.

Centralize answered 7/6, 2020 at 1:57 Comment(1)
For those who have an application inside a Docker Container, and facing such issue: review docker logs (journalctl -u docker.service) and if you encounter a string like IPv4 forwarding is disabled. Networking will not work, restart the docker Systemd service (sudo systemctl restart docker.service). Pro tip, from someone who spent hours debugging migrations and models, thinking that Django was the issue...Shank
H
2

I faced this issue earlier and in my case the IP address of our server was not allowed to access the APIs by the APIs provider. So maybe you should contact with your API's provider to whitelist your server IP.

Hotbox answered 14/9, 2020 at 10:15 Comment(0)
P
0

I don't know exactly about your infrastructure, but I resolved the same issue.

For example, assuming you have AWS EC2 (internal IP:150.150.150.150 and external IP: 10.10.10.10) and a second one for any API (internal IP:x.x.x.x and external IP: y.y.y.y). Now, you want to call API on the second EC2.

If in you a security group of the second EC2 allow, for example, port 5000 on HTTP protocol for internal IP (150.150.150.150) of the first EC2 you will have this issue. When you write down the external IP (10.10.10.10) you will be successful.

To be close to your case, I would like to suggest check the security group/policy on the instance where 'mycompanyurl.in' is located. Maybe, there, something is wrong

Pyrexia answered 19/8, 2020 at 13:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.