Giter Site home page Giter Site logo

Comments (15)

vogler avatar vogler commented on May 22, 2024 1

Ok, right, the problem is that my Raspbian only has a 64bit kernel and apt packages are still 32bit.
By now they offer 64bit images for everything, but migrating is not supported: https://www.raspberrypi.com/news/raspberry-pi-os-64-bit/

Thanks, I'll mention it in the readme!

from free-games-claimer.

WiLuX-Source avatar WiLuX-Source commented on May 22, 2024 1

I run my OS with desktop environment. I am not having issues, just wanted to clarify things because I saw something related to rpi.

from free-games-claimer.

vogler avatar vogler commented on May 22, 2024

Apparently Ubuntu is supported (only 32 bit?):

rpi3:

$ npx playwright install chrome
Switching to root user to install dependencies...
++ arch
+ [[ armv7l == \a\a\r\c\h\6\4 ]]
+ [[ ! -f /etc/os-release ]]
++ bash -c 'source /etc/os-release && echo $ID'
+ ID=raspbian
+ [[ raspbian != \u\b\u\n\t\u ]]
+ echo 'ERROR: cannot install on raspbian distribution - only Ubuntu is supported'
ERROR: cannot install on raspbian distribution - only Ubuntu is supported
+ exit 1
Failed to install browsers
Error: Failed to install chrome

rpi4:

