-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
IPv6 used for cypress backendUrl connection check #27962
Comments
There were a lot of similar issues caused by Node.js in the migration from Node.js I put some workarounds for this on https://github.com/cypress-io/github-action#wait-on-with-nodejs-18 GitHub Actions. Although this is not what you're using, it may be helpful.
The root cause is that some dev servers don't respond on both IPv4 and IPv6 stacks as they should do. It's not a Cypress bug. |
Well - if I do have a server which supports only one stack, I think it is inconsistent behaviour that cypress will fail the connection check but run all the test happily. Either all fails, or all works. But a mix is not good IMHO. But thanks for the material to read :) |
Which version of Angular are you using? I'd like to cross-check as I have a couple of test suites set up for related issues. |
@MikeMcC399 in that case latest 16.2.4 - I noticed the issue when testing the update. Interestingly it worked a few weeks ago, however I suspect an OS update, or a change in resolution behavior etc. way more than a change in Angular itself. Node.js version was and has been since it was last working always unchanged... |
According to https://angular.io/guide/versions Angular |
I also have to withdraw the suggestion of using I can't reproduce your issue on an out-of-the-box Fedora Angular Since I can't reproduce it, it's difficult to give reliable suggestions, however here are a couple of things you could try: export NODE_OPTIONS=--dns-result-order=ipv4first See https://nodejs.org/dist/latest-v18.x/docs/api/all.html#all_cli_--dns-result-orderorder Set your Add an entry to
|
@MikeMcC399 thanks for the suggestions. I had to add the This is "OK" for me now, however it is still inconsistent behavior IMHO if (and I don't know if this is the case always) one part of cypress/browser uses v4 and one v6 only to connect to the backend. Not sure what triggered the problem for me though, but it was easily reproducible on my fedora ... Hmm. |
It's good to see that you have a working setup now. If you say it is OK for you now, then I suggest to close this issue even though it has not been fully investigated. Generally DNS and Node.js services translate the hostname |
Fine with me. Then it serves as documentation of the issue at least :) |
In that case, would you like to click on the Close button? You should be able to see this since you are the issue Author. I can't close issues, since I'm just a community Contributor without any special privileges. |
Sure thing :) |
#25397 is a similar issue but still open. |
I'm running cypress in macOS with node18, and doing the above helped my case. |
@MikeMcC399 gave a good clue on how to resolve it, thanks. (#27962 (comment))
Our team had this ipv6 issue only present on pipelines (Docker image cypress/included run on Kubernetes). This might be specific to our cypress pipelines and config, but we decided to keep |
my use case is that i typically run on Windows connected to a Linux box over VSCode SSH. VSCode SSH nicely sets up tunnels but only over ipv4. for whatever reason cypress binds ipv6 on localhost, thereby resulting in the effect of not being able to discover any servers you run on remote and tunnel to over ipv4. |
Still noticing this problem on version 13.6.6, on different versions of OSX (15, 14). The actual error is that any port other than :3000 gives an empty response. The workaround |
Current behavior
Cypress seems to use IPv6 to perform the connections check, which makes it fail in my setup.
We're launching the backend (angular) using
ng serve --host 0.0.0.0
, then asserting that the backend indeed is reachable. The run cypress. It will issue the connection check warning in case of headed, and additionally fail in case of headless. In headed mode if I ignore the warning and start a test, everything works perfectly.I tried many things to fix the issue, and discovered that removing the
::1
mapping from /etc/hosts will make things work again. However this is not a fix, but merely a workaround.Desired behavior
The connection check should correctly detect my server is running.
Test code to reproduce
have a machine where
localhost
resolves to::1
. Run a backend (e.g. angular) using--host 0.0.0.0
, which seems to bind to IPv4 only. Run cypress.Cypress Version
13.3.0
Node version
v18.17.0
Operating System
Fedora release 38 (Thirty Eight) - 6.5.5-200.fc38.x86_64
Debug Logs
Other
No response
The text was updated successfully, but these errors were encountered: