oblador / loki

👁 Visual Regression Testing for Storybook
https://loki.js.org/
MIT License
1.78k stars 173 forks source link

chrome.docker ECONNREFUSED in Vite #456

Open marduzca opened 1 year ago

marduzca commented 1 year ago

My setup:

Hi everyone! I recently migrated from CRA to Vite which also forced me to move to Storybook 7 and the latest loki version and I started running into a weird issue.

Whenever I try to run the loki tests, it takes a while to start and ends with the following error:

 FAIL  chrome.docker
       Fetching stories
       connect ECONNREFUSED 127.0.0.1:56803
Command failed with exit code 1: docker kill 62a06ac516cedd981e5bcf2d7191f5c490f54afdfa761b5388bcf7ddf9582114
Error response from daemon: Cannot kill container: 62a06ac516cedd981e5bcf2d7191f5c490f54afdfa761b5388bcf7ddf9582114: No such container: 62a06ac516cedd981e5bcf2d7191f5c490f54afdfa761b5388bcf7ddf9582114

Not sure where this comes from, as I had no issues before. Is anyone having similar issues or does have an idea of what the issue could be?

Thanks in advance!

dgrantmettle commented 1 year ago

@marduzca did you have much luck with this?

i'm experiencing the same issue, albeit without Vite:

[loki] FAIL chrome.docker/FETCH_STORIES: connect ECONNREFUSED 127.0.0.1:59575
[loki] FAIL chrome.docker: Some tasks failed to run
[loki] Command failed with exit code 1: docker kill 53054639680fbc7800af37435c356cc754cc57d0e4050fa334cc62c0d5267ae7
[loki] Error response from daemon: Cannot kill container: 53054639680fbc7800af37435c356cc754cc57d0e4050fa334cc62c0d5267ae7: No such container: 53054639680fbc7800af37435c356cc754cc57d0e4050fa334cc62c0d5267ae7

I've tried setting a newer chrome image yukinying/chrome-headless-browser-stable:latest but getting the same issue

loki test --verboseRenderer --chromeDockerImage=yukinying/chrome-headless-browser-stable:latest

gidztech commented 1 year ago

@marduzca @dgrantmettle

I was getting this on Windows on recent builds of the yukinying/chrome-headless-browser-stable image. I ran the docker run command using the final set of args that Loki was using to start the container, and found that it was the seccomp option that was causing the container to exit immediately. Removing it fixed it for me.

I set the following in my loki.config.js file: chromeDockerWithoutSeccomp: !process.env.CI ? true : false,

I'm not sure it's necessarily the same issue for you since it's a general error, but for visibility maybe it solves yours or someone else's problem.

remleduff commented 1 year ago

If you're running docker-in-docker, it'd be worth checking if https://github.com/oblador/loki/pull/478 helps.

Particularly the timeout for 127.0.0.1 seems similar to the error I was seeing.

anthodb commented 6 months ago

Hello everyone, any news on this one? I get the same error on bitbucket..

loki test v0.35.0
(node:496) NOTE: The AWS SDK for JavaScript (v2) will enter maintenance mode
on September 8, 2024 and reach end-of-support on September 8, 2025.
Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check blog post at https://a.co/cUPnyil
(Use `node --trace-warnings ...` to show where the warning was created)
RUNS chrome.docker
RUNS chrome.docker/PREPARE
PASS chrome.docker/PREPARE
RUNS chrome.docker/START
Waiting for 127.0.0.1:30989.
Connected!
PASS chrome.docker/START
RUNS chrome.docker/FETCH_STORIES
FAIL chrome.docker/FETCH_STORIES: connect ECONNREFUSED 127.0.0.1:30989
FAIL chrome.docker: Some tasks failed to run
Some visual tests failed to run

It's a simple loki config with storybook 7 and "chromeDockerWithoutSeccomp: true" in the config.js file. Any help on this would be much appreciated!

Thanks a lot to the team for the superb library by the way!

anthodb commented 6 months ago

and by the way, if i don't use the chromeDockerWithoutSeccomp value to "true", I end up to another known issue : https://github.com/oblador/loki/issues/513