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

Headful chromium on Windows does not launch without '--single-process' #12174

Closed
wangzyh opened this issue Feb 17, 2022 · 6 comments
Closed

Headful chromium on Windows does not launch without '--single-process' #12174

wangzyh opened this issue Feb 17, 2022 · 6 comments

Comments

@wangzyh
Copy link

wangzyh commented Feb 17, 2022

Context:

  • Playwright Version: 1.18.1
  • Operating System: Windows 10
  • Node.js version: 14.18.1
  • Browser: Chromium

Code Snippet

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

(async () => {
    const browser = await chromium.launch({
        headless: false, args: ['--single-process']
    });
    const context = await browser.newContext();
    const page = await context.newPage();
    await page.goto('https://ct.ctrip.com/');
    await browser.close();
})();

Describe the bug

Chromium can not launch without args: ['--single-process'] in headful mode. Like in #3191, but its solution doesn't work for me.

The error output is as follows:

(node:48688) UnhandledPromiseRejectionWarning: Error: Page closed
    at CRSession.<anonymous> (D:\Code\new\playwright_cucumber_corp\node_modules\playwright-core\lib\server\chromium\crPage.js:433:54)
    at Object.onceWrapper (events.js:519:28)
    at CRSession.emit (events.js:412:35)
    at D:\Code\new\playwright_cucumber_corp\node_modules\playwright-core\lib\server\chromium\crConnection.js:253:39
(Use `node --trace-warnings ...` to show where the warning was created)
(node:48688) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:48688) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:48688) UnhandledPromiseRejectionWarning: browserContext.newPage: Browser closed.
==================== Browser output: ====================
<launching> D:\Users\zhiyuan.wang\AppData\Local\ms-playwright\chromium-956323\chrome-win\chrome.exe --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=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame,AutoExpandDetailsElement --allow-pre-commit-input --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 --no-service-autorun --export-tagged-pdf --no-sandbox --user-data-dir=D:\Users\ZHIYUA~1.WAN\AppData\Local\Temp\playwright_chromiumdev_profile-kKVTom --remote-debugging-pipe --no-startup-window
<launched> pid=8852
    at D:\Code\new\playwright_cucumber_corp\test.js:9:32
(node:48688) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)`


pw:api => browserType.launch started +0ms 
pw:api <= browserType.launch succeeded +4s
pw:api => browser.newContext started +1ms
pw:api <= browser.newContext failed +12s
@dgozman
Copy link
Contributor

dgozman commented Feb 17, 2022

@wangzyh There is no logs/errors/output to start debugging the issue. Could you please run with DEBUG=pw:browser* environment variable and post the logs here?

@wangzyh
Copy link
Author

wangzyh commented Feb 18, 2022

@dgozman yes, the result is as follows

  pw:browser <launching> D:\Users\zhiyuan.wang\AppData\Local\ms-playwright\chromium-956323\chrome-win\chrome.exe --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=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame,AutoExpandDetailsElement --allow-pre-commit-input --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 --no-service-autorun --export-tagged-pdf --no-sandbox --user-data-dir=D:\Users\ZHIYUA~1.WAN\AppData\Local\Temp\playwright_chromiumdev_profile-qRrfFQ --remote-debugging-pipe --no-startup-window +0ms
  pw:browser <launched> pid=24316 +37ms
(node:70164) UnhandledPromiseRejectionWarning: Error: Page closed
    at CRSession.<anonymous> (D:\Code\new\playwright_cucumber_corp\node_modules\playwright-core\lib\server\chromium\crPage.js:433:54)
    at Object.onceWrapper (events.js:519:28)
    at CRSession.emit (events.js:412:35)
    at D:\Code\new\playwright_cucumber_corp\node_modules\playwright-core\lib\server\chromium\crConnection.js:253:39
(Use `node --trace-warnings ...` to show where the warning was created)
(node:70164) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:70164) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:70164) UnhandledPromiseRejectionWarning: browserContext.newPage: Browser closed.
==================== Browser output: ====================
<launching> D:\Users\zhiyuan.wang\AppData\Local\ms-playwright\chromium-956323\chrome-win\chrome.exe --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=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame,AutoExpandDetailsElement --allow-pre-commit-input --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 --no-service-autorun --export-tagged-pdf --no-sandbox --user-data-dir=D:\Users\ZHIYUA~1.WAN\AppData\Local\Temp\playwright_chromiumdev_profile-qRrfFQ --remote-debugging-pipe --no-startup-window
<launched> pid=24316
    at D:\Code\new\playwright_cucumber_corp\test.js:9:32
(node:70164) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
  pw:browser [pid=24316] <process did exit: exitCode=3221226356, signal=null> +9s
  pw:browser [pid=24316] starting temporary directories cleanup +1ms
  pw:browser [pid=24316] finished temporary directories cleanup

@dgozman
Copy link
Contributor

dgozman commented Feb 18, 2022

@wangzyh Unfortunately, there is nothing interesting in the logs, so I am not sure where the problem comes from. Perhaps some kind of enterprise policy? I'd suggest to try manually running the following executable, e.g. double-click it.

D:\Users\zhiyuan.wang\AppData\Local\ms-playwright\chromium-956323\chrome-win\chrome.exe

If it launches, try to open your test page there. If that works, go to chrome://policy and see what policies are in effect.

@wangzyh
Copy link
Author

wangzyh commented Feb 19, 2022

@dgozman It can be launched normally, and there is no problem opening the test page.
Policy get as follows:

{
   "chromeMetadata": {
      "OS": "Windows 10 Version 21H1 (Build 19043.1466)",
      "application": "Chromium",
      "revision": "93faa18878ea62a2d1611880e4b156348128635e-refs/heads/main@{#956323}",
      "version": "99.0.4812.0  (64 位)"
   },
   "chromePolicies": {

   },
   "extensionPolicies": {

   },
   "status": {

   }
}

@dgozman
Copy link
Contributor

dgozman commented Feb 21, 2022

@wangzyh Thank you for trying. Not sure how to help further, everything seems fine.

@yury-s
Copy link
Member

yury-s commented Mar 8, 2022

Thanks for the report! It does look like there is a real bug here, but it is very hard to understand what's going on. We need more information to act on this report. Please file a new one and link to this issue if there is additional information that could help debugging!

@yury-s yury-s closed this as completed Mar 8, 2022
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