Closed arjunattam closed 3 years ago
More info from @yingzhe who was running into this: this happens when Chromium is launched with admin privileges. Running without admin does not require the --no-sandbox flag. Confirmed with the other user who was faced this as well: their VS Code was running as admin, and they were launching Chromium via npm test
called from the integrated terminal.
@aslushnikov: Can we handle this case? Seems similar to root user on Linux?
It may have something to do with launching from VS Code, npm run ctest -- evaluation.jest
passes for me when run as Administrator.
this happens when Chromium is launched with admin privileges. Running without admin does not require the --no-sandbox flag
@arjun27 I couldn't reproduce this: tried running under administrator in both MINGW and CMD terminals and launching simple script there - worked fine for me without --no-sandbox
flag.
Playwright: 1.2.1 OS: Windows 10 Node.js: 12.16.3 Browser: Chromium
Below is the error I get when running from non-admin mode command prompt:
(node:1708) UnhandledPromiseRejectionWarning: Error: Page closed at CRSession.
(E:\1\node_modules\playwright\lib\chromium\crPage.js:260:60) at Object.onceWrapper (events.js:416:28) at CRSession.emit (events.js:322:22) at E:\1\node_modules\playwright\lib\chromium\crConnection.js:167:43 -- ASYNC -- at CRBrowserContext.newPage (E:\1\node_modules\playwright\lib\helper.js:78:23) at E:\1\tests\test1.ts:6:32 (node:1708) 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:1708) [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.
Code is the same as what was originally posted by @arjun27 above. I had to interrupt with ctrl+c, as the process never completes.
@yingzhe can you please try with the latest Playwright v1.3.0? We have some nice logic there to detect missing libraries; I hope it will give us a hint on what's going on.
(node:35404) UnhandledPromiseRejectionWarning: Error: Page closed at CRSession.
(E:\1\node_modules\playwright\lib\chromium\crPage.js:263:60) at Object.onceWrapper (events.js:416:28) at CRSession.emit (events.js:322:22) at E:\1\node_modules\playwright\lib\chromium\crConnection.js:171:43 -- ASYNC -- at CRBrowserContext.newPage (E:\1\node_modules\playwright\lib\helper.js:79:23) at E:\1\tests\tests1.ts:7:32 (node:35404) 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:35404) [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.
I updated Playwright to v1.3.0 but it looks like the error I get is still the same, with the process being stuck forever until I kill it.
Sandbox configuration proved to be painful in various environments, and this issue is another example.
playwright v1.5.0 now runs --no-sandbox
by default,
so this can be closed.
Context:
Code Snippet
Describe the bug
Chromium does not launch unless passed with
args: ['--no-sandbox']
- in both headful and headless modes.--disable-gpu
did not help, like in #2698. Logs seen without args are pasted below."method":"Inspector.targetCrashed"
seems to be the culprit.