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

chrome.docker ECONNREFUSED in Vite #456

Open
marduzca opened this issue May 9, 2023 · 5 comments
Open

chrome.docker ECONNREFUSED in Vite #456

marduzca opened this issue May 9, 2023 · 5 comments

Comments

@marduzca
Copy link

marduzca commented May 9, 2023

My setup:

  • M1 Mac
  • Storybook : v7.0.4
  • Vite: v4.2.1
  • loki: v0.31.2

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!

@marduzca marduzca changed the title chrome.docker ECONNREFUSED after upgrading to v0.31.2 chrome.docker ECONNREFUSED May 9, 2023
@marduzca marduzca changed the title chrome.docker ECONNREFUSED chrome.docker ECONNREFUSED in Vite May 9, 2023
@dgrantmettle
Copy link

@marduzca did you have much luck with this?

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

  • M1 Mac (13.4)
  • Docker version 23.0.5
  • Storybook: 7.0.18
  • Loki: 0.31.2
[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
Copy link
Contributor

@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
Copy link
Contributor

If you're running docker-in-docker, it'd be worth checking if #478 helps.

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

@anthodb
Copy link

anthodb commented Apr 19, 2024

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
Copy link

anthodb commented Apr 19, 2024

and by the way, if i don't use the chromeDockerWithoutSeccomp value to "true", I end up to another known issue :
#513

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants