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

Chromium headless not work at 2019 image #3438

Closed
1 of 2 tasks
vasokot opened this issue Feb 21, 2019 · 17 comments
Closed
1 of 2 tasks

Chromium headless not work at 2019 image #3438

vasokot opened this issue Feb 21, 2019 · 17 comments

Comments

@vasokot
Copy link

vasokot commented Feb 21, 2019

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID:

Expected behavior

pdf-file created

C:>[0222/033304.305:ERROR:network_change_notifier_win.cc(156)] WSALookupServiceBegin failed with: 0
[0222/033304.334:ERROR:audio_device_listener_win.cc(46)] RegisterEndpointNotificationCallback failed: 80070424
[0222/033309.386:INFO:headless_shell.cc(534)] Written to file C:/chrome/pdftest.pdf.

Actual behavior

error:

[0222/033412.159:ERROR:network_change_notifier_win.cc(156)] WSALookupServiceBegin failed with: 0
[0222/033412.170:ERROR:audio_device_listener_win.cc(46)] RegisterEndpointNotificationCallback failed: 80070424
[0222/033414.488:ERROR:headless_shell.cc(315)] Abnormal renderer termination.

Information

  • Windows Version: Windows Server 2019
  • Docker for Windows Version: 18.03.1-ee-4, build 0ded23c

Steps to reproduce the behavior

  1. Download Chromium 74.0.3714.0 or any other (64.0.3282.0 for example)

  2. Extract chrome-win.zip to C:\chrome

  3. run docker container: docker run --rm -v C:\chrome-win:c:\chrome -i microsoft/dotnet-framework:3.5-runtime-windowsservercore-ltsc2019

  4. run command: C:\chrome\chrome.exe --headless --no-sandbox --print-to-pdf="C:/chrome/pdftest.pdf" https://www.google.com/

Work at:

  • Windows Version: Windows Server 2016
  • Docker for Windows Version: 17.03.1-ee-3, build 3fcee33
  • image microsoft/dotnet-framework:3.5
@sebastien-lorrain
Copy link

Hi,

I can confirm the same faulty behavior, I use CefSharp 71 in Offscreen mode, which also uses Chromium internally.

This is the bug I logged originally:
https://github.com/Microsoft/aspnet-docker/issues/170

While attempting to fix the original problem, I now encounter these errors:

[0225/095323.068:ERROR:network_change_notifier_win.cc(157)] WSALookupServiceBegin failed with: 0 [0225/095323.114:ERROR:audio_device_listener_win.cc(46)] RegisterEndpointNotificationCallback failed: 80070424 [0225/095324.149:ERROR:gpu_process_transport_factory.cc(990)] Lost UI shared context.

Reproduced on Docker 18.09.2

@henrykunz
Copy link

I ran across this error as well. Using Windows Server Core 1803 Images in HyperV-isolation allows headless Chrome to work as expected, but is really not ideal.

@sebastien-lorrain
Copy link

Hello,

I was troubled by this line in particular:

[0225/095323.068:ERROR:network_change_notifier_win.cc(157)] WSALookupServiceBegin failed with: 0

Usually an error code isn't 0, which usually indicates success, so I got the chromium sources, compiled it, and noticed a bug in the logging code. After fixing that bug, the real error code is:

[0419/145327.347:ERROR:network_change_notifier_win.cc(159)] WSALookupServiceBegin failed with: 1722

This seems to indicate an 'The RPC server is unavailable'

Is there a service that should be running and that isn't?

For information, I checked on my running container (following @vasokot exact steps) that both RpcSs and RpcEptMapper services were running, but that doesn't seem enough.

@docker-robott
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@sebastien-lorrain
Copy link

/remove-lifecycle stale

@mattscully
Copy link

I'm not sure if this is the same issue, but there is a lot of overlap of symptoms (WSALookupServiceBegin and RegisterEndpointNotificationCallback failures):

https://bugs.chromium.org/p/chromium/issues/detail?id=944444&q=docker%20OS%3DWindows%20&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified

In the chromium bug, it looks like the problem appears to be the font cache not being able to fallback to the last resort font.

I thought I would share this here in case the chrome bug ends up being the root cause. I am running docker 19.03.1 and a base docker image of mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 (which does not have the FontCache service installed).

@docker-robott
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@sebastien-lorrain
Copy link

To the best of my knowledge the issue still stands.

/remove-lifecycle stale

@gantrior
Copy link

2019 image does not contain fonts, so chrome can't default to last resort font. The solution is to install fonts manually (which is not trivial though).

Example and working Dockerfile can be found in my repo here: https://github.com/gantrior/docker-chrome-windows

@KGitanjali
Copy link

KGitanjali commented Dec 13, 2019

Hi Gantrior,

I tried your solution and ran powershell command given in the start.ps1 inside of container but failed with below error:

c:\Program Files (x86)\Google\Chrome\Application>chrome.exe --headless --disable-gpu --no-sandbox --enable-logging --print-to-pdf="C:/export/pdftest.pdf" htt
ps://www.google.com

c:\Program Files (x86)\Google\Chrome\Application>[1213/205519.925:ERROR:network_change_notifier_win.cc(141)] WSALookupServiceBegin failed with: 0
[1213/205519.980:ERROR:network_change_notifier_win.cc(141)] WSALookupServiceBegin failed with: 0
[1213/205520.931:ERROR:headless_shell.cc(595)] Writing to file C:/export/pdftest.pdf was unsuccessful, could not open file: FILE_ERROR_NOT_FOUND

could you please suggest here.

@abmarko
Copy link

abmarko commented Dec 13, 2019

@KGitanjali I think you have to create the C:/export folder first or change the --print-to-pdf value to a valid path. After that it should works!
@gantrior thanks for your tip! It helps me a lot!

@KGitanjali
Copy link

Thank you abmarko for the correction..after creating the required path it worked..!!
Thank you gantrior for the solution..after adding fonts, test cases executed with google chrome inside container.

@dsolanki6499
Copy link

@gantrior your files worked like a charm!!!! thanks a ton :))

@dsolanki6499
Copy link

2019 image does not contain fonts, so chrome can't default to last resort font. The solution is to install fonts manually (which is not trivial though).

Example and working Dockerfile can be found in my repo here: https://github.com/gantrior/docker-chrome-windows

BEST ever solution!!!
Chrome is now running in my windows container.

@Andrew-Archon
Copy link

Thank you for this. It seems to have solved my issue as well.

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Aug 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants