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] MS Edge Chromium crashes on closing in headless mode #3284

Closed
imsocrazy opened this issue Aug 4, 2020 · 3 comments
Closed

[BUG] MS Edge Chromium crashes on closing in headless mode #3284

imsocrazy opened this issue Aug 4, 2020 · 3 comments

Comments

@imsocrazy
Copy link

Context:

  • Playwright Version: playwright-chromium@1.2.1
  • Operating System: Windows 10 Build 18363.900
  • Node.js version: 12.18.3
  • Browser: MS Edge Chromium Version 84.0.522.52 (Official build) (64-bit)

Code Snippet

const EDGE_PATH = require("edge-paths").getEdgePath();
const chromium = require('playwright-chromium').chromium;

const test = async () => {
	console.warn('Starting browser');
	const browser = await chromium.launch({
		executablePath: EDGE_PATH,
		headless: true,
		// logger: {
		// 	isEnabled: (name, severity) => {
		// 		return name === 'protocol';
		// 	},
		// 	log: (name, severity, message, args) => console.log(`${name} [${severity}] ${message}`)
		// }
	});

	const pageUrl = 'https://google.com';
	const closeBrowser = async timeout => {
		return new Promise(resolve => {
			setTimeout(async () => {
				console.log('Closing browser');
				await browser.close();
				resolve();
			}, timeout);
		});
	};

	const context = await browser.newContext();
	const page = await context.newPage();
	await page.goto(pageUrl);
	await closeBrowser(1000);
};

test();

Describe the bug

Hi!
When I tried to use MS Edge Chromium for testing it crashes on browser closing.
I provided simple script that reproduces my problem.

After browser closing I have console error. This error is due to the "...\AppData\Local\Temp\playwright_chromiumdev_profile-8VPUjL\CrashpadMetrics-active.pma" can't be unlinked.

[Error: EPERM: operation not permitted, unlink '....\AppData\Local\Temp\playwright_chromiumdev_profile-8VPUjL\CrashpadMetrics-active.pma'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'unlink',
  path: '....\\AppData\\Local\\Temp\\playwright_chromiumdev_profile-8VPUjL\\CrashpadMetrics-active.pma'
}

I suppose when playwright-chromium cleans temp folder MS Edge writes crash report there.
The same error appears when browser running in headless mode inside Windows Docker container.
Additionally I see system window with error. This window sais that MS Edge has stopped working.

image

In case when browser is started with headless=false this problem is not reproduced.

Other interesting thing: when logger with 'protocol' level is attached to the playwright, code often stops on the page.goto() command without any errors.

@mxschmitt
Copy link
Member

mxschmitt commented Aug 4, 2020

Hi @imsocrazy, we are relying on some recent Chromium changes, could you try it with the Microsoft Edge Insiders build until the changes are in the stable release?
That could be the reason.
https://www.microsoftedgeinsider.com/de-de/download/canary

@imsocrazy
Copy link
Author

imsocrazy commented Aug 4, 2020

Hi @mxschmitt,
Thanks for the quick answer, but the same issue with Edge Canary.
Version 86.0.597.0 (Official build) canary (64-bit)

@dgozman
Copy link
Contributor

dgozman commented Nov 24, 2020

Duplicate of #4465.

@dgozman dgozman closed this as completed Nov 24, 2020
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