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] UnhandledPromiseRejectionWarning: browserType.launch: Timeout 30000ms exceeded. #5749

Closed
ianhosk opened this issue Mar 7, 2021 · 4 comments

Comments

@ianhosk
Copy link

ianhosk commented Mar 7, 2021

Context:

  • Playwright Version: 1.9.1
  • Operating System: [WSL2, Debian]
  • Node.js version: v14.16.0
  • Browser: All
  • Extra: x-server (x410)

Code Snippet

const { chromium } = require("playwright");

(async () => {
  const browser = await chromium.launch({ headless: false,args: ['--no-sandbox','--disable-setuid-sandbox','--disable-dev-shm-usage','--enable-logging'] });
  const context = await browser.newContext();
  const page = await context.newPage();
  await page.goto("https://www.californiaorganics.com/");
  const dimensions = await page.evaluate(() => {
    return {
      width: document.documentElement.clientWidth,
      height: document.documentElement.clientHeight,
      deviceScaleFactor: window.devicePixelRatio
    }
  });
  console.log(dimensions);

  await browser.close();
})();

(async () => {
  const browser = await chromium.launch();
  // ...
})();

Describe the bug

DEBUG=pw:api node index.js

pw:api => browserType.launch started +0ms
pw:api <= browserType.launch failed +30s
(node:14082) UnhandledPromiseRejectionWarning: browserType.launch: Timeout 30000ms exceeded.

DEBUG=pw:browser* node index.js
pw:browser /root/.cache/ms-playwright/chromium-854489/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies,LazyFrameLoading --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --user-data-dir=/tmp/playwright_chromiumdev_profile-cnjjtR --remote-debugging-pipe --no-sandbox --no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage --enable-logging --no-startup-window +0ms
pw:browser pid=14250 +1ms
pw:browser +30s
pw:browser +12ms
pw:browser +4ms
pw:browser +3ms
(node:14173) UnhandledPromiseRejectionWarning: browserType.launch: Timeout 30000ms exceeded.

@yury-s yury-s changed the title UnhandledPromiseRejectionWarning: browserType.launch: Timeout 30000ms exceeded. [BUG] UnhandledPromiseRejectionWarning: browserType.launch: Timeout 30000ms exceeded. Mar 9, 2021
@yury-s yury-s added the triaging label Mar 9, 2021
@yury-s
Copy link
Member

yury-s commented Mar 9, 2021

Thanks for the report, could you run the test with DEBUG=pw:protocol,pw:browser and upload the logs?

@yury-s
Copy link
Member

yury-s commented Mar 9, 2021

I just ran your snippet on ubuntu 20.04 and wsl2 with no issues. The only difference is that I ran in headless mode. Does the problem persist if you remove headless: false argument?

@yury-s
Copy link
Member

yury-s commented Mar 9, 2021

Update: I managed to launch it in headed mode too, the x-server I used is VcXsrv which I configured following instructions from this post. I was running under normal user (not root) which might matter. Does chrome launch for you if you try /root/.cache/ms-playwright/chromium-854489/chrome-linux/chrome ?

@aslushnikov
Copy link
Collaborator

Closing this since there's no feedback 🤷‍♂️ Feel free to re-submit with new details if you still experience this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants