Why Does the Error “Failed to Launch the Browser Process” Occur in the Puppeteer Node Despite Increasing the Workflow Memory to 2GB?

This topic was automatically generated from Slack. You can find the original thread here.

Why am I getting this error “Failed to launch the browser process! TROUBLESHOOTING: https://pptr.dev/troubleshooting” when running the sample puppeteer node, despite increasing the memory on the workflow to 2GB?

I apologize for the inconvenience you’re experiencing. It’s possible that there might be an issue with the Puppeteer configuration or the specific code you’re running. Could you please share the code you’re using? This will help me identify the issue and provide a solution. If you need further assistance, you can also visit https://pipedream.com/support for more support options.

here’s my code:

 import { puppeteer } from '@pipedream/browsers';

export default defineComponent({
  async run({steps, $}) {
    const browser = await puppeteer.browser();
    
    // Interact with the web page programmatically
    // See Puppeeter's Page documentation for available methods:
    // https://pptr.dev/api/puppeteer.page
    const page = await browser.newPage();

    await page.goto('https://pipedream.com/');
    const title = await page.title();
    const content = await page.content();

    // The browser needs to be closed, otherwise the step will hang
    await browser.close();

    return { title, content }
  },
})

here’s my code:

 import { puppeteer } from '@pipedream/browsers';

export default defineComponent({
  async run({steps, $}) {
    const browser = await puppeteer.browser();
    
    // Interact with the web page programmatically
    // See Puppeeter's Page documentation for available methods:
    // https://pptr.dev/api/puppeteer.page
    const page = await browser.newPage();

    await page.goto('https://pipedream.com/');
    const title = await page.title();
    const content = await page.content();

    // The browser needs to be closed, otherwise the step will hang
    await browser.close();

    return { title, content }
  },
})

Your code seems to be correct and should work as expected. However, if you’re still experiencing the “Failed to launch the browser process!” error, there might be an issue with the underlying infrastructure or a temporary glitch. I recommend trying the following: 1. Make sure you’re using the latest version of the @pipedream/browsers package. 2. Double-check your workflow settings to ensure that you’ve allocated enough memory (2GB as you mentioned). 3. Try running the workflow again after some time, as it might be a temporary issue. If the issue persists, please visit https://pipedream.com/support for more support options.

you’ve been looking into this yeah? Any idea what the issue could be?

Thanks Dylan - I took pi’s advice and “3. Try running the workflow again after some time, as it might be a temporary issue.”

Gave it about 30 minutes, and then it started working :slightly_smiling_face: Not sure what happened though

Hi Joe - is this issue happening while building the workflow? On on a deployed workflow?

If that latter, can you share a link to the specific event that has this error and share the project with support?

Hey Pierce, it was during building

That is strange, we haven’t seen this error since we made a small change to the @pipedream/browsers package to instruct Puppeteer to use /tmp for caching instead of the default directory.

I wonder if maybe you had the older version of the package somehow cached in your builder’s node_modules

I think I set up this workflow about a week ago if not less. When did you make the change to the browsers package?