-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Running in docker 'Exception: Websocket url not found' #128
Comments
Hi @yudansha , |
Also it's possible that you need the |
Hi @xvrh,
|
Hi! I'm running into the same issue. I'm using the following Dockerfile: FROM google/dart
WORKDIR /app
RUN apt-get update && apt-get install -y unzip
ADD pubspec.* /app/
RUN pub get
ADD . /app
RUN pub get --offline
CMD []
ENTRYPOINT ["dart", "./bin/importer.dart"] I'm running the app in the Dart VM. I'm launching puppeteer without any options: var browser = await puppeteer.launch(); |
On a docker container with chromium installed when you try to run on bash So launching puppeteer as:
Launches puppeteer correctly. |
Installing Chromium in the container fixes the issue for me. I'm a bit confused though, as there is also a local-chromium installed. Why would I need Chromium installed as well? Thanks! |
@derkweijers This is the way it was solved on a a popular node dockerfile buildkite/docker-puppeteer#91 (comment):
|
Thanks! It's running in production for a few days now without problems. For me, this issue is solved. |
I encountered this problem on Ubuntu 20.04, then I tried to run chrome in .local-chromium directly, I found that some so files such as libatk and libgdm were missing, then I installed these dependencies by apt install, the problem solved. |
Problem Sovled!问题完美解决了!(我是在树莓派上遇到的这个问题,mac上是没有这个问题的) 让我们来分析下这个问题。 为什么报“Websocket url not found”这个错误?通过看源码以及对比mac上可以猜测出应该是puppeteer准备下载chromium的时候没有找到对应当前操作系统的chromium版本。所以也就无法去下载了,也就没有后续了。(puppeteer应该只是准备了mac,windows,linux等主流操作系统的chromium版本,所以当遇到树莓派等其他操作系统的时候就找不到合适的chromium包了,所以出现该错误) 如何解决该问题?知道了问题所在就很简单了,我们知道puppeteer.launch的时候有个executablePath的入参,这个是关键,那我们可以在树莓派上自己安装chromium-browser版本,然后指定到我们的chromium-browser即可 sudo apt install chromium-browser -y # 安装完成后路径是 /usr/bin/chromium-browser 安装完成后指定executablePath browser = await puppeteer.launch(
headless: true,
noSandboxFlag: true,
executablePath: '/usr/bin/chromium-browser',
args: [
'--use-fake-ui-for-media-stream',
'--disable-setuid-sandbox',
'--no-sandbox'
]); That‘s the way to solve this problem and I trust it works for you too! |
I build a small dart console app and compiled it via dart2native.
Everything works fine until puppeteer starts up.
I see in the docker that chrome is downloaded and the folder .local-chromium is created.
But nevertheless I get the exception: 'Exception: Websocket url not found'
Is there something missing?
I call puppeteer as following:
The text was updated successfully, but these errors were encountered: