puppeteer: [Bug]: docker install puppeteer Package google-chrome-stable is not available, but is referred to by another package.

Bug description

Running Puppeteer in Docker with https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-in-docker

terminal output:

15.15 Hit:1 http://security.debian.org/debian-security stretch/updates InRelease
15.15 Ign:2 http://deb.debian.org/debian stretch InRelease
15.34 Hit:3 http://deb.debian.org/debian stretch-updates InRelease
15.45 Get:4 http://dl.google.com/linux/chrome/deb stable InRelease [1811 B]
15.55 Hit:5 http://deb.debian.org/debian stretch Release
16.05 Get:7 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1099 B]
16.08 Fetched 2910 B in 1s (1999 B/s)
16.08 Reading package lists...
16.43 Reading package lists...
16.75 Building dependency tree...
16.80 Reading state information...
16.80 Package google-chrome-stable is not available, but is referred to by another package.
16.80 This may mean that the package is missing, has been obsoleted, or
16.80 is only available from another source
16.80 
16.81 E: Package 'google-chrome-stable' has no installation candidate
------

thanks

Puppeteer version

latest

Node.js version

node:12-slim

npm version

6

What operating system are you seeing the problem on?

Apple Silicon(M1)Mac macOS Monterey

Relevant log output

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 20
  • Comments: 15

Most upvoted comments

This made the job for me: docker build . -t my_service --platform=linux/amd64

Unfortunately, @BrTkCa’s solution didn’t work for me 😦 [MacBook Pro M1 Pro running macOS Monterey]

Forgot to add, I’m using Multipass to host the Docker containers.

If I add --platform=linux/amd64 then the docker build command finishes but I get the following error when trying to use Puppeteer inside Docker container.

Error: Failed to launch the browser process!
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[93:93:0728/082124.672818:ERROR:nacl_fork_delegate_linux.cc(311)] Bad NaCl helper startup ack (0 bytes)
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[38:38:0728/082124.730411:ERROR:browser_dm_token_storage_linux.cc(92)] Error: /etc/machine-id contains 0 characters (32 were expected).
[38:101:0728/082124.796418:ERROR:file_path_watcher_inotify.cc(329)] inotify_init() failed: Function not implemented (38)
[0728/082124.897969:ERROR:scoped_ptrace_attach.cc(27)] ptrace: Function not implemented (38)
Assertion failed: p_rcu_reader->depth != 0 (/qemu/include/qemu/rcu.h: rcu_read_unlock: 101)


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:289:20)
    at ChildProcess.<anonymous> (/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:280:24)
    at ChildProcess.emit (events.js:412:35)
    at ChildProcess.emit (domain.js:475:12)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)

The same code works as expected on my old Intel Mac.

edit:

I was able to get it working with lima https://github.com/lima-vm/lima. But it’s quite slow.

This blog post explains how to set it up. https://binx.io/2022/06/23/how-to-run-intel-docker-images-on-mac-m1-using-lima/

Currently encountering the same error on the MacBookAir m1 😦

The above fix didn’t work for me. I had to upgrade to Node 14 to get this working.

@BrTkCa Thanks for the help, it works for me as well.