"Failed to decode response from marionette" message in Python/Firefox headless scraping script "Failed to decode response from marionette" message in Python/Firefox headless scraping script selenium selenium

"Failed to decode response from marionette" message in Python/Firefox headless scraping script


For anyone else experiencing this issue when running selenium webdriver in a Docker container, increasing the container size to 2gb fixes this issue.

I guess this affects physical machines too if the OP fixed their issue by upgrading their server RAM to 2Gb, but could be coincidence.


I still don't know why this is happening but I may have found a work around. I read in some documentation there may be a race condition (on what, I am not sure since there shouldn't be two items competing for the same resources).

I changed the scraping code to do this:

import timebrowserObj.get(url)time.sleep(3)soup = BeautifulSoup(browserObj.page_source, 'lxml')

No specific reason why I chose 3 seconds but since adding this delay I have not had the Message: failed to decode response from marionette error from any of my list of URLs to scrape.


Update: October, 2018

This continues to be an issue over six months later. Firefox, Geckodriver, Selenium and PyVirtualDisplay have all been updated to their latest versions. This error kept reoccurring spontaneously without pattern: sometimes working and sometimes not.

What fixed this issue is increasing RAM on my server from 1 GB to 2 GB. Since the increase there have been no failures of this sort.


This error message...

Message: failed to decode response from marionette

...implies that the communication between GeckoDriver and Marionette was interrupted/broken.


Some of the reasons and solution for this issue are as follows:

Steps: Configure SHM size in the docker container

  • Similarly, while executing your test in your localhost, it is advisable to keep the following (minimum) configuration:

    --memory 1024mb

Additional Considerations

This issue can also occur due to incompatibility between the version of the binaries you are using.

Solution:

  • Upgrade JDK to recent levels JDK 8u341.
  • Upgrade Selenium to current levels Version 3.141.59.
  • Upgrade GeckoDriver to GeckoDriver v0.26.0 level.
  • Upgrade Firefox version to Firefox v72.0 levels.
  • Execute your Test as a non-root user.

GeckoDriver, Selenium and Firefox Browser compatibility chart

GeckoDriverVersions


tl; dr

[e10s] Crash in libyuv::ARGBSetRow_X86


Reference

You can find a relevant detailed discussion in: