You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please see the issue wait-on issues with Node.js 18 #811 for a better set of workarounds. The descriptions below were before I got into understanding the root cause better. I don't however want to delete the text in this issue even if it is no longer up to date. (Mar 2, 2023.)
The example-wait-on workflow fails on GitHub in some jobs waiting for localhost after the ubuntu-22.04 runner was migrated to use Node.js 18 as default. GitHub reports that the migration deployed on Feb 18, 2023 on the same date that example-wait-on began failing some of its test jobs. Other test jobs waiting for localhost succeed however.
The last successful run was on Feb 17, 2023 with ubuntu-22.04 image Version: 20230206.1 using the default Node.js 16.19.0.
The first failed run was on Feb 18, 2023 ubuntu-22.04 image Version: 20230217.1 using the default Node.js 18.14.1.
You can now view example-react-scripts in the browser.
Local: http://localhost:3000
On Your Network: http://10.1.0.40:3000
Note that the development build is not optimized.
To create a production build, use npm run build.
webpack compiled successfully
npm WARN exec The following package was not found and will be installed: wait-on@7.0.1
Error: Timed out waiting for: http://localhost:3000
at /home/runner/.npm/_npx/04d57496964ca6d1/node_modules/wait-on/lib/wait-on.js:132:31
with wait-on --verbose enabled it shows that wait-on is trying to connect to the IPv6 address ::1, however the react server is only listening on the IPv4 address 127.0.0.1:
npm WARN exec The following package was not found and will be installed: wait-on@7.0.1
waiting for 1 resources: http://localhost:3000
making HTTP(S) head request to url:http://localhost:3000 ...
HTTP(S) error for http://localhost:3000 Error: connect ECONNREFUSED ::1:3000
... ECONNREFUSED repeated multiple times
wait-on(1747) Timed out waiting for: http://localhost:3000; exiting with error
Error: Timed out waiting for: http://localhost:3000
wait-on-vite
working-directory: examples/wait-on-vitestart: npm run devwait-on: 'http://localhost:5173'
shows
waiting on "http://localhost:5173" with timeout of 60 seconds
/usr/local/bin/npm run dev
> example-wait-on-vite@2.0.0 dev
> vite
VITE v4.0.4 ready in 261 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
http://localhost:5173 timed out on retry 91 of 3, elapsed 90270ms, limit 90000ms
Error: connect ECONNREFUSED 127.0.0.1:5173
Run cat /etc/hosts
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
127.0.0.1 cpu-pool.com
127.0.0.1 MiningMadness.com
127.0.0.1 stratum-na.rplant.xyz
127.0.0.1 do-dear.com
127.0.0.1 web.do-dear.com
127.0.0.1 git.workflows.live
10.1.0.51 fv-az589-316.vc0434dfxmkevoezlasxvobd2h.cx.internal.cloudapp.net fv-az589-316
loopback
Run ip address show lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
Discussion
It is unclear why the wait-on step is causing problems using localhost on GitHub where Cypress manages to successfully test using localhost after the wait-on step when localhost has been substituted by a non-ambiguous alternative (see Workaround section below). Running Cypress tests locally succeeds. So the problem is only on GitHub.
A default installation of Ubuntu only assigns localhost to the ip4 address 127.0.0.1, not to the ip6 address ::1. GitHub however has ::1 localhost ip6-localhost ip6-loopback set up in addition.
Similar issues on GitHub have already been reported in:
The example-wait-on workflow uses different combinations of servers and wait-on providers to monitor the availability of a server on the network address localhost. Some succeed others fail.
IMPORTANT
The example-wait-on workflow fails on GitHub in some jobs waiting for
localhostafter the ubuntu-22.04 runner was migrated to use Node.js 18 as default. GitHub reports that the migration deployed on Feb 18, 2023 on the same date that example-wait-on began failing some of its test jobs. Other test jobs waiting forlocalhostsucceed however.Problem description
The workflow .github/workflows/example-wait-on.yml fails in jobs:
wait-using-custom-command-v9/wait-using-custom-commandwait-on-vite-v9/wait-on-viteThe last successful run was on Feb 17, 2023 with ubuntu-22.04 image Version: 20230206.1 using the default Node.js 16.19.0.
The first failed run was on Feb 18, 2023 ubuntu-22.04 image Version: 20230217.1 using the default Node.js 18.14.1.
See https://github.com/cypress-io/github-action/actions/workflows/example-wait-on.yml for workflow history.
wait-using-custom-command
shows
with wait-on --verbose enabled it shows that wait-on is trying to connect to the IPv6 address
::1, however the react server is only listening on the IPv4 address127.0.0.1:wait-on-vite
shows
Investigation
GitHub ubuntu-22.04 image Version: 20230217.1 is set up as follows:
/etc/hosts
loopback
Discussion
It is unclear why the wait-on step is causing problems using
localhoston GitHub where Cypress manages to successfully test usinglocalhostafter the wait-on step whenlocalhosthas been substituted by a non-ambiguous alternative (see Workaround section below). Running Cypress tests locally succeeds. So the problem is only on GitHub.A default installation of Ubuntu only assigns
localhostto the ip4 address127.0.0.1, not to the ip6 address::1. GitHub however has::1 localhost ip6-localhost ip6-loopbackset up in addition.Similar issues on GitHub have already been reported in:
The example-wait-on workflow uses different combinations of servers and wait-on providers to monitor the availability of a server on the network address
localhost. Some succeed others fail.Workarounds
Use specific localhost
wait-using-custom-commandreplacelocalhostby127.0.0.1and wait for http://127.0.0.1:3000wait-on-vitereplacelocalhostbyip6-localhostand wait for http://ip6-localhost:5173Tie tests to Node.js 16
Alternatively: If the failing tests are reverted to running under Node.js 16, then they succeed. Add the following:
Suggestion
Replace the generic term
localhostby a specific reference:127.0.0.1ip6-localhostfor these webserver which are not listening on both IP stacks.