playwright: [BUG] Cannot run Playwright via shell from IIS
Context:
- Playwright Version: 1.8.0
- Operating System: Windows
- Node.js version: 12.18.3
- Browser: Chromium
- Extra: IIS 8
Code Snippet
const playwright = require('playwright');
(async () => {
const browser = await playwright.chromium.launch();
// ...
})();
Describe the bug
In IIS 8, I’m shelling out from PHP to run “node index.js”, but I’m getting the below fatal error.
It looks like an issue related to DPAPI, so I tried setting IIS to load a user profile, but that didn’t make a difference. I’ve read through the Chromium source code a bit, but I’m not sure how the problem traces back.
It’s worth noting that replacing Playwright with Puppeteer solved the problem. Puppeteer has no problem. It looks like Playwright uses a newer version of Chromium than Puppeteer, so that may be related, or it may be that Playwright is enabling/disabling a switch that Puppeteer doesn’t.
ERROR: Access denied
(node:8524) UnhandledPromiseRejectionWarning: browserType.launch: Protocol error (Browser.getVersion): Browser closed.
==================== Browser output: ====================
<launching> C:\\opt\\playwright\\node_modules\\playwright\\.local-browsers\\chromium-844399\\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=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=C:\\Windows\\TEMP\\playwright_chromiumdev_profile-bamqjN --remote-debugging-pipe --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-startup-window
<launched> pid=5504
[err] [0128/124939.752:ERROR:os_crypt_win.cc(70)] Failed to encrypt: The system cannot find the file specified. (0x2)
[err] [0128/124939.752:FATAL:headless_browser_main_parts.cc(103)] Check failed: OSCrypt::Init(local_state_.get()).
[err] Backtrace:
[err] IsSandboxedProcess [0x000007FE6F5B6362+709650]
[err] IsSandboxedProcess [0x000007FE6F5392F2+197538]
[err] IsSandboxedProcess [0x000007FE6F548468+259352]
[err] IsSandboxedProcess [0x000007FE6F5493A0+263248]
[err] RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x000007FE70C63F93+11967571]
[err] RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x000007FE70C63CFD+11966909]
[err] ovly_debug_event [0x000007FE6DB44DB9+15214521]
[err] ovly_debug_event [0x000007FE6DF04CF7+19146487]
[err] ovly_debug_event [0x000007FE6DB43B05+15209733]
[err] ovly_debug_event [0x000007FE6DB4681E+15221278]
[err] IsSandboxedProcess [0x000007FE6FFFB7E7+11479191]
[err] CrashForExceptionInNonABICompliantCodeRange [0x000007FE6F4CEDF3+9454995]
[err] CrashForExceptionInNonABICompliantCodeRange [0x000007FE6F4CFC12+9458610]
[err] CrashForExceptionInNonABICompliantCodeRange [0x000007FE6F4CF88F+9457711]
[err] CrashForExceptionInNonABICompliantCodeRange [0x000007FE6F4CE77D+9453341]
[err] CrashForExceptionInNonABICompliantCodeRange [0x000007FE6F4CEAFA+9454234]
[err] CrashForExceptionInNonABICompliantCodeRange [0x000007FE6F508639+9690585]
[err] CrashForExceptionInNonABICompliantCodeRange [0x000007FE6F5084FB+9690267]
[err] CrashForExceptionInNonABICompliantCodeRange [0x000007FE6F5082F7+9689751]
[err] ChromeMain [0x000007FE6CCC1238+408]
[err] Ordinal0 [0x000007F6C1F426C8+9928]
[err] Ordinal0 [0x000007F6C1F41A41+6721]
[err] GetHandleVerifier [0x000007F6C2089222+898850]
[err] BaseThreadInitThunk [0x000007FE9E8C1652+26]
[err] RtlUserThreadStart [0x000007FEA10E91B1+33]
[err]
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 28 (1 by maintainers)
Commits related to this issue
- feat(chromium): roll Chromium to r851527 Fixes #5197 — committed to aslushnikov/playwright by aslushnikov 3 years ago
- feat(chromium): roll Chromium to r851527 Fixes #5197 — committed to aslushnikov/playwright by aslushnikov 3 years ago
- feat(chromium): roll Chromium to r851527 (#5434) Fixes #5197 — committed to microsoft/playwright by aslushnikov 3 years ago
I’d just like to say that I’ve installed 1.9.1 and it’s working as expected. Thanks @aslushnikov and everyone else who helped to make this happen.
Thanks, @aslushnikov . I’m excited. I’m trying to promote Playwright for use on some of my projects, so looking forward to switching back to it.
Filed upstream: https://bugs.chromium.org/p/chromium/issues/detail?id=1173214
Chromium friends promised to push a fix!
Provided you can install IIS, PHP, and Node.js, here’s the code that should reproduce the problem:
PHP:
Node.js:
Folks, this is an impressive investigation!
@minusdavid I guess you refer to the https://chromium-review.googlesource.com/c/chromium/src/+/2634681, but that was actually just a code move and should not have changed.
Do you think you can help me reproduce this locally on my win machine? Once we can reproduce, we’ll be able to fix it upstream.
I’ll appreciate if you can lead me to setup IIS with a minimal script that reproduces the problem!
I’m not sure if my issue is related, but it looks like having same nature. I’m not running it in IIS, but it is executed remotely by Powershell.
It started to happen on the new PW1.8.0, switching back to 1.6.2 solves the problem.
My user
TestAdminis a domain administrator, and has full access permissions.