mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.03k stars 1.51k forks source link

Gecko Driver Failed to decode response from marionette #2153

Closed livzz closed 4 months ago

livzz commented 5 months ago

System

lscpu

Architecture:            s390x
  CPU op-mode(s):        32-bit, 64-bit
  Byte Order:            Big Endian
CPU(s):                  2
  On-line CPU(s) list:   0,1
Vendor ID:               IBM/S390
  Machine type:          8561
  Thread(s) per core:    1
  Core(s) per socket:    1
  Socket(s) per book:    1
  Book(s) per drawer:    1
  Drawer(s):             2
  CPU dynamic MHz:       5200
  CPU static MHz:        5200
  BogoMIPS:              3241.00
  Dispatching mode:      horizontal
  Flags:                 esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt sie
Virtualization features: 
  Hypervisor:            z/VM 7.2.0
  Hypervisor vendor:     IBM
  Virtualization type:   full
Caches (sum of all):     
  L1d:                   256 KiB (2 instances)
  L1i:                   256 KiB (2 instances)
  L2d:                   8 MiB (2 instances)
  L2i:                   8 MiB (2 instances)
  L3:                    256 MiB
  L4:                    960 MiB
NUMA:                    
  NUMA node(s):          1
  NUMA node0 CPU(s):     0,1
Vulnerabilities:         
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Not affected
  Retbleed:              Not affected
  Spec store bypass:     Not affected
  Spectre v1:            Mitigation; __user pointer sanitization
  Spectre v2:            Mitigation; etokens
  Srbds:                 Not affected
  Tsx async abort:       Not affected
### Docker Build File
Refer [ppodgorsek/docker-robot-framework](https://github.com/ppodgorsek/docker-robot-framework) for all the scripts used below

FROM fedora:38

MAINTAINER Paul Podgorsek ppodgorsek@users.noreply.github.com LABEL description Robot Framework in Docker.

Set the reports directory environment variable

ENV ROBOT_REPORTS_DIR /opt/robotframework/reports

Set the tests directory environment variable

ENV ROBOT_TESTS_DIR /opt/robotframework/tests

Set the working directory environment variable

ENV ROBOT_WORK_DIR /opt/robotframework/temp

Setup X Window Virtual Framebuffer

ENV SCREEN_COLOUR_DEPTH 24 ENV SCREEN_HEIGHT 1080 ENV SCREEN_WIDTH 1920

Setup the timezone to use, defaults to UTC

ENV TZ UTC

Set number of threads for parallel execution

By default, no parallelisation

ENV ROBOT_THREADS 1

Define the default user who'll run the tests

ENV ROBOT_UID 1000 ENV ROBOT_GID 1000

Dependency versions

ENV XVFB_VERSION 1.20

By default, no reports are uploaded to AWS S3

ENV AWS_UPLOAD_TO_S3 false

Prepare binaries to be executed

COPY bin/chromedriver.sh /opt/robotframework/bin/chromedriver COPY bin/chromium-browser.sh /opt/robotframework/bin/chromium-browser COPY bin/run-tests-in-virtual-screen.sh /opt/robotframework/bin/

Install system dependencies

RUN dnf upgrade -y --refresh \ && dnf install -y \ firefox \ gcc \ gcc-c++ \ npm \ nodejs \ python3 \ python3-pip \ python3-pyyaml \ tzdata \ xorg-x11-server-Xvfb-${XVFB_VERSION}* \ dnf-plugins-core \ && dnf clean all

RUN dnf install -y rustc cargo RUN dnf install -y python3-devel

RUN dnf install -y openssl openssl-devel RUN GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 pip3 install grpcio grpcio-tools

i Install Robot Framework and associated libraries

RUN GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 pip3 install \ --no-cache-dir \ robotframework==6.1.1 \ robotframework-browser==16.2.0 \ robotframework-seleniumlibrary==6.2.0

RUN pip3 install --no-cache-dir selenium==4.9.0 RUN dnf install -y firefox-111* RUN mkdir -p /opt/robotframework/drivers/ COPY geckodriver /opt/robotframework/drivers/geckodriver COPY geckodriver /usr/local/bin ADD release /opt/robotframework/drivers/ ADD release /usr/local/bin/

ENV PATH=/usr/local/bin:$PATH

FIXME: Playright currently doesn't support relying on system browsers, which is why the --skip-browsers parameter cannot be used here.

RUN rfbrowser init

Create the default report and work folders with the default user to avoid runtime issues

These folders are writeable by anyone, to ensure the user can be changed on the command line.

RUN mkdir -p ${ROBOT_REPORTS_DIR} \ && mkdir -p ${ROBOT_WORK_DIR} \ && chown ${ROBOT_UID}:${ROBOT_GID} ${ROBOT_REPORTS_DIR} \ && chown ${ROBOT_UID}:${ROBOT_GID} ${ROBOT_WORK_DIR} \ && chmod ugo+w ${ROBOT_REPORTS_DIR} ${ROBOT_WORK_DIR}

Allow any user to write logs

RUN chmod ugo+w /var/log \ && chown ${ROBOT_UID}:${ROBOT_GID} /var/log

Update system path

ENV PATH=/opt/robotframework/bin:/opt/robotframework/drivers:$PATH

Set up a volume for the generated reports

VOLUME ${ROBOT_REPORTS_DIR}

USER ${ROBOT_UID}:${ROBOT_GID}

A dedicated work folder to allow for the creation of temporary files

WORKDIR ${ROBOT_WORK_DIR}

Execute all robot tests

CMD ["run-tests-in-virtual-screen.sh"]


## Testcase

Settings Documentation Simple example using SeleniumLibrary. Library SeleniumLibrary

Variables ${GOOGLE URL} https://www.google.com/ ${BROWSER} Firefox

Test Cases Valid Search Set Selenium Speed .1 seconds Open Browser To Google Input Search Keyword github Capture Search Result [Teardown] Close Browser

Keywords Open Browser To Google Open Browser ${GOOGLE URL} ${BROWSER} Title Should Be Google Wait Until Element Is Visible name=q Capture Page Screenshot landing.png

Input Search Keyword [Arguments] ${keyword} Set Focus To Element name=q Input Text name=q ${keyword} Capture Page Screenshot landing-input.png Press Keys name=q ENTER

Capture Search Result Wait Until Element Is Visible id=search Capture Page Screenshot search-result.png


## Stacktrace

Opens a new browser instance to the optional url. Start / End / Elapsed: 20240118 15:49:58.384 / 20240118 15:50:00.973 / 00:00:02.589 15:49:58.385 TRACE Arguments: [ 'https://www.google.com/' | 'Firefox' ]
15:49:58.385 INFO Opening browser 'Firefox' to base url 'https://www.google.com/'.
15:49:58.386 TRACE Firefox driver log is always forced to to: /opt/robotframework/reports/geckodriver-3.log
15:49:58.387 DEBUG Started executable: /opt/robotframework/drivers/geckodriver in a child process with pid: 23
15:49:58.890 DEBUG POST http://localhost:57561/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts": true, "moz:debuggerAddress": true, "pageLoadStrategy": "normal", "moz:firefoxOptions": {"profile": "UEsDBBQAAAAIAH1SMljrmRmacgMAAJoMAAAHAAAAdXNlci5qc6VWTW/UMBC98ytQTyCx1rbABU6lFAkJUcSq4mg59mTjrmMbe7zp/nvGyaYsbb6AWz7e89hvZt44RQjcByhfnBXBNfTGlKtZo61yDVOp9gysKAyos1fPMSR4+f5ZesoxAiGEZE/ApTBxBG2hQVGwFAzhzkThEr4rjLC7sym8F1tYtn5EETB5lhmEXE+jKlfDEblgL49Z3O3p5FoBqyM6266it9YFGFmAPqkb+6MVOJ6vmbYY3O33L9Phc1Jqcc9lFSgwjzJoj5wU56jrHPT1epiwDBnAu4BcGMPvIod7CR61s3Ew6XdiL7plmetgLFau+Wyv6NEZGCRZwMaFHZOCKHtY5XjCrAiw13ImrxFkChoPTMa+HEeAj5PTgJFZr9lSm2IyoZTO5xQzizRQqECHC1zIrCBPlNsUERSXEHBYzRNSjClHfCBp+gBhkCW8Z8krajsmErphOU5Ai/pG6eiNOIC6Pl9vvjqkxBDhzQjYNdY4oajKLAkW2hr4UYHdZCm13U7Hur79csn63pn0lhb5mnWSzvmQtjsqSrBUw+RIXcYu5rDkL53hjYNdWRJ+pOx6UAChsjKAIGmnn3SIeElayJGeePAUUUL7TKotdLhTRi1MI8JSbwQRZHUsizmoKWPyuVN7rx4zRYgx+wCS7ZEKbRmXZFRcBhGrmSgVGMNkBXL3EUqRDH7o/kzTaCBERse2N/bKuDhzlBP0DWV8GEyKiM4Is6oVCINV984W2dQEP/ncKtf/yO6jl7mgvqe/375x223+KDuD/ot9eGe0PLD8cZOKWrd5/l/+t/bj5e+GHloG9uiciYwcwoXjxifvInmOkYNlAG/bWtHQsFuelR+OkT3CtoXbmujHjryRxM5efb4ehRfGyZ3REacr4oTRFviVq71AXWiTp5nV2wrNYZa6xMKfwi35d3m4HW2kkyk+pWo/tzuXXx19cEXzElMcXrmnVIh0B6t0rA6r/NvTgFsZsFvMlnDx9u2ftH5pmlqUD2Ncw4sDV50nDO7Nk8V4jLm7ee2UMAuvEaU2QE/MBU1twbsazTejGXzEoCXyx7ShUPkKaMkKa6gLCJv2dUSuXOY7jewoWz9Oj6U8ePCegmAoAoYD66RoT34xh50U6Sk8wF07zgZ3cu812T5li+UjU02Q+xPjZ9JhLMJvSlNpCpO7aIDxC1BLAQIUAxQAAAAIAH1SMljrmRmacgMAAJoMAAAHAAAAAAAAAAAAAACkgQAAAAB1c2VyLmpzUEsFBgAAAAABAAEANQAAAJcDAAAAAA=="}}}}
15:49:58.891 DEBUG Starting new HTTP connection (1): localhost:57561
15:50:00.967 DEBUG http://localhost:57561/ "POST /session HTTP/1.1" 500 105
15:50:00.967 DEBUG Remote response: status=500 | data={"value":{"error":"unknown error","message":"Failed to decode response from marionette","stacktrace":""}} | headers=HTTPHeaderDict({'content-type': 'application/json; charset=utf-8', 'cache-control': 'no-cache', 'content-length': '105', 'date': 'Thu, 18 Jan 2024 10:19:58 GMT'})
15:50:00.967 DEBUG Finished Request
15:50:00.967 INFO Cannot capture screenshot because no browser is open.
15:50:00.967 FAIL WebDriverException: Message: Failed to decode response from marionette

15:50:00.973 DEBUG Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/SeleniumLibrary/init.py", line 518, in run_keyword return DynamicCore.run_keyword(self, name, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/robotlibcore.py", line 133, in run_keyword return self.keywords[name](*args, **(kwargs or {})) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/SeleniumLibrary/keywords/browsermanagement.py", line 282, in open_browser return self._make_new_browser( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/SeleniumLibrary/keywords/browsermanagement.py", line 313, in _make_new_browser driver = self._make_driver( ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/SeleniumLibrary/keywords/browsermanagement.py", line 767, in _make_driver driver = self._webdriver_creator.create_driver( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/SeleniumLibrary/keywords/webdrivertools/webdrivertools.py", line 85, in create_driver return creation_method( ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/SeleniumLibrary/keywords/webdrivertools/webdrivertools.py", line 213, in create_firefox return webdriver.Firefox( ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/firefox/webdriver.py", line 201, in init super().init(command_executor=executor, options=options, keep_alive=True) File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 286, in init self.start_session(capabilities, browser_profile) File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in start_session response = self.execute(Command.NEW_SESSION, parameters) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Failed to decode response from marionette


## geckodriver-3.log

1705573198389 geckodriver INFO Listening on 127.0.0.1:57561 1705573199181 mozrunner::runner INFO Running command: MOZ_CRASHREPORTER="1" MOZ_CRASHREPORTER_NO_REPORT="1" MOZ_CRASHREPORTER_SHUTDOWN="1" MOZ_NO_REMOTE="1" "/usr ... te" "--remote-debugging-port" "41933" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "/tmp/rust_mozprofileIWcp36" console.warn: services.settings: Ignoring preference override of remote settings server console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment 1705573200096 Marionette INFO Marionette enabled 1705573200101 Marionette INFO Listening on port 34129 Read port: 34129 WebDriver BiDi listening on ws://127.0.0.1:41933 1705573200257 RemoteAgent WARN TLS certificate errors will be ignored for this session Crash Annotation GraphicsCriticalError: |[0][GFX1]: Unknown image format 0 (t=1.66245) [GFX1]: Unknown image format 0 Exiting due to channel error. Exiting due to channel error.



### Description
I am using an s390x machine for running Automated UI Test using Robot Framework in the CI/CD Pipeline. The above mention test working in x86 machine with the above docker image build.

Note: I have compiled the gecko driver for s390x by downloading it from [github releses](https://github.com/mozilla/geckodriver/releases/tag/v0.33.0) which I am using the above mentioned docker build.
whimboo commented 5 months ago

There is a GFX critical error which caused Firefox to abort during startup:

Crash Annotation GraphicsCriticalError: |[0][GFX1]: Unknown image format 0

Do you have a chance to extract the crash report from that machine when following the steps as described in this document?

https://firefox-source-docs.mozilla.org/testing/geckodriver/CrashReports.html

Is the same happening when you are not passing in a custom profile?

livzz commented 5 months ago

I followed the steps as described in the document, but I am unable to extract the crash report. Can you suggest me any other alternative to extract the crash report.

whimboo commented 5 months ago

Right now I don't have another solution, sorry. But I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1875773 so that we can get the crash reporter enabled for investigation scenarios only.

livzz commented 5 months ago

That's really great, I am open for suggestion.

whimboo commented 4 months ago

@livzz we now have the new feature in a geckodriver nightly build. And maybe you could have a try to see if it helps to retrieve the crash report?

You can download the 64bit nightly build for Linux from Treeherder. When opening the link please check the lower pane which lists the geckodriver.tar.gz binary. Download and extract this file and you can then use geckodriver with the --enable-crashreporter command line argument. For more details especially around sharing the crash information check again our documentation.

Thanks!

livzz commented 4 months ago

Hey @whimboo as I am running it on s390x arch, it would require a rebuild. If you can point me to the source such that I can build it.

whimboo commented 4 months ago

Is that a 64bit? If yes please check my link again. there is another Aarch64 build listed which you could just grab. Did that help?

livzz commented 4 months ago

yes @whimboo this is 64bit system, I have already posted the system details above. I have tried with both x64 and Aarch64 build but it didn't work. It throws an error saying OSError: [Errno 8] Exec format error: If you can provide me the source code as such release, which I can build it for s390x architecture system.

whimboo commented 4 months ago

@livzz interesting. Not sure why this doesn't work then. Which geckodriver binary are you usually downloading or does it come with the system?

To build yourself I would suggest the following steps:

  1. Clone this repository and checkout the https://github.com/mozilla/geckodriver/tree/release branch
  2. Download the raw diff from https://phabricator.services.mozilla.com/D200140 (3rd item in the top-right box)
  3. Apply the patch probably with using the -p3 argument of the patch command
  4. Install the Rust compiler and run cargo build.
whimboo commented 4 months ago

Due to a missing reply from the reporter I'm going to close this issue as incomplete for now. I'm happy to reopen in case the requested information is provided.