$ npx playwright install chrome
Switching to root user to install dependencies...
++ arch
+ [[ aarch64 == \a\a\r\c\h\6\4 ]]
+ echo 'ERROR: not supported on Linux Arm64'
ERROR: not supported on Linux Arm64
+ exit 1
Failed to install browsers
Error: Failed to install chrome
```

from free-games-claimer.

vogler avatar vogler commented on May 22, 2024

Just tried #11 on my RPi4 (SSD): docker build took 6m53s.
It's a 64bit kernel, 32bit userland.

Launching the browser failed:

$ uname -m
aarch64

$ dpkg --print-architecture
armhf

$ docker run --rm -it \
    -p 5900:5900 -p 6080:6080 \
    -v "$(pwd)/userDataDir:/fgc/userDataDir" \
    -v "$(pwd)/screenshots:/fgc/screenshots" \
    -v "$(pwd)/epic-games.js:/fgc/epic-games.js" \
    --name free-games-claimer \
    free-games-claimer

node:internal/process/esm_loader:94
    internalBinding('errors').triggerUncaughtException(
                              ^

browserType.launchPersistentContext: Browser closed.
==================== Browser output: ====================
<launching> /root/.cache/ms-playwright/chromium-978106/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=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater --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 --no-sandbox --disable-session-crashed-bubble --restore-last-session --user-data-dir=/fgc/userDataDir --remote-debugging-pipe about:blank
<launched> pid=68
[pid=68][err] /root/.cache/ms-playwright/chromium-978106/chrome-linux/chrome: 1: y: not found
[pid=68][err] /root/.cache/ms-playwright/chromium-978106/chrome-linux/chrome: 1: ?: not found
[pid=68][err] /root/.cache/ms-playwright/chromium-978106/chrome-linux/chrome: 1: cannot open DLS]dq}����������������
[pid=68][err] $-5DTY_hr: No such file
[pid=68][err] /root/.cache/ms-playwright/chromium-978106/chrome-linux/chrome: 1: ������������: not found
[pid=68][err] /root/.cache/ms-playwright/chromium-978106/chrome-linux/chrome: 1: @GKRahqx�������������
                                                                                                      9@MZp: not found
[pid=68][err] /root/.cache/ms-playwright/chromium-978106/chrome-linux/chrome: 1: ������������: not found
[pid=68][err] /root/.cache/ms-playwright/chromium-978106/chrome-linux/chrome: 1: cannot create �W@xO@8
                                                                                                      @$@@@�����
[pid=68][err] W�
[pid=68][err] W�
[pid=68][err] W�W�Wлл��7
                        ��7
                           ��7
                              y�)�
                                  �Y�
                                     �Y�
                                        ��ypfyP�td�F��F��F��7�7Q�td���XX/lib64/ld-linux-x86-64.so.2GNU INFOCrashpad4�
                                                                                                                    GNU&+�U9���Ba p � �������9: Directory nonexistent
[pid=68][err] /root/.cache/ms-playwright/chromium-978106/chrome-linux/chrome: 1: ELF: not found
[pid=68][err] /root/.cache/ms-playwright/chromium-978106/chrome-linux/chrome: 17: Syntax error: word unexpected (expecting ")")
[pid=68] <process did exit: exitCode=2, signal=null>
[pid=68] starting temporary directories cleanup
=========================== logs ===========================
... same as above
============================================================
    at async file:///fgc/epic-games.js:13:17 {
  name: 'Error'
}

Originally posted by @vogler in #11 (comment)

from free-games-claimer.

vogler avatar vogler commented on May 22, 2024

Tried with firefox on rpi4:

$ npx playwright install --with-deps firefox
BEWARE: your OS is not officially supported by Playwright; installing dependencies for Ubuntu as a fallback.
Installing dependencies...
BEWARE: your OS is not officially supported by Playwright; downloading fallback build.

$ node epic-games.js
node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

browserType.launchPersistentContext: Browser.enable): Browser closed.
==================== Browser output: ====================
<launching> /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox -no-remote -wait-for-browser -foreground -profile /home/pi/free-games-claimer/data/browser -juggler-pipe --hide-crash-restore-bubble about:blank
<launched> pid=26206
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 1: ELF: not found
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 2: p: not found
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 3: p: not found
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 4: ����p
                                                                                     p/
                                                                                       p/
                                                                                         P�5@-
                                                                                              @=
                                                                                                @=
                                                                                                  @���DDp
                                                                                                         p/
                                                                                                           p/
                                                                                                             : not found
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 5: ��: not found
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 6: ��: not found
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 7: Syntax error: ")" unexpected
[pid=26206] <process did exit: exitCode=2, signal=null>
[pid=26206] starting temporary directories cleanup
=========================== logs ===========================
<launching> /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox -no-remote -wait-for-browser -foreground -profile /home/pi/free-games-claimer/data/browser -juggler-pipe --hide-crash-restore-bubble about:blank
<launched> pid=26206
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 1: ELF: not found
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 2: p: not found
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 3: p: not found
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 4: ����p
                                                                                     p/
                                                                                       p/
                                                                                         P�5@-
                                                                                              @=
                                                                                                @=
                                                                                                  @���DDp
                                                                                                         p/
                                                                                                           p/
                                                                                                             : not found
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 5: ��: not found
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 6: ��: not found
[pid=26206][err] /home/pi/.cache/ms-playwright/firefox-1369/firefox/firefox: 7: Syntax error: ")" unexpected
[pid=26206] <process did exit: exitCode=2, signal=null>
[pid=26206] starting temporary directories cleanup
============================================================
    at async file:///home/pi/free-games-claimer/epic-games.js:36:17 {
  name: 'Error'
}

Node.js v18.10.0

Same happens for docker:

$ docker build --tag free-games-claimer .
...
$ docker run --rm -it -p 6080:6080 -v fgc:/fgc/data free-games-claimer
Xvfb display server created screen with resolution 1280x1280.
VNC is running on port 5900 (no password!).
noVNC is running on http://localhost:6080

node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

browserType.launchPersistentContext: Browser.enable): Browser closed.
==================== Browser output: ====================
<launching> /root/.cache/ms-playwright/firefox-1369/firefox/firefox -no-remote -wait-for-browser -foreground -profile /fgc/data/browser -juggler-pipe --hide-crash-restore-bubble about:blank
<launched> pid=124
[pid=124][err] /root/.cache/ms-playwright/firefox-1369/firefox/firefox: 1: ELF: not found
...

from free-games-claimer.

RobDaNub avatar RobDaNub commented on May 22, 2024

Works for me on Raspberry Pi 4 with Ubuntu Server 22.04.1 LTS with docker

from free-games-claimer.

vogler avatar vogler commented on May 22, 2024

docker: no matching manifest for linux/arm/v7 in the manifest list entries.

Did you build the image yourself?

Would be good to know why it doesn't work on mine.

$ lsb_release -d
Description:    Raspbian GNU/Linux 11 (bullseye)
$ uname -a
Linux rpi4 5.15.76-v8+ #1597 SMP PREEMPT Fri Nov 4 12:16:41 GMT 2022 aarch64 GNU/Linux

from free-games-claimer.

RobDaNub avatar RobDaNub commented on May 22, 2024

Did you build the image yourself?

I tried the prebuild one and I also build it myself.

So i ran

$ docker run --rm -it -p 6080:6080 -v fgc:/fgc/data ghcr.io/vogler/free-games-claimer

and

$ docker build --tag free-games-claimer .
$ docker run --rm -it -p 6080:6080 -v fgc:/fgc/data free-games-claimer

Both work.

I'm using a Pi 4 model B with 4 GB Ram.

$ uname -a
Linux ubuntu 5.15.0-1022-raspi #24-Ubuntu SMP PREEMPT Mon Dec 5 09:58:33 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

$ lsb_release -d
Description:    Ubuntu 22.04.1 LTS

Here I get arm64 instead of armhf in your post...

$ dpkg --print-architecture
arm64

from free-games-claimer.

WiLuX-Source avatar WiLuX-Source commented on May 22, 2024

Hello I just want to clarify things since nothing is mentioned at the readme at the moment.

You guys want to use playwright but it gives error on raspbian OS. apt packages are still 32bit is the reason why it don't work with 64-bit OS.

Current given solution is use docker and docker uses another OS which is ubuntu and then installs nodejs runs the needed scripts etc etc.

Did you guys try with one with desktop environment?

from free-games-claimer.

WiLuX-Source avatar WiLuX-Source commented on May 22, 2024

Raspberry Pi (3, 4, Zero 2): Raspbian won't work since it's 32-bit, but Raspberry Pi OS (64-bit) or Ubuntu will.

Oh my bad the commit isn't mentioned in this issue. Is there any specific reason you guys want to use this with Raspbian?

from free-games-claimer.

vogler avatar vogler commented on May 22, 2024

apt packages are still 32bit is the reason why it don't work with 64-bit OS.

Playwright also downloads patched browser binaries which are not available for armhf, but for arm64.

Current given solution is use docker and docker uses another OS which is ubuntu and then installs nodejs runs the needed scripts etc etc.

Docker doesn't change anything about the issue, see above. The docker image is for ease of use and originally was introduced as a workaround since epic-games showed captchas when Playwright was run headless. But with Firefox instead of Chrome this seems to no longer be the case.
Playwright only supports Ubuntu and not Alpine which would be preferred for smaller image size. See #13.

Did you guys try with one with desktop environment?

Don't understand what you're asking. You can VNC into the container.

Is there any specific reason you guys want to use this with Raspbian?

It has been the default for a long time, so I guess many people still use it since migration to Raspberry OS is not supported.

from free-games-claimer.

WiLuX-Source avatar WiLuX-Source commented on May 22, 2024

Playwright also downloads patched browser binaries which are not available for armhf, but for arm64.

Thanks for clarifying, I understand better now.

Docker doesn't change anything about the issue, see above. The docker image is for ease of use and originally was introduced as a workaround since epic-games showed captchas when Playwright was run headless. But with Firefox instead of Chrome this seems to no longer be the case.

I see. Docker is made for ease of use not for solving raspbian problem.

Don't understand what you're asking. You can VNC into the container.

In the above "Only tried running headless via ssh, maybe it works otherwise." I understood that as I run my raspberry pi OS without desktop environment. Does it mean something else?

It has been the default for a long time, so I guess many people still use it since migration to Raspberry OS is not supported.

I see thanks for clarifying.

from free-games-claimer.

vogler avatar vogler commented on May 22, 2024

I assume you mean that you use Raspberry Pi OS without desktop environment. What does dpkg --print-architecture say?
If it's arm64 you have the 64-bit version and should be able to either

  1. run the scripts with node (default is headless), or
  2. run via docker (default is non-headless inside the container, you can control the browser with noVNC)

from free-games-claimer.

vogler avatar vogler commented on May 22, 2024

Tried qemu emulation of the amd64 image on my armhf-userland, aarch64 rpi4, which seems to work, but is way too slow:

$ docker run --rm --privileged aptman/qus -s -- -p x86_64
cat ./qemu-binfmt-conf.sh | sh -s -- --path=/qus/bin -p x86_64 --suffix -static
Setting /qus/bin/qemu-x86_64-static as binfmt interpreter for x86_64
$ docker run --rm amd64/alpine uname -a
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v8) and no specific platform was requested
Linux 55015c61e4c5 5.15.84-v8+ #1613 SMP PREEMPT Thu Jan 5 12:03:08 GMT 2023 x86_64 Linux
$  docker run --rm -it -p 6080:6080 -v fgc:/fgc/data --platform linux/amd64 ghcr.io/vogler/free-games-claimer
Xvfb display server created screen with resolution 1280x1280
VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080

2023-02-11 16:45:01.982 started checking epic-games
node:internal/process/esm_loader:100
    internalBinding('errors').triggerUncaughtException(
                              ^

browserType.launchPersistentContext: Timeout 180000ms exceeded.

Running the arm64 image somehow didn't work:

$  docker run --rm -it -p 6080:6080 -v fgc:/fgc/data --platform linux/arm64 ghcr.io/vogler/free-games-claimer
Xvfb display server created screen with resolution 1280x1280

from free-games-claimer.

vogler avatar vogler commented on May 22, 2024

Closing this since it's solved (64-bit OS work, Playwright prob. won't support 32-bit OS) and linked in the Readme.

from free-games-claimer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.