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

Can't make wait-on work in Github action #86

Open
alexbjorlig opened this issue Jan 3, 2021 · 9 comments
Open

Can't make wait-on work in Github action #86

alexbjorlig opened this issue Jan 3, 2021 · 9 comments

Comments

@alexbjorlig
Copy link

Hi Jeff.

Thanks for an awesome library, but I can't get it to work on Github actions.

I use this command:

npm run start:test & ./node_modules/.bin/wait-on http://localhost:3000 --timeout 120000 -v

I can tell from the output that the server is up and running on port 3000, but wait-on only prints this output:

2021-01-03 11:42:52 info: Express is 👂  on port 3000/graphql. (Pid 2995)
making HTTP(S) head request to  url:http://localhost:3000 ...
  HTTP(S) error for http://localhost:3000 Error: Request failed with status code 500
making HTTP(S) head request to  url:http://localhost:3000 ...
  HTTP(S) error for http://localhost:3000 Error: Request failed with status code 500
making HTTP(S) head request to  url:http://localhost:3000 ...
  HTTP(S) error for http://localhost:3000 Error: Request failed with status code 500
making HTTP(S) head request to  url:http://localhost:3000 ...
  HTTP(S) error for http://localhost:3000 Error: Request failed with status code 500
making HTTP(S) head request to  url:http://localhost:3000 ...
  HTTP(S) error for http://localhost:3000 Error: Request failed with status code 500
making HTTP(S) head request to  url:http://localhost:3000 ...
  HTTP(S) error for http://localhost:3000 Error: Request failed with status code 500
making HTTP(S) head request to  url:http://localhost:3000 ...
  HTTP(S) error for http://localhost:3000 Error: Request failed with status code 500
making HTTP(S) head request to  url:http://localhost:3000 ...
  HTTP(S) error for http://localhost:3000 Error: Request failed with status code 500
making HTTP(S) head request to  url:http://localhost:3000 ...

When I test it locally it works perfect?

@matart15
Copy link

matart15 commented May 27, 2021

same here. http://localhost:4100/graphql http://localhost:4100/ both throw error.
tried http-get and that failed too

but I can access it from browser. Also tcp succeeds

$ wait-on -t 300 -v http://localhost:4100/graphql
waiting for 1 resources: http://localhost:4100/graphql
making HTTP(S) head request to  url:http://localhost:4100/graphql ...
  HTTP(S) error for http://localhost:4100/graphql Error: Request failed with status code 500
making HTTP(S) head request to  url:http://localhost:4100/graphql ...
  HTTP(S) error for http://localhost:4100/graphql Error: Request failed with status code 500
wait-on(82273) Timed out waiting for: http://localhost:4100/graphql; exiting with error
$ wait-on -t 300 -v tcp:4100
waiting for 1 resources: tcp:4100
making TCP connection to 4100 ...
  TCP connection successful to host:localhost port:4100
wait-on(82530) complete
✨  Done in 0.67s.
done

@jeffbski
Copy link
Owner

jeffbski commented May 27, 2021 via email

@filipedeschamps
Copy link

Has anyone found any solution for this? I'm having the exact same problem and something strange is happening: it seems to work with 4.0.0 release, but not with 6.0.0.

@alumni
Copy link

alumni commented Dec 8, 2021

If you're using cypress, this sounds interesting: bahmutov/start-server-and-test#287 (comment)

@byhow
Copy link

byhow commented Dec 21, 2021

also having the same issue here, unable to wait-on the start in github actions. Maybe an issue with the github ci?

mifi added a commit to mifi/react-lottie-player that referenced this issue Dec 18, 2022
@mifi
Copy link

mifi commented Dec 18, 2022

For me this was related to ipv6. It also happens with other HTTP request node libraries. Node.js seems to resolve localhost:3000 to ::1:3001, but my server was running on ipv4 only. Solved by using 127.0.0.1:3000 instead of localhost:3000

@JoseGaldamez
Copy link

In my case, I wanted to run electron with a React App, then the script on package.js was "electron": "wait-on tcp:3000 && electron ." change for "electron": "wait-on http://127.0.0.1:3000 && electron ." fix the issue.

@joriswitteman
Copy link

joriswitteman commented May 8, 2023

Some people are having better luck in GitHub Actions with the IP 172.17.0.1

@janbrasna
Copy link

There is also related info in: cypress-io/github-action#802

For anyone having issues with Node 18 runners on GitHub Actions, try with Node 20 that has different defaults. At the same time GHA's IPv6 hosts/localhost configuration used to be quite specific, so you may end up having to use ip6-localhost to wait-on unambiguously even for ipv6-binding server.

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

10 participants