[BUG] Cannot run Playwright via shell from IIS

See original GitHub issue

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] 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:28 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
minusdavidcommented, Mar 2, 2021

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.

1reaction
minusdavidcommented, Feb 5, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - create a trusted self-signed SSL cert for localhost (for ...
I'm working on Windows 10, with Chrome 65. Firefox is behaving nicely - just confirm localhost as a security exception and it will...
Read more >
How to Fix the NET::ERR_CERT_AUTHORITY_INVALID Error
The NET::ERR_CERT_AUTHORITY_INVALID error occurs when a website's SSL certificate isn't trusted by the browser. Learn what's causing it and ...
Read more >
Issue 761295: Chrome Headless can't navigate to pdf - Monorail
(1) Run chromium with the following command: ... Actual: command hangs. Downstream bug: https://github.com/GoogleChrome/puppeteer/issues/610
Read more >
Configuring your application's dependencies - AWS Elastic ...
js modules, such as the ones you specify in require() statements. These modules are stored in a node_modules directory. When your application runs,...
Read more >
Automating Selenium Tests in Azure Pipelines
Can you please suggest ways to trigger automation runs via CLI and publish results to TFS ? Technus • 2 years ago. I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found