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
NoRouteToHostException when making a request to https url from a zio-http Client using Scala 3 #2280
Comments
I've actually the 'flaky' situation, my test calls 3 different https endpoints and if I run the test multiple times it can either be succesfull, or any of the 3 calls can fail with NoRouteToHost. |
/bounty $100 |
💎 $100 bounty • ZIOSteps to solve:
Thank you for contributing to zio/zio-http! Add a bounty • Share on socials
|
The cause of this issue was for me, that I had no IPv6 support on my router. ( I.e. setting -Djava.net.preferIPv4Stack=true fixed the issue ). |
@sky0hunter it seems that this flag really solves the issue for me at least 🎆 |
Should we default to IPv4 in this case? I had similar problems with this even with the "http".
We could make a IPv4 as default and then have an option to enable IPv6. |
I tried with the flag mentioned but still I see HTTP client trying to connect using IPv6 Any way to setup with ClientConfig directly inside ZIO? I'm talking on something like this part: val sslConfig = ClientSSLConfig.Default
val clientConfig = ZClient.Config.default.ssl(sslConfig) ... but including an option like |
/attempt #2280 Lol I'm trying to optimize another issue but this stands in the way... So I'll do it too! Options |
Currently, there are cases where users cannot use IPv6 due to their network infrastructure not supporting it. Therefore, we should not resolve hostnames to IPv6 addresses unless told otherwise. This commit defaults DNS queries to IPv4-only. It also allows users to resolve IPv6 addresses by setting the system property `java.net.preferIPv6Addresses`. /claim zio#2280 Reference: https://docs.oracle.com/javase/8/docs/technotes/guides/net/ipv6_guide/
I don't know why the flag is not working on SBT but I added this into my main scala file and I at least the issue is not happening anymore. java.lang.System.setProperty("java.net.preferIPv4Stack", "true") |
Currently, there are cases where users cannot use IPv6 due to their network infrastructure not supporting it. Therefore, we should not resolve hostnames to IPv6 addresses unless told otherwise. This commit defaults DNS queries to IPv4-only. It also allows users to resolve IPv6 addresses by setting the system property `java.net.preferIPv6Addresses`. /claim zio#2280 Reference: https://docs.oracle.com/javase/8/docs/technotes/guides/net/ipv6_guide/
Currently, there are cases where users cannot use IPv6 due to their network infrastructure not supporting it. Therefore, we should not resolve hostnames to IPv6 addresses unless told otherwise. This commit defaults DNS queries to IPv4-only. It also allows users to resolve IPv6 addresses by setting the system property `java.net.preferIPv6Addresses`. /claim zio#2280 Reference: https://docs.oracle.com/javase/8/docs/technotes/guides/net/ipv6_guide/
Currently, there are cases where users cannot use IPv6 due to their network infrastructure not supporting it. Therefore, we should not resolve hostnames to IPv6 addresses unless told otherwise. This commit defaults DNS queries to IPv4-only. It also allows users to resolve IPv6 addresses by setting the system property `java.net.preferIPv6Addresses`. /claim zio#2280 Reference: https://docs.oracle.com/javase/8/docs/technotes/guides/net/ipv6_guide/
Currently, there are cases where users cannot use IPv6 due to their network infrastructure not supporting it. Therefore, we should not resolve hostnames to IPv6 addresses unless told otherwise. This commit defaults DNS queries to IPv4-only. It also allows users to resolve IPv6 addresses by setting the system property `java.net.preferIPv6Addresses`. /claim zio#2280 Reference: https://docs.oracle.com/javase/8/docs/technotes/guides/net/ipv6_guide/
Currently, there are cases where users cannot use IPv6 due to their network infrastructure not supporting it. Therefore, we should not resolve hostnames to IPv6 addresses unless told otherwise. This commit defaults DNS queries to IPv4-only. It also allows users to resolve IPv6 addresses by setting the system property `java.net.preferIPv6Addresses`. /claim zio#2280 Reference: https://docs.oracle.com/javase/8/docs/technotes/guides/net/ipv6_guide/
Currently, there are cases where users cannot use IPv6 due to their network infrastructure not supporting it. Therefore, we should not resolve hostnames to IPv6 addresses unless told otherwise. This commit defaults DNS queries to IPv4-only. It also allows users to resolve IPv6 addresses by setting the DnsResolver configuration. Also only use IPv6 when configured, do not mix IPv4 unless there is no IPv6 addresses. /claim zio#2280 Reference: https://docs.oracle.com/javase/8/docs/technotes/guides/net/ipv6_guide/
Currently, there are cases where users cannot use IPv6 due to their network infrastructure not supporting it. Therefore, we should not resolve hostnames to IPv6 addresses unless told otherwise. This commit defaults DNS queries to IPv4-only. It also allows users to resolve IPv6 addresses by setting the DnsResolver configuration. Also only use IPv6 when configured, do not mix IPv4 unless there is no IPv6 addresses. /claim zio#2280 Reference: https://docs.oracle.com/javase/8/docs/technotes/guides/net/ipv6_guide/ Co-authored-by: John A. De Goes <john@degoes.net>
Currently, there are cases where users cannot use IPv6 due to their network infrastructure not supporting it. Therefore, we should not resolve hostnames to IPv6 addresses unless told otherwise. This commit defaults DNS queries to IPv4-only. It also allows users to resolve IPv6 addresses by setting the DnsResolver configuration. Also use exclusively either IPv4 or IPv6, do not mix address families. /claim zio#2280 Reference: https://docs.oracle.com/javase/8/docs/technotes/guides/net/ipv6_guide/ Co-authored-by: John A. De Goes <john@degoes.net>
If it helps to know it, I was intermittently seeing the same error message when using:
and the property settings shown in this issue resolved the problem. |
More information about this error:
The property settings:
Just makes it fail with another error:
|
I am getting weird error when making a request towards any https website when executing unit test (
sbt test
), however I don't get the same error when running my application (sbt run
). I use zio 2.0.15, scala 3.3.0, zio-http 3.0.0-rc2, sbt 1.9.0 and Java 11.0.19.Here is the code that you can use to reproduce the issue:
The error I get is
I have noticed that there is a unit test called ClientHttpsSpec that has been set as
ignored
for the past 2 years and I believe that it might shed more light of the issue #716The text was updated successfully, but these errors were encountered: