puppeteer: [Bug]: Error: Could not find Chromium (rev. 1069273)
Bug expectation
I expected to successfully run puppeteer, as it always did in prior versions.
I instead got an error:
Error: Could not find Chromium (rev. 1069273). This can occur if either
- you did not perform an installation before running the script (e.g.
npm install
) or - your cache path is incorrectly configured (which is: /home/sysadm/.cache/puppeteer). For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration. at ChromeLauncher.resolveExecutablePath (/var/www/html/oas-restapi-fork1/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:119:27) at ChromeLauncher.executablePath (/var/www/html/oas-restapi-fork1/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:205:25) at ChromeLauncher.launch (/var/www/html/oas-restapi-fork1/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:93:37)
Bug behavior
- Flaky
Minimal, reproducible example
"use strict";
const puppeteer = require ('puppeteer');
async function main () {
try {
// instantiate puppeteer
console.log (`Launching puppeteer`);
const browser = await puppeteer.launch ();
// create new page:
console.log (`Creating page`);
const page = await browser.newPage ();
} catch (err) {
console.log (err);
}
}
main ();
Error string
Error: Could not find Chromium (rev. 1069273)
Puppeteer configuration
Puppeteer version
19.6.0
Node version
v16.19.0
Package manager
npm
Package manager version
9.3.0
Operating system
Linux
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 17
- Comments: 45 (1 by maintainers)
Commits related to this issue
- fix: don't clean up older chromium versions Since we moved to the central binaries cache it does not make sense to clean up old binaries automatically because multiple installations can use different... — committed to puppeteer/puppeteer by OrKoN a year ago
- fix: don't clean up older chromium versions Since we moved to the central binaries cache it does not make sense to clean up old binaries automatically because multiple installations can use different... — committed to puppeteer/puppeteer by OrKoN a year ago
- fix: don't clean up older chromium versions Since we moved to the central binaries cache it does not make sense to clean up old binaries automatically because multiple installations can use different... — committed to puppeteer/puppeteer by OrKoN a year ago
- fix: don't clean up previous browser versions (#9568) Since we moved to the central binaries cache it does not make sense to clean up old binaries automatically because multiple installations can u... — committed to puppeteer/puppeteer by OrKoN a year ago
- fix: workaround for https://github.com/puppeteer/puppeteer/issues/9533 - chromium binary reachability issue — committed to pdfplum/pdfplum by sassanh a year ago
- :wrench: config(puppeteer): Install chromium to local cache directory. See https://github.com/puppeteer/puppeteer/issues/9533. — committed to infoderm/patients by make-github-pseudonymous-again a year ago
- fix: downgrade Puppeteer to `^18` to workaround [issue](https://github.com/puppeteer/puppeteer/issues/9533) as suggested in its comments. — committed to pdfplum/pdfplum by sassanh a year ago
- fix puppeteer errors see also: https://github.com/puppeteer/puppeteer/issues/9533 — committed to qniapp/qni by yasuhito a year ago
- Revert to the version of puppeteer that was working see also: https://github.com/puppeteer/puppeteer/issues/9533 — committed to qniapp/qni by yasuhito a year ago
- Added puppeteer install script to postinstall, see https://github.com/puppeteer/puppeteer/issues/9533 — committed to highcharts/node-export-server by cvasseng a year ago
- Fix no Chrome found error Since puppeteer 1.19 the browser is loaded from `~/.cache/`. Maybe not the cleanest fix but it works. https://github.com/puppeteer/puppeteer/issues/9533 — committed to terjanq/kctf by terjanq a year ago
- https://github.com/puppeteer/puppeteer/issues/9533#issuecomment-1386652464 — committed to lmachens/sons-of-the-forest-map by lmachens 6 months ago
- Fix document publishing GitHub Action It seems that Chromium is no longer found automatically. See also https://github.com/puppeteer/puppeteer/issues/9533. — committed to tautschnig/cbmc by tautschnig 6 months ago
- Fix document publishing GitHub Action It seems that Chromium is no longer found automatically. See also https://github.com/puppeteer/puppeteer/issues/9533. — committed to tautschnig/cbmc by tautschnig 6 months ago
- Fix document publishing GitHub Action It seems that Chromium is no longer found automatically. See also https://github.com/puppeteer/puppeteer/issues/9533. — committed to tautschnig/cbmc by tautschnig 6 months ago
- Fix document publishing GitHub Action It seems that Chromium is no longer found automatically. See also https://github.com/puppeteer/puppeteer/issues/9533. — committed to tautschnig/cbmc by tautschnig 6 months ago
- Fix document publishing GitHub Action It seems that Chromium is no longer found automatically. See also https://github.com/puppeteer/puppeteer/issues/9533. — committed to tautschnig/cbmc by tautschnig 6 months ago
- Fix document publishing GitHub Action It seems that Chromium is no longer found automatically. See also https://github.com/puppeteer/puppeteer/issues/9533. — committed to tautschnig/cbmc by tautschnig 6 months ago
- Fix document publishing GitHub Action It seems that Chromium is no longer found automatically. See also https://github.com/puppeteer/puppeteer/issues/9533. — committed to tautschnig/cbmc by tautschnig 6 months ago
- Fix document publishing GitHub Action It seems that Chromium is no longer found automatically. See also https://github.com/puppeteer/puppeteer/issues/9533. — committed to tautschnig/cbmc by tautschnig 6 months ago
As a workaround it should be possible to run
node node_modules/puppeteer/install.js
to download the binary. It’s the same file that npm is supposed to invoke.FWIW I have puppeteer running in a Google Cloud Function using Puppeteer 21.0.2 and Node v20 following these directions. The three main bits are:
gcp-build
toscripts
inpackage.json
.puppeteerrc.cjs
filenpm clean-install
this installed the “cache\puppeteer\chrome\win64-1095492” and solved my problem.
I was having this error for revision 1069273, then bumped to puppeteer 19.6.2, deployed to Google Cloud Function, and the error went away. Then a little later I did another deployment for an unrelated reason, and the error came back again on a new revision 1083080.
So it doesn’t seem that 19.6.2 fixes the issue.
Rolling back to puppeteer version 18 resolves the issue.
I solved it like this to be able to deploy in the cloud
In my Dockerfile
RUN apk add --no-cache udev ttf-freefont chromium git ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true ENV CHROMIUM_PATH /usr/bin/chromium-browser
To start the browser
puppeteer.launch({ executablePath: process.env.CHROMIUM_PATH, args: [‘–no-sandbox’], // This was important. Can’t remember why });
Thanks for sharing but sometimes you don’t even have a dockerfile, for example in AWS lambda functions and in firebase functions. They just install your package.json.
I don’t understand why this library suddenly doesn’t work out of the box and needs extra work after being installed.
Solved the issue after using these commands:
npm cache clean --force
npm install puppeteer
I had this issue with
^19.8.0
on cloud functions. The issue was the build layer used when deploying cloud functions contains the chromium binaries already. A simplenode_modules/puppeteer/install.js
said it already found in the build log. cloud functions use a different base container image for runtime. The trick was the set the cache directory inside the application source directory. Usingpuppeteer.config.js
file in the root and the sample from the docs:GCP Functions copies the source code directory to the runtime container allowing it to find the cache. Cheers.
I got this error complaining couldn’t found Chromium 1095492, but in fact the installed version is 1083080.
Puppeteer 19.6.1
I actually noticed the main issue does not say anything about cloud functions, but since resolving the issue on a machine you have terminal access to is very easy, I think the actual problem here is to fix the issue for cloud function runners like AWS lambda or Firebase functions.
@RoelLeal man, how did you do it? I spent 3 days. This fucker no matter what, can’t find the headless chrome. It deploys normally but when I test the function I always get the same error.
I use Google Cloud Functions. There is nothing on Google Cloud for Puppeteer v.20.x everyone says that works fine, but always older versions.
Got this error after upgrade, tried cleaning cache and this got resolved for me.
Hello, is there any solution for this problem?
In a Windows environment, a global installation of Puppeteer solved the problem:
npm i puppeteer -g
So far nothing in this issue worked for me. I “found” that my chromium installation was like so:
.cache/puppeteer/chrome/linux-113.0.5672.63/chrome-linux64/
And my error said the following:
Could not find Chromium (rev. 1069273). This can occur if either ...
So I renamed my chromium folder and it worked:
I am not using a project. I am using NVM and installing puppeteer globally, so I really have no clue where to put the said
.puppeteerrc.cjs
. Maybe in/home/erp/.nvm/versions/node/v16.20.0/lib/node_modules/npm/
? That said I tried using the environment variables and they didn’t work either:PUPPETEER_CACHE_DIR="/home/erp/.cache" ...
PUPPETEER_CACHE_DIR="/home/erp/.cache/puppeteer" ...
This article from justus (https://twitter.com/intent/user?screen_name=justusbluemer) explains the Google Cloud Functions issue and a great fix here: https://hume.dev/articles/puppeteer-google-cloud-functions-v2/
I’m still experiencing this issue despite trying all the workarounds. My issue specifically is that we can’t get this to work in an AWS lambda.
This one worked for me, thanks!
Definitely looks like it. Could it be an issue with NVM? It is a fresh install after all. The revision
1069273
is expected by puppeteer butnpm install -g puppeteer
installs the113.0.5672.63
revision.Very random but persistent issue. It seems not reproducible if you run a single script with no concurrency. Try with concurrency and long running scripts like in a real world scenario. When it breaks (and it breaks during script execution), it is not recoverable until a new npm ci. And then, it can breaks after 26 minutes or after 3 minutes, but when it breaks it will not recover even if you re-run the same script.