Browser launch error on Raspberry Pi 3

Hi everyone!
I’m trying to run a test on a Raspberry Pi 3. This test works very well in my notebook with Ubuntu 20.04, but when I try to run on the Rpi I got the error Error: browserType.launch: Protocol error (Browser.getVersion): Browser closed.
Did anyone see something like this before?

Error
pi@raspberrypi:~/poc-python-robot-framework/pfm_example $ cat playwright-log.txt
{“level”:30,“time”:“2021-06-22T14:51:49.004Z”,“pid”:1126,“hostname”:“raspberrypi”,“msg”:“Listening on 35847”}
================= Original suppressed error =================
browserType.launch: Protocol error (Browser.getVersion): Browser closed.
==================== Browser output: ====================
/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/node_modules/playwright/.local-browsers/chromium-888113/chrome-linux/chrome --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=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies,LazyFrameLoading,GlobalMediaControls --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 --user-data-dir=/tmp/playwright_chromiumdev_profile-0hOoZK --remote-debugging-pipe --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-startup-window
pid=1285
[pid=1285][err] /home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/node_modules/playwright/.local-browsers/chromium-888113/chrome-linux/chrome: 1: /home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/node_modules/playwright/.local-browsers/chromium-888113/chrome-linux/chrome: Syntax error: “(” unexpected
[pid=1285]
[pid=1285] starting temporary directories cleanup
=========================== logs ===========================
/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/node_modules/playwright/.local-browsers/chromium-888113/chrome-linux/chrome --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=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies,LazyFrameLoading,GlobalMediaControls --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 --user-data-dir=/tmp/playwright_chromiumdev_profile-0hOoZK --remote-debugging-pipe --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-startup-window
pid=1285
[pid=1285][err] /home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/node_modules/playwright/.local-browsers/chromium-888113/chrome-linux/chrome: 1: /home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/node_modules/playwright/.local-browsers/chromium-888113/chrome-linux/chrome: Syntax error: “(” unexpected
[pid=1285]
[pid=1285] starting temporary directories cleanup

Note: use DEBUG=pw:api environment variable to capture Playwright logs.
Error
at Object.captureStackTrace (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/node_modules/playwright/lib/utils/stackTrace.js:51:19)
at Connection.sendMessageToServer (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/node_modules/playwright/lib/client/connection.js:69:48)
at Proxy. (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/node_modules/playwright/lib/client/channelOwner.js:64:61)
at /home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/node_modules/playwright/lib/client/browserType.js:59:67
at BrowserType._wrapApiCall (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/node_modules/playwright/lib/client/channelOwner.js:77:34)
at BrowserType.launch (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/node_modules/playwright/lib/client/browserType.js:50:21)
at /home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:25886:64
at step (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:25822:23)
at Object.next (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:25803:53)
at /home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:25797:71
at new Promise ()
at webpack_modules…/node/playwright-wrapper/playwright-state.ts.__awaiter (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:25793:12)
at _newBrowser (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:25872:12)
at /home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:26473:42
at step (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:25822:23)
at Object.next (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:25803:53)
at /home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:25797:71
at new Promise ()
at webpack_modules…/node/playwright-wrapper/playwright-state.ts.__awaiter (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:25793:12)
at newBrowser (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:26465:12)
at PlaywrightServer. (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:24046:50)
at step (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:23999:23)
at Object.next (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:23980:53)
at /home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:23974:71
at new Promise ()
at webpack_modules…/node/playwright-wrapper/grpc-service.ts.__awaiter (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:23970:12)
at PlaywrightServer.newBrowser (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:24037:55)
at handleUnary (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:17918:13)
at processTicksAndRejections (internal/process/task_queues.js:95:5)

================= Original suppressed error =================
Error: Tried to take screenshot, but no page was open.
at Object.exists (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:25732:15)
at /home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:22895:41
at step (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:22842:23)
at Object.next (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:22823:53)
at /home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:22817:71
at new Promise ()
at webpack_modules…/node/playwright-wrapper/browser-control.ts.__awaiter (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:22813:12)
at takeScreenshot (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:22869:12)
at PlaywrightServer. (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:24046:50)
at step (/home/pi/.local/lib/python3.7/site-packages/Browser/wrapper/index.js:23999:23)

Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster

Node.js v14.17.1.

Robot Framework 4.0.3 (Python 3.7.3 on linux)

lib browser version = latest (5.1.1)

Hi Evaldo,

That error is telling you that browser launched chromium but there was no chromium window for it to control, usually you get this type of error when the browser crashes, fails to launch or someone closes the browser window while a test is running. In your case i’m guessing it’s chromium failed to launch?

The Raspberry Pi 3 is a fairly low specked device, based on what I found (see below) it only has 1GB of ram, also after searching for the ram requirements for chrome/chromium I didn’t find anything specific but found that chromium-os seems to need a minimum of 2GB, and that doesn’t have the overhead of a full desktop environment.

  • Have you confirmed that chromium will actually run on your device?
  • have you tried one of the other browser engines? Though i’m not sure which ones will work with your memory constraints.

It seems Raspbian has a custom browser perhaps this is because the mainstream browsers need more ram than is available?

Raspberry Pi 3 Specifications

SoC: Broadcom BCM2837
CPU: 4× ARM Cortex-A53, 1.2GHz
GPU: Broadcom VideoCore IV
RAM: 1GB LPDDR2 (900 MHz)
Networking: 10/100 Ethernet, 2.4GHz 802.11n wireless
Bluetooth: Bluetooth 4.1 Classic, Bluetooth Low Energy
Storage: microSD
GPIO: 40-pin header, populated
Ports: HDMI, 3.5mm analogue audio-video jack, 4× USB 2.0, Ethernet, Camera Serial Interface (CSI), Display Serial Interface (DSI)

Hi Dave!

Thanks for the quick answer.

Well, I just found out Playwright does not support Raspberry Pi.

I’ll still try one more time in a Raspberry Pi 4. If have success I’ll update this issue.

Have you confirmed that chromium will actually run on your device?
Yes.

have you tried one of the other browser engines? Though i’m not sure which ones will work with your memory constraints.
Yes, unfortunatelly none worked.

Thanks again.

Hi Evaldo,

Ah I see, it’s Playwright not being compiled for the RPi cpu’s

I don’t have a RPi so have never tried this, I do have an OrangePi and was successful in using RobotFramework with SeleniumLibrary on it with Armbian, though with my Orange Pi only having 1/2Gb of ram it couldn’t run Chromium, but I did manage to run firefox.

So SeleniumLibrary might be an option for you as well?

Dave.

Hi Dave!
Sorry for the delayed reply.

I didn’t want to use Selenium, but it is a option for sure. I executed another test which uses SeleniumLibrary and after install the chromium driver, it worked!

sudo apt-get install chromium-chromedriver
==============================================================================
Unsuccessful Login :: In this test there is an attempt to login at... | PASS |
------------------------------------------------------------------------------

Thank you for your help!!

1 Like