Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Firefox Gecko equivalent to Chrome's --disable-dev-shm-usage flag

Docker environment: Docker Container, ubuntu:18.10, geckodriver-v0.23.0-linux64, selenium-3.14.1

In Chrome, I did not have enough resources allocated to my Docker Container. Adding the "--disable-dev-shm-usage" flag to Chrome fixed the issue. Since its using local /tmp instead of it's /dev/shm it has plenty of room.

Now I need to fix the same issue for the Geckodriver. I can't find documentation for Geckodriver's equivalent flag to "--disable-dev-shm-usage".

Does anyone know if there is an equivalent and/or what it is? Alternate ideas welcome.

Edit: Adding error messages:

I’m taking screenshots of specific elements on some very large webpages. Sometimes 200 images.

.

My Warning: Could not create image for ".thumbnail_none > .item-label-href[rel="nofollow"][target="_blank"] > .video-label-box > .branding" because:
Message: Browsing context has been discarded

My Warning: Could not create image for".thumbnail_none > .item-label-href[rel="nofollow"][target="_blank"] > .video-label-box > .branding" because:
Message: [Exception... "Failure"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://marionette/content/browser.js :: get rect :: line 254"  data: no]

My Warning: Could not create image for".active___2c4EX > .content___1UWin > .duration___fewg4" because:
Message: Browsing context has been discarded

My Warning: Could not create image for".article___1MtWi:nth-child(2) > .teaseCard > .think-module.teaseCard__picture > .eyebrow___3eQZ6.ph4-m.pt4 > .vilynx_listened > span" because:
Message: Failed to decode response from marionette

My Warning: Could not create image for".article___1Fn4y:nth-child(1) > .content___2Wmo9.teaseCard > .think-module.teaseCard__picture > .eyebrow___3eQZ6.ph4-m.pt4 > .vilynx_listened > span" because:
Message: Tried to run command without establishing a connection

All messages after that repeat every time the function that looks for the selector to make the image is called:

My Warning: Could not create image for"div[observeid="tbl-observe-1"] > .item-label-href[rel="nofollow"][target="_blank"] > .trc-main-label.video-label-box > .branding" because:
Message: Tried to run command without establishing a connection

Warning: Could not create image for".videoCube_2_child > .item-label-href[rel="nofollow"][target="_blank"] > .trc-main-label.video-label-box > .branding" because:
Message: Tried to run command without establishing a connection

Warning: Could not create image for".videoCube_3_child > .item-label-href[rel="nofollow"][target="_blank"] > .trc-main-label.video-label-box > .branding" because:
Message: Tried to run command without establishing a connection

Additional tracebacks for Chromedriver can be found in another unanswered question I have: Why would using Selenium webdriver to execute JS fine locally on my Mac, but not in a Docker container?

Adding "--disable-dev-shm-usage" does fix that question for Chomedriver, but I wanted to get an answer to the Geckodriver before I self answer. Feel free to answer that one if you have the answer. I will test and mark your answer as correct.

They are separate questions because I don't know 100% that they are the same issue.

Edit: Removed one unrelated stacktrace

like image 397
heart.cooks.mind Avatar asked Nov 29 '18 14:11

heart.cooks.mind


1 Answers

Try to use a volume in the docker run execution with the flag -v /dev/shm:/dev/shm

This should work for chrome and firefox execution without any flag in the capabilities

Documentation

like image 116
Jose Martínez Poquet Avatar answered Oct 09 '22 14:10

Jose Martínez Poquet