Forums

Requests Frequently Failing in Always On tasks

Hi, I am frequently getting the exception:

Exception HTTPSConnectionPool(host='<url removed>', port=443): Max retries exceeded with url: /searches (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7cf692e98760>: Failed to establish a new connection: [Errno -2] Name or service not known')).

I noticed this issue has been happening since September. Anyone know what's going on?

It's possible your task ended up on a busy server, could you try restarting it and see if that helps? If the issue continues, could you provide us with more details (e.g. how often this happens, is there a pattern, etc.)?

Im having same issue, I have an hourly task to an pythonanywhere app, and its just failing since 2am. If I run the same command in bash, it runs... but on tasks, it doesnt.

@xdyes27 Scheduled tasks run on different infrastructure, so that's not the same issue. What makes you think your task is not running? If it's based on logs, they should've been updated by now (there was a period yesterday that our logging system had some issues).

Still having this issue, and this isn't specific to one domain, experiencing it on multiple different ones. I also get Exception (2005, "Unknown MySQL server host '<user>.mysql.pythonanywhere-services.com' (-3)"). about 10 times a day. There is no clear pattern, it's random and sometimes there are 2-3 minutes of constant request failures.

Unfortunately, the DNS in always on tasks can be a bit flaky. We are trying to fix it. IN the meantime, I'd suggest retries on failure to keep your task runnging.