loki icon indicating copy to clipboard operation
loki copied to clipboard

chrome.docker ECONNREFUSED in Vite

Open marduzca opened this issue 2 years ago • 5 comments

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 avatar May 09 '23 08:05 marduzca

@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

dgrantmettle avatar Jun 13 '23 17:06 dgrantmettle

@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.

gidztech avatar Sep 18 '23 16:09 gidztech

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.

remleduff avatar Oct 11 '23 19:10 remleduff

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 avatar Apr 19 '24 11:04 anthodb

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

anthodb avatar Apr 19 '24 12:04 anthodb