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

Error: Failed to launch the browser process! [Failed to read /proc/sys/fs/inotify/max_user_watches] #5450

Closed
Trinhlvtq opened this issue Feb 25, 2020 · 14 comments

Comments

@Trinhlvtq
Copy link

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: v2.0.0 and v2.1.1
  • Platform / OS version: Google Cloud Functions (HTTP)
  • URLs (if applicable):
  • Node.js version: Nodejs 8

What steps will reproduce the problem?
I have function use Cloud Scheduler run every min, every day deploy in Google Cloud Function.
In this function, I have use puppeteer and mostly, my function run very well but sometimes, my functions have an error at different times. I do not know the exact cause of this error so please help!

What is the expected result?
No errors

What happens instead?

Error: Failed to launch the browser process!
[0225/051001.354900:ERROR:file_path_watcher_linux.cc(71)] Failed to read /proc/sys/fs/inotify/max_user_watches
[0225/051001.354786:ERROR:address_tracker_linux.cc(201)] Could not bind NETLINK socket: Permission denied (13)
Inconsistency detected by ld.so: ../elf/dl-tls.c: 481: _dl_allocate_tls_init: Assertion `listp->slotinfo[cnt].gen <= GL(dl_tls_generation)' failed!
[0225/051001.604959:ERROR:broker_posix.cc(43)] Invalid node channel message


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

    at onClose (/srv/node_modules/puppeteer/lib/Launcher.js:750:14)
    at ChildProcess.helper.addEventListener (/srv/node_modules/puppeteer/lib/Launcher.js:740:61)
    at emitTwo (events.js:131:20)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
@stevekeator
Copy link

stevekeator commented Mar 6, 2020

I've been working on a similar solution with GCR, Chrome, Puppeteer, and a few other things, and have gotten just about as far as OP. Seems to be several things going on here. Using 2.1.1.

image

@IchordeDionysos
Copy link

Hey @Trinhlvtq @stevekeator,

I got puppeteer to work in Cloud Run at first, and after doing some local development, I also ran into this error.

What fixed the problem was to run puppeteer in headless mode and to disable devtools (as this automatically enables headless mode) :)

puppeteer.launch({devtools: true}) -> puppeteer.launch() fixed it

Not sure if this fixes all cases, but it fixed mine.

@mooocer
Copy link

mooocer commented May 5, 2020

I am also facing a similar error. Did you find a solution @Trinhlvtq @stevekeator ?

@IchordeDionysos this is a workaround, but I want to work with disabled headless mode so that I can see the script running.

Error: Failed to launch the browser process!
[4287:4287:0505/183802.139136:ERROR:browser_main_loop.cc(1485)] Unable to open X display.

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

    at onClose (/home/vaibhav/projects/myproject/node_modules/puppeteer/lib/Launcher.js:615:20)
    at ChildProcess.<anonymous> (/home/vaibhav/projects/myproject/node_modules/puppeteer/lib/Launcher.js:606:67)
    at ChildProcess.emit (events.js:215:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)

@IchordeDionysos
Copy link

Unfortunately not.

As I am totally fine with headless mode I stuck with it.

@Trinhlvtq
Copy link
Author

@stevekeator: Using v2.1.1 too :(
@MishuVS: Unfortunately not! Sometimes I still got this error :(
@IchordeDionysos: Unfortunately I also use puppeteer.launch() but still get this error

@stevekeator
Copy link

I can't really comment on this any further, tbh. I'm working for a different company now and I left this project behind with my last employer. I can say that I was never able to get it to work. :/

@camelmasa
Copy link

camelmasa commented May 20, 2020

I was faced same issue. My environment is below.

Puppeteer version: v2.1.1
Platform / OS version: Google Cloud Functions (PubSub)
Node.js version: Nodejs 10

I can't fix the issue.
I could avoid it using async-retry for now.

Like this.

import * as retry from "async-retry";

...
    const browser = await retry(
      async (bail) => {
        try {
          return await puppeteer.launch();
        } catch (e) {
          console.log(e)
          throw e
        }
      },
      {
        retries: 5,
      }
    );
...

@jasonc624
Copy link

same issue here

@imbdb
Copy link

imbdb commented Jun 5, 2021

Use below options to start puppeteer in Cloud functions

const puppeteer = require("puppeteer");

const PUPPETEER_OPTIONS = {
  headless: true,
  args: [
    '--disable-gpu',
    '--disable-dev-shm-usage',
    '--disable-setuid-sandbox',
    '--no-first-run',
    '--no-sandbox',
    '--no-zygote',
    '--single-process',
    "--proxy-server='direct://'",
    '--proxy-bypass-list=*',
    '--deterministic-fetch',
  ],
};
const browser = await puppeteer.launch(PUPPETEER_OPTIONS);
const page = await browser.newPage();

@stale
Copy link

stale bot commented Jun 24, 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 24, 2022
@widjesh
Copy link

widjesh commented Jun 25, 2022

Was anybody able to fix this issue? I am experiencing the issue in GCR

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

Error: EACCES: permission denied, open './test2.jpg'
at handleError (parse.min.js:13:1)
at async createAccount (Signup.js:30:1) 'err'

I am facing this issue when puppeteer tries to save a ss into the directory

I am using AWS EC2, BITNAMI SERVERS. Node version 14.19 , debian version 10.12

Can anyone help me?

@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
@stale
Copy link

stale bot commented Sep 29, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

@stale stale bot closed this as completed Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants