garris / BackstopJS

Catch CSS curve balls.
http://backstopjs.org
MIT License
6.66k stars 602 forks source link

Failed to launch the browser process when running inside of docker container #1560

Closed erkannt closed 3 months ago

erkannt commented 4 months ago

We are currently stuck on version 6.2.2 of BackstopJS.

In versions since 6.3.3 it fails with the following error.

COMMAND | Executing core for "test"
createBitmaps | Selected 27 of 27 scenarios.
      COMMAND | Command "test" ended with an error after [1.623s]
      COMMAND | Error: Failed to launch the browser process!
                chrome_crashpad_handler: --database is required
                Try 'chrome_crashpad_handler --help' for more information.
                [23:23:0307/073746.668667:ERROR:socket.cc(120)] recvmsg: Connection reset by peer (104)

                TROUBLESHOOTING: https://pptr.dev/troubleshooting

                    at Interface.onClose (/usr/local/lib/node_modules/backstopjs/node_modules/@puppeteer/browsers/lib/cjs/launch.js:267:24)
                    at Interface.emit (node:events:530:35)
                    at Interface.close (node:internal/readline/interface:527:10)
                    at Socket.onend (node:internal/readline/interface:253:10)
                    at Socket.emit (node:events:530:35)
                    at endReadableNT (node:internal/streams/readable:1696:12)
                    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
COMMAND | Executing core for "openReport"
openReport | Attempting to ping 
   COMMAND | Command "test" ended with an error after [42.454s]
   COMMAND | Error: docker run --rm -i --user $(id -u):$(id -g) --network sciety-test_default --mount type=bind,source="/home/runner/work/sciety/sciety",target=/src backstopjs/backstopjs:6.3.23 test "--moby" "--filter=" returned 1

Our config How we run it in Github Actions

garris commented 4 months ago

Hey @erkannt I'm sorry this isn't working for you. The 6.3.23 docker sanity test is working for me locally. Could you maybe try to isolate this a bit?

There were a few changes to the docker file since 6.2.2...

image

And also puppeteer was bumped (among others)

image

Does reverting either of these provide any insight?

erkannt commented 4 months ago

Thanks for the pointer to the docker sanity test. We'll do our best to narrow this down. What we have done so far:

We have noticed that the docker sanity test runs backstopjs fully inside the container, however we run backstopjs outside of docker using the --docker flag and a custom dockerCommandTemplate.

We will continue investigating as we find time. If you have any other pointers they are much appreciated.

erkannt commented 3 months ago

Looks like it was a change to the Docker container. We had copied and adjusted the default dockerCommandTemplate prior to https://github.com/garris/BackstopJS/commit/629a8ab373614c13a938416c203cc37ddcd14769. Removing --user $(id -u):$(id -g) from our dockerCommandTemplate seems to fix the issue.