alandalusi
alandalusi

Reputation: 1145

Python: Max retries exceeded with url: /x.php (Caused by <class 'socket.gaierror'>)

I have set up a database and php file running on my host and I run a python code that uploads a json file every 5 minutes using the Requests module. After about 6-8 hours, the app crashes and produces this error:

Max retries exceeded with url: /rpitest2.php (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)

What could be the reason for this?

Upvotes: 1

Views: 2887

Answers (1)

sureshvv
sureshvv

Reputation: 4412

This could happen with badly formed URLs or a DNS failure.

Can you log the full URL that is being accessed? Seems like it is getting corrupted over time.

Upvotes: 1

Related Questions