Forums

Chrome driver crashing

Hi,

until Sunday the driver was working fine, but today I get

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed. Aug 2 12:30:43 (unknown error: DevToolsActivePort file doesn't exist) Aug 2 12:30:43 (The process started from chrome location /bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

What changed in between?

Thanks,

Giovanni

Edit: the issue appears when I launch the script as a always-on-task. Launching the script manually works as intended

Update August 3rd: I was able to partially solve the issue by adding the option --no-sandbox. It still crashes occasionally, but at lest now it starts.

That may be because chrome is starting a large number of processes or using a large amount of memory, so the task is failing because of using too many processes or too much memory. Does it crash for the same page every time or different pages?

My program is very simple and it just scraps one page at regular intervals. As I wrote, the option --no-sandbox mitigates the issue, but still I don't understand why it behaves differently when run from console or as always-on task. Are the libraries or the underneath system different? Thanks.

no-sandbox is necessary. Take a look at our example that has all the required options https://help.pythonanywhere.com/pages/selenium