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

[Bug]: Error: Could not find Chromium (rev. 1069273) #9533

Closed
2 tasks
AlcantaraMC opened this issue Jan 18, 2023 · 45 comments · Fixed by #9568 or #9591
Closed
2 tasks

[Bug]: Error: Could not find Chromium (rev. 1069273) #9533

AlcantaraMC opened this issue Jan 18, 2023 · 45 comments · Fixed by #9568 or #9591
Assignees
Labels
bug disable-analyzer Disables the automatic workflow that tries to reproduce bug reports needs-feedback not-reproducible

Comments

@AlcantaraMC
Copy link

AlcantaraMC commented Jan 18, 2023

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

  1. you did not perform an installation before running the script (e.g. npm install) or
  2. 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
  • PDF

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

@OrKoN
Copy link
Collaborator

OrKoN commented Jan 18, 2023

How did you upgrade Puppeteer? binary installation happens in the postinstall npm script and we expect npm to call it but it looks like npm didn't do that in your case.

@OrKoN
Copy link
Collaborator

OrKoN commented Jan 18, 2023

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.

@OrKoN OrKoN added disable-analyzer Disables the automatic workflow that tries to reproduce bug reports and removed not-reproducible labels Jan 18, 2023
@WashingtonInoveApps
Copy link

Hello, is there any solution for this problem?

@jrandolf jrandolf removed disable-analyzer Disables the automatic workflow that tries to reproduce bug reports needs-feedback labels Jan 23, 2023
@OrKoN OrKoN added the disable-analyzer Disables the automatic workflow that tries to reproduce bug reports label Jan 24, 2023
@puppeteer puppeteer deleted a comment from github-actions bot Jan 24, 2023
@OrKoN OrKoN self-assigned this Jan 24, 2023
@OrKoN
Copy link
Collaborator

OrKoN commented Jan 24, 2023

I could not reproduce the issue but I think I found a related issue that might explain the missing binaries.

OrKoN added a commit that referenced this issue Jan 24, 2023
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 versions.
We expect the users to clean the cache from time to time
until we offer a CLI for managing the browsers.

Closes #9533
OrKoN added a commit that referenced this issue Jan 24, 2023
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 versions.
We expect the users to clean the cache from time to time
until we offer a CLI for managing the browsers.

Closes #9533
@chirale
Copy link

chirale commented Jan 24, 2023

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.

OrKoN added a commit that referenced this issue Jan 24, 2023
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 versions.
We expect the users to clean the cache from time to time
until we offer a CLI for managing the browsers.

Closes #9533
@smithkyle
Copy link

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:

  1. adding gcp-build to scripts in package.json
  2. adding the .puppeteerrc.cjs file
  3. make sure the function has at least 1gb of ram

@AmichayMiara
Copy link

BTW @smithkyle solution works also with 1st gen functions...

@VanDerCroix
Copy link

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 });

This one worked for me, thanks!

@estatistics
Copy link

estatistics commented Oct 3, 2023

SOLVED (debian linux 12)
path was /home/USER/.cache/puppeteer/chrome/linux-117.0.5938.92/chrome-linux64/
path copied as /home/USER/.cache/puppeteer/chrome/linux-1108766/chrome-linux/

Please add in script to print the expected path that puppeeter is searching chromium.

note that running as sudo yarn PROGRAM is searching in root/.cache while yarn PROGRAM in /home/user...
but the latest was throwing errors

So, sudo npm run build --loglevel=error or sudo yarn run build --loglevel=error and then yarn start or npm start

@tomcatmwi
Copy link

In a Windows environment, a global installation of Puppeteer solved the problem:

npm i puppeteer -g

@issudn
Copy link

issudn commented Dec 21, 2023

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.

Yep, that worked for me, thank you!

lmachens added a commit to lmachens/sons-of-the-forest-map that referenced this issue Dec 28, 2023
@dineshkumar14062001
Copy link

Error: Could not find Chrome (ver. 119.0.6045.105). This can occur if either
2023-12-21 12:41:43.177 IST

  1. you did not perform an installation before running the script (e.g. npx puppeteer browsers install chrome) or
    2023-12-21 12:41:43.177 IST

  2. your cache path is incorrectly configured (which is: /home/.cache/puppeteer).
    2023-12-21 12:41:43.177 IST
    For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.
    2023-12-21 12:41:43.177 IST
    at ChromeLauncher.resolveExecutablePath (/usr/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:288:27)
    2023-12-21 12:41:43.177 IST
    at ChromeLauncher.executablePath (/usr/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:219:25)
    2023-12-21 12:41:43.177 IST
    at ChromeLauncher.computeLaunchArguments (/usr/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:113:37)
    2023-12-21 12:41:43.177 IST
    at async ChromeLauncher.launch (/usr/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:79:28)
    2023-12-21 12:41:43.177 IST
    at async /usr/src/app/routes/services/common-service.js:340:31

    same issue for me what can I do, I have use goggle cloud function.
    any one please tell me how to solve this issue, I have more than 2 weeks

tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
It seems that Chromium is no longer found automatically. See also
puppeteer/puppeteer#9533.
tautschnig added a commit to tautschnig/cbmc that referenced this issue Jan 8, 2024
mermaid-filter depends on a deprecated version of puppeteer, which
results in puppeteer no longer finding a suitable version of Chromium.
See puppeteer/puppeteer#9533 for others facing
this issue. Forcing npm to use the most recent release of puppeteer
(version 21) resolves this problem.

We should revert the workflow to one that doesn't text-insert a
dependency and just directly npm installs mermaid-filter once
mermaid-js/mermaid-cli#627 has been resolved,
a new release of mermaid-cli been produced, and mermaid-filter having
picked up that new release.
@jena-cameron
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug disable-analyzer Disables the automatic workflow that tries to reproduce bug reports needs-feedback not-reproducible
Projects
None yet