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] Navigation timeout issue for most of the invocations #278

Open
mayurvpatil opened this issue Jun 10, 2024 · 0 comments
Open

[BUG] Navigation timeout issue for most of the invocations #278

mayurvpatil opened this issue Jun 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mayurvpatil
Copy link

Environment

  • chromium Version: 122.0.0
  • puppeteer-core Version: 22.5.0 / 22.6.0
  • Node.js Version: 20. x
  • Lambda Runtime: nodejs20.x
  • Lambda Memory: 2048MB
  • Lambda Ephemeral storage: 512MB

Executions

We are executing multiple scripts (multiple invocations [~50] of the same lambda ) simultaneously.

Current Behavior

Code

import puppeteer from 'puppeteer-core';
import chromium from "@sparticuz/chromium";

export async function handler(event, context,callback) {
  let result = null;
  let browser = null;

  try {

    chromium.setGraphicsMode = true; 
    browser =  await puppeteer.launch({
        args: chromium.args,
        defaultViewport: chromium.defaultViewport,
        executablePath: await chromium.executablePath(),
        headless: true,
        ignoreHTTPSErrors: true,
        devtools: false,
        protocolTimeout: 240000,
        args: [
            "--no-sandbox",
            "--disable-setuid-sandbox",
            "--disable-dev-shm-usage",
            "--single-process",
            "--no-zygote",
        ]
    });

    let page = await browser.newPage();

    await page.goto(event.url || 'https://example.com');

    result = await page.title();
  } catch (error) {
    return callback(error);
  } finally {
        if (browser !== null) {
            (await browser).close();
        }
  }

  return callback(null, result);
};
  • Is this because of multiple invocations? I've observed that Puppeteer creates some files in /tmp, is this /tmp shared across invocations?
@mayurvpatil mayurvpatil added the bug Something isn't working label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant