robotframework-browser icon indicating copy to clipboard operation
robotframework-browser copied to clipboard

Browserlibrary Docker container does not work on Apple Mac M1

Open SeppoTuura opened this issue 2 years ago • 3 comments

Bug Description When executing docker container run --rm -v /path_to_your_working_folder/:/test --ipc=host --security-opt seccomp=/path_to_your_working_folder/seccomp_profile.json --user pwuser marketsquare/robotframework-browser bash -c "robot --outputdir /test /test" command on Apple MacBook M1 following error is received:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Test

Test.Bugreport

Open Web Page And Crawl Links :: Basic test for crawl links on web... [ WARN ] Keyword 'Take Screenshot fail-screenshot-{index}' could not be run on failure: Error: Tried to take screenshot, but no page was open. | FAIL | Error: browser.newContext: Browser closed. ==================== Browser output: ==================== /home/pwuser/.local/lib/python3.8/site-packages/Browser/wrapper/node_modules/playwright-core/.local-browsers/chromium-1005/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-7preHm --remote-debugging-pipe --no-startup-w... [ Message content over the limit has been removed. ] [pid=245][err] [0524/082320.446736:ERROR:file_path_watcher_inotify.cc(329)] inotify_init() failed: Function not implemented (38) [pid=245][err] [0524/082320.548537:WARNING:bluez_dbus_manager.cc(248)] Floss manager not present, cannot set Floss enable/disable. [pid=245][err] [0524/082320.553055:ERROR:gpu_process_host.cc(967)] GPU process launch failed: error_code=1002 [pid=245][err] [0524/082320.553151:WARNING:gpu_process_host.cc(1273)] The GPU process has crashed 1 time(s) [pid=245][err] [0524/082320.573965:ERROR:gpu_process_host.cc(967)] GPU process launch failed: error_code=1002 [pid=245][err] [0524/082320.574043:WARNING:gpu_process_host.cc(1273)] The GPU process has crashed 2 time(s) [pid=245][err] [0524/082320.586672:ERROR:gpu_process_host.cc(967)] GPU process launch failed: error_code=1002 [pid=245][err] [0524/082320.586744:WARNING:gpu_process_host.cc(1273)] The GPU process has crashed 3 time(s) [pid=245][err] [0524/082320.593181:ERROR:gpu_process_host.cc(967)] GPU process launch failed: error_code=1002 [pid=245][err] [0524/082320.593239:WARNING:gpu_process_host.cc(1273)] The GPU process

Test.Bugreport | FAIL | 1 test, 0 passed, 1 failed

Test | FAIL | 1 test, 0 passed, 1 failed

Output: /test/output.xml Log: /test/log.html Report: /test/report.html

According to https://docs.docker.com/desktop/mac/apple-silicon/ the problem is related to processor architecture: In summary, running Intel-based containers on Arm-based machines should be regarded as “best effort” only. We recommend running arm64 containers on Apple silicon machines whenever possible, and encouraging container authors to produce arm64, or multi-arch, versions of their containers. We expect this issue to become less common over time, as more and more images are rebuilt supporting multiple architectures.

To Reproduce Steps to reproduce the behavior: NOTE!: Development environment with Docker and marketsquare/robotframework-browser image must be already installed!

  1. Use MacBook WITH M1 processor
  2. Unzip attached files to your working directory
  3. Execute following command: docker container run --rm -v /path_to_your_working_directory:/test --ipc=host --security-opt seccomp=/path_to_your_working_directory/seccomp_profile.json --user pwuser marketsquare/robotframework-browser bash -c "robot --outputdir /test /test"
  4. See error

Expected behavior Expected behavior is that test is passed without error when Docker image is used. NOTE:

  • This test works on Mac M1 when using firefox instead of chromium and also when the test is executed without container using chromium.
  • This same error message is received also another M1 chip based Mac so it seems to be general
  • Probable solution: Marketsquare builds ARM64 based image with Chromium which supports ARM64 architecture

Desktop (please complete the following information): macOS Monterey Version 12.3.1 MacBook Pro (14 inch, 2021) Chip: Apple M1 Pro Memory: 32 GB Docker version: 20.10.12, build e91ed5707e

Additional context Files what have been used to demonstrate the problem. bugreport.robot.zip seccomp_profile.json.zip

SeppoTuura avatar May 24 '22 09:05 SeppoTuura

@xylix this belongs to your are of expertise, could you look at some point.

aaltat avatar Jun 11 '22 11:06 aaltat

@allcontributors please add @SeppoTuura for bugs

aaltat avatar Jun 11 '22 11:06 aaltat

@aaltat

I've put up a pull request to add @SeppoTuura! :tada:

allcontributors[bot] avatar Jun 11 '22 11:06 allcontributors[bot]

Hi! Any updates on this issue?

AllanMedeiros avatar Jan 26 '23 20:01 AllanMedeiros

@xylix Any news related to this?

SeppoTuura avatar Jan 27 '23 07:01 SeppoTuura

Need M1 support for docker images, if you can please help @xylix

4nif avatar Jan 29 '23 08:01 4nif

that should be solved now.

Snooz82 avatar Jul 28 '23 20:07 Snooz82

Closing due inactivity.

aaltat avatar Aug 12 '23 10:08 aaltat