Forums

Selenium - Crashing only during Always-On

Hello,

I've written a couple functions using Selenium and have designated them as always-on. These functions get called every 5 minutes from my Anvil Web App using Uplink.

The functions work as intended when I run them manually, but they are failing when they are run as part of my scheduled task.

I was originally using Chrome, but I read that it's not supported so I've switched to fire fox.

The error I was getting with Chrome was:

WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (Driver info: chromedriver=2.42.591071

The error I'm getting now using Firefox is:

WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.

Again, when I run the scripts manually there are no issues so I'm not sure what is happening.

Thanks,

Dane Finkbeiner

UPDATE: I've switched back to Chrome based on some other findings, and the weird thing is it worked for the first few times the function was called them stopped after.

The error I'm getting now is:

MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=55087): Max retries exceeded with url: /session/bd0afcab14a0417f94c9255b14ab715b/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff3541d34f0>: Failed to establish a new connection: [Errno 111] Connection refused'))

Again, I've ran the script in the console and it did exactly as intended. Only having issues for the always-on task.

Thanks,

Dane Finkbeiner

How does your code look like and what url do you try to hit and how. Could you email us at support@pythonanywhere.com not to share the details on the public forums?

Email send with the code.

Thanks!