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]: If pipe: true, if the executable fails to spawn, it will exit without throwing an error. #12025

Closed
2 tasks
yskszk63 opened this issue Feb 29, 2024 · 1 comment · Fixed by #12201
Closed
2 tasks
Assignees

Comments

@yskszk63
Copy link

Minimal, reproducible example

import * as puppeteer from "puppeteer-core";

try {
  await puppeteer.launch({
    executablePath: "/not/exists/fa4982ed-c36e-4f4d-9531-96b589e3c5ee",
    pipe: true,
  });
} catch (e) {
  // NOP
}
console.log("OK");

Error string

throw er; // Unhandled 'error' event

Bug behavior

  • Flaky
  • PDF

Background

When we were running puppeteer in a serverless environment, the process was terminating in the middle, resulting in strange behavior.
After investigating the cause, we found that the executablePath was incorrectly specified.

Expectation

Errors can be caught and subsequent processing can be performed.

Reality

The following log is output and the process is not executed until the end.

node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: spawn /not/exists/fa4982ed-c36e-4f4d-9531-96b589e3c5ee ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /not/exists/fa4982ed-c36e-4f4d-9531-96b589e3c5ee',
  path: '/not/exists/fa4982ed-c36e-4f4d-9531-96b589e3c5ee',
  spawnargs: [
    '--allow-pre-commit-input',
    '--disable-background-networking',
    '--disable-background-timer-throttling',
    '--disable-backgrounding-occluded-windows',
    '--disable-breakpad',
    '--disable-client-side-phishing-detection',
    '--disable-component-extensions-with-background-pages',
    '--disable-component-update',
    '--disable-default-apps',
    '--disable-dev-shm-usage',
    '--disable-extensions',
    '--disable-field-trial-config',
    '--disable-hang-monitor',
    '--disable-infobars',
    '--disable-ipc-flooding-protection',
    '--disable-popup-blocking',
    '--disable-prompt-on-repost',
    '--disable-renderer-backgrounding',
    '--disable-search-engine-choice-screen',
    '--disable-sync',
    '--enable-automation',
    '--export-tagged-pdf',
    '--generate-pdf-document-outline',
    '--force-color-profile=srgb',
    '--metrics-recording-only',
    '--no-first-run',
    '--password-store=basic',
    '--use-mock-keychain',
    '--disable-features=Translate,AcceptCHFrame,MediaRouter,OptimizationHints,ProcessPerSiteUpToMainFrameThreshold',
    '--enable-features=NetworkServiceInProcess2',
    '--headless=new',
    '--hide-scrollbars',
    '--mute-audio',
    'about:blank',
    '--remote-debugging-pipe',
    '--user-data-dir=/tmp/puppeteer_dev_chrome_profile-HtXbMq'
  ]
}

Node.js v20.11.1

Puppeteer configuration file (if used)

No response

Puppeteer version

22.3.0

Node version

20.11.1

Package manager

npm

Package manager version

10.2.4

Operating system

Linux

This comment was marked as outdated.

@OrKoN OrKoN self-assigned this Mar 30, 2024
OrKoN added a commit that referenced this issue Apr 3, 2024
OrKoN added a commit that referenced this issue Apr 3, 2024
OrKoN added a commit that referenced this issue Apr 4, 2024
OrKoN added a commit that referenced this issue Apr 4, 2024
Lightning00Blade pushed a commit that referenced this issue Apr 4, 2024
OrKoN added a commit that referenced this issue Apr 4, 2024
OrKoN added a commit that referenced this issue Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants