Forums

Selenium

Hi,

I have been running a scheduled Task for the past week or 2. Everything has been working until yesterday. Been getting an error from Selenium.

This is the code that seems to be causing the error.

display = Display(visible=0, size=(800, 600))
display.start()
browser = webdriver.Firefox()

Here is the actual error received

selenium.common.exceptions.WebDriverException: Message: "The browser appears to have exited before we could connect. The output was: \n(process:31149): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed\nError: cannot open display: :2492\n"

To be clear everything was working well for the past week or 2. Just yesterday, I started getting the error above.

Hmm. When I run the following code:

from pyvirtualdisplay import Display
from selenium import webdriver

display = Display(visible=0, size=(800, 600))
display.start()
browser = webdriver.Firefox()

I do not get any errors. Can you double check that you get an error on your side?

If you search for selenium forum posts, one of them is this- maybe check how many displays you have opened?

You can do this by going to the Schedule tab, and fetching/updating the currently running tasks and subprocesses. We just had a new deploy so you wouldn't have any running processes right now, but check it out after the next scheduled run.

I have checked the running processes under the scheduled tab, and there does not seem to be anything.

Nothing running (hit the small refresh icon above and to the right of this list to update it)

My error under Scheduled Task has now changed to the following

IOError: [Errno 122] Disk quota exceeded: u'/tmp/tmpa7yYAJ.webdriver.xpi/components/command_processor.js'

When I run the following recommended code in a Bash Console I seem to get the same error I started with

from pyvirtualdisplay import Display
from selenium import webdriver

display = Display(visible=0, size=(800, 600))
display.start()
browser = webdriver.Firefox()

This is the error that is returned with the code above:

selenium.common.exceptions.WebDriverException: Message: "The browser appears to have exited before we could connect. The output was: \n(process:12014): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed\nError: cannot open display: :2211\n"

Perhaps this error is the problem:

IOError: [Errno 122] Disk quota exceeded: u'/tmp/tmpa7yYAJ.webdriver.xpi/components/command_processor.js'

Your account comes with 512MB of disk space, and it looks like you've used up pretty much all of it. Selenium tends to dump stuff into /tmp, so perhaps if you clear that down a bit you'll clear up enough space to get things working again.

Thanks, this appears to have solved the problem. Will continue to monitor and keep an eye on it.

Great -- thanks for confirming!

If it keeps happening you could consider writing a scheduled task to run daily and clear out the /tmp/ directory.

Where is the /tmp directory. I am unable to locate it.

You can navigate to it using the "breadcrumbs" at the top of the "Files" page -- click on the initial "/" to go to the directory /, then click on "tmp".