Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raspberry pi Chromium revision is not downloaded #550

Closed
aminjoharinia opened this issue Aug 25, 2017 · 85 comments
Closed

raspberry pi Chromium revision is not downloaded #550

aminjoharinia opened this issue Aug 25, 2017 · 85 comments
Labels
chromium Issues with Puppeteer-Chromium confirmed feature host

Comments

@aminjoharinia
Copy link

aminjoharinia commented Aug 25, 2017

Hi
i use raspbian stretch and i install puppeteer with npm but it did not download chromium
the os has the latest chromium
chromium-browser is already the newest version (60.0.3112.89-0ubuntu0.14.04.1.1010).
but when i run codes i have get error
(node:4035) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install" (node:4035) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
i also test npm install as it says but not working
what should i do?

@ebidel ebidel added the host label Aug 25, 2017
@aslushnikov
Copy link
Contributor

@aminjoharinia Does the npm install puppeteer throw an error for you? Do you have any HTTP proxy installed?

@aminjoharinia
Copy link
Author

@aslushnikov
No there is no error
I tested with different networks
At the same time , i installed Windows version and it's works fine but in raspberian it does not install browser

@zberhe
Copy link

zberhe commented Aug 28, 2017

I am also running into this issue AssertionError: Chromium revision is not downloaded. Run "npm install". I am running on Mac behind a corporate proxy. My .local-chromium directory is empty.

@aminjoharinia
Copy link
Author

aminjoharinia commented Sep 1, 2017

after many attempts finally chromium downloaded but there is not any folder like .local-chromium in node modules/puppeteer
does it support linux armh ?
could i manually download the file and unzip it?
here is the error
i also download and install all dependces

/home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: 1: /home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: �ELF����: not found
/home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: 2: /home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: cannot open ��: No such file
/home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: 3: /home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: ��: not found
/home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: 4: /home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: ��: not found
/home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: 5: /home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: ��: not found
/home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: 6: /home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: ��: not found
/home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: 7: /home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: ��: not found
/home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: 8: /home/pi/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: Syntax error: ")" unexpected


TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

