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

3

13

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

Catacaustic answered 29/11, 2018 at 14:53 Comment(0)
E
4

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

Everetteverette answered 21/10, 2019 at 14:59 Comment(1)
Can you please explain in detail how this will solve the issue above?Cysteine
J
0

After looking into the documentation (https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#How_to_use_command_options), there is no such flag for Firefox.

Jeramie answered 30/12, 2019 at 15:17 Comment(0)
I
0

As link you sent says flag --disable-dev-shm-usage is replacement for flag --shm-size=2g in Chrome. In Firefox you can still use flag --shm-size=2g.

Institutive answered 21/8, 2022 at 21:37 Comment(1)
It says that --disable-dev-shm-usage makes Chrome use /tmp instead of /dev/shm. It has nothing to do with the size of /dev/shm used, and it is a safe bet that setting --shm-size=0g on Firefox will break IPC.Imelda

© 2022 - 2024 — McMap. All rights reserved.