(node:6293) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```

@saghul
Copy link

saghul commented Sep 2, 2017

Looks like the downloaded version is x86_64, not arm:

chrome: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped

vs the one in raspbian:

chromium-browser: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, not stripped

@saghul
Copy link

saghul commented Sep 2, 2017

Also, it doesn't seem to work with the version in raspbian anyway:

(node:2069) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r497674
(node:2069) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@Silur
Copy link

Silur commented Sep 12, 2017

I tried to make a patch for utils/ChromiumDownloader.js but seems like there are no arm64 snapshots and it doesn't worth to only support 32bit arm :/
so my suggestion @saghul is to use browser.launch({executablePath: 'chromium'}) and set the env flag PUPPETEER_SKIP_CHROMIUM_DOWNLOAD

@Brunocg
Copy link

Brunocg commented Sep 12, 2017

Im going through the exactly same problem.

use browser.launch({executablePath: 'chromium'})

Didn't work. That's what I got.

events.js:182
throw er; // Unhandled 'error' event
^

Error: spawn chromium ENOENT
at _errnoException (util.js:1041:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
at onErrorNT (internal/child_process.js:374:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:611:11)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:598:3

I tried with browser.launch({executablePath: 'chromium-browser'}), but I got:

node:14008) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r497674

@Silur
Copy link

Silur commented Sep 13, 2017

yes, seems like the working revision (499413) is not present anywhere on google storage api and the version mismatch causes the timeout
google pls upload some arm stuff?

@ghost
Copy link

ghost commented Sep 14, 2017

Doesn't seem like there's an easy way to get a recent enough chromium build for arm

@krewx
Copy link

krewx commented Sep 22, 2017

First i installed chromium using

sudo apt install chromium-browser

then i used browser.launch({executablePath: '/usr/bin/chromium-browser'}) but now the issue is the following

(node:4107) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to launch chrome!
bootstrap_helper: /usr/lib/chromium-browser/nacl_helper: Cannot open ELF file! errno=2
[4129:4129:0922/172003.955374:ERROR:nacl_fork_delegate_linux.cc(315)] Bad NaCl helper startup ack (0 bytes)
[4117:4117:0922/172003.958248:ERROR:browser_main_loop.cc(495)] Failed to put Xlib into threaded mode.
[4117:4117:0922/172003.967038:ERROR:browser_main_loop.cc(272)] Gtk: cannot open display

I don't know if this help anyone

@alexkozy
Copy link
Contributor

Yesterday, I successfully run latest puppeteer on Raspbian. Let me go through all steps that I tried:

  1. just run puppeteer as is - npm install successfully got latest Chromium build for Linux, but on attempt to run it: ELF: not found. Ok, the reason - downloaded version is not arm one.
  2. apt-get install chromium-browser - I tried to use this Chromium by passing executablePath as launch argument but puppeeteer just freezes without any errors or exceptions, I think that chromium-browser version is too old.
  3. I cross compiled latest Chromium for arm using my linux workstation, upload this build to raspberry pi and it finally works.
    I'll upload this build somewhere later this week.

@Silur
Copy link

Silur commented Sep 29, 2017

maybe upload it to some CDN and make a PR?

@aminjoharinia
Copy link
Author

@ak239 Great ! Please upload it faster to check it out
Thanks

@alexkozy
Copy link
Contributor

Ok. It's temporary solution, I hope that we'll make it more fancy soon.
By following link you can download chromium required for puppeteer in headless mode, download it, upload to raspberry pi, unpack it, install required dependency and run one of the puppeteer example to check that it works and please share your feedback!

@LeMoussel
Copy link

@ak239 Do you mean that sudo apt-get install chromium-browser was finally not be able to download the latest version? Can youn explain how to install recent Chrome browser for Pi?

@rclai
Copy link

rclai commented Sep 30, 2017

Is there no ARM build of Chrome? @ak239 are you able to type up instructions of how your compiled Chrome for ARM?

@silverwind
Copy link

silverwind commented Oct 3, 2017

@ak239 your build is working fine here on a RPi2 on Raspbian, while the official build gave me the ELF error, so I assume there's no armv6 binary build of Chrome being downloaded.

@silverwind
Copy link

silverwind commented Oct 3, 2017

@ak239 did another attempt, this time on a RPi3 (armv7) running Arch Linux ARM with no GUI libraries present (shell only). I had to install the following GUI-related libraries until I was able to run the chrome binary: pango libxcomposite libxss libxrandr gconf atk gtk3. After that, I was able to run the PDF and screenshot examples fine.

@alexkozy
Copy link
Contributor

alexkozy commented Oct 3, 2017

Thanks a lot!

I build Chromium for arm using recipe 2 from here.

Before start I have Chromium checkout for regular Linux build, I added target_cpu = "arm" to gn flags, run following code and build using ninja.
./build/linux/sysroot_scripts/install-sysroot.py --arch=arm

I don't have any estimations when we'll get arm build support as part of npm install but we have it in our list.

@aminjoharinia
Copy link
Author

aminjoharinia commented Oct 4, 2017

Hi
i got this error
(node:2323) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: spawn EACCES
(node:2323) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@aminjoharinia
Copy link
Author

I found that in raspbian stretch , chromium version 60 is preinstalled
and chromium-headless works with command line
chromium-browser --headless --disable-gpu --print-to-pdf https://www.google.com
how could i use built in chromium for puppeteer?
@ak239 @silverwind

@jindongh
Copy link

wget http://launchpadlibrarian.net/341807203/chromium-browser_62.0.3202.62-0ubuntu0.14.04.1204_armhf.deb
wget http://launchpadlibrarian.net/341807199/chromium-codecs-ffmpeg-extra_62.0.3202.62-0ubuntu0.14.04.1204_armhf.deb
sudo dpkg -i chromium-browser_62.0.3202.62-0ubuntu0.14.04.1204_armhf.deb
sudo dpkg -i chromium-codecs-ffmpeg-extra_62.0.3202.62-0ubuntu0.14.04.1204_armhf.deb
cat > test.js <<EOF
const puppeteer = require('puppeteer');
(async () => {
        const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium-browser'});
        const page = await browser.newPage();
        await page.goto('https://example.com');
        await page.screenshot({path: 'example.png'});
        await browser.close();
})();
EOF
node test.js

@Brunocg
Copy link

Brunocg commented Oct 26, 2017

@jindongh Do you have any arm build of the latest version from chromium-dev channel? Last week it was added a new domain called HeadlessExperimental which Im really interested on testing, although Im not sure whether it's working or not.

@ghost
Copy link

ghost commented Oct 30, 2020

if you have box86 installed try to add box86 in the path it maybe work i did not test

@marlarius
Copy link

This worked for me. I had to fix a dependency with ffmpeg afterwards though. That was easily fixed with aptitude.

@tomasAlabes
Copy link
Contributor

Having installed the chromium dependency, I used { executablePath: 'chromium' } and it worked.

@jeronimoek
Copy link

jeronimoek commented Jul 7, 2021

wget http://launchpadlibrarian.net/341807203/chromium-browser_62.0.3202.62-0ubuntu0.14.04.1204_armhf.deb
wget http://launchpadlibrarian.net/341807199/chromium-codecs-ffmpeg-extra_62.0.3202.62-0ubuntu0.14.04.1204_armhf.deb
sudo dpkg -i chromium-browser_62.0.3202.62-0ubuntu0.14.04.1204_armhf.deb
sudo dpkg -i chromium-codecs-ffmpeg-extra_62.0.3202.62-0ubuntu0.14.04.1204_armhf.deb
cat > test.js <<EOF
const puppeteer = require('puppeteer');
(async () => {
        const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium-browser'});
        const page = await browser.newPage();
        await page.goto('https://example.com');
        await page.screenshot({path: 'example.png'});
        await browser.close();
})();
EOF
node test.js

This worked for me on my Raspberry PI B+.

First, I removed the old chromium pre-installed, and then installed it again (just in case). No idea if dependencies are needed as I tried different solutions before this, and may have them pre-installed before doing this)

Then created a brand new folder

mkdir New_Folder
cd New_Folder/

Then set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" to true:

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

Then installed puppeteer:

npm i puppeteer

Then checked that puppeteer didn't install any browser (there shouldn't be any ".local-chromium" or anything like that):

ls -a node_modules/puppeteer/

Then created a new example.js file to test if it works. Copied the code quoted above:

cat > test.js <<EOF
const puppeteer = require('puppeteer');
(async () => {
        const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium-browser'});
        const page = await browser.newPage();
        await page.goto('https://example.com');
        await page.screenshot({path: 'example.png'});
        await browser.close();
})();
EOF

Then run it

node test.js

If no errors, you should see no console messages here

Finally to check, do

ls

And you should see a file called "example.png" that is a screenshot of the web above "https://example.com"

@paulinechi
Copy link

Fresh update to this issue for those doing a fresh install:

  • Stretch includes chromium-browser 65. sudo apt install chromium-browser chromium-codecs-ffmpeg
  • puppeteer-core@v1.11.0 "stable" is the one that works with chromium-browser version 65
  • const puppeteer = require('puppeteer-core');
  • const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium-browser'});

I have no trouble with the extra args that were suggested earlier (disable sandbox, gpu, etc) but I found that it works either way now. So just "executablePath" should do it.

The other thing I did was install the packages on the troubleshooting page: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md where you can "sudo apt install" the packages listed under "Debian (e.g. Ubuntu) Dependencies". Here is the current version if you just want to copy-and-paste.

sudo apt install gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

Hi I'm getting the same issue but with prerender-spa-plugin, I couldn't find where it's using puppeteer so can't replace const browser like this const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium-browser'}); any idea how I can fix it in my case? :( much appreaciated!

@TheHeroBrine422
Copy link

@paulinechi If you can figure out where the default puppeteer path is you might be able to symlink it to /usr/bin/chromium-browser. I don't know where that is though.

@stale
Copy link

stale bot commented Jun 23, 2022

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Jun 23, 2022
@harakka
Copy link

harakka commented Jun 23, 2022

This is is definitely still an issue, puppeteer still doesn't download and use a bundled version of chromium on arm architectures.

@stale stale bot removed the unconfirmed label Jun 23, 2022
@stale
Copy link

stale bot commented Aug 30, 2022

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Aug 30, 2022
@harakka
Copy link

harakka commented Aug 31, 2022

Still an issue.

@stale stale bot removed the unconfirmed label Aug 31, 2022
@OrKoN
Copy link
Collaborator

OrKoN commented Sep 6, 2022

There is PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM flag now to download mac ARM builds but as far as I know there no other ARM builds published by Chromium.

@thefakewater
Copy link

You can run it inside a docker container on raspberrypi to fix the issue if you want to know more about this just reply and I'll develop

@jrandolf
Copy link
Contributor

jrandolf commented Oct 4, 2023

Duplicate of #7740

@jrandolf jrandolf marked this as a duplicate of #7740 Oct 4, 2023
@jrandolf jrandolf closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chromium Issues with Puppeteer-Chromium confirmed feature host
Projects
None yet
Development

No branches or pull requests