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

Connection problem #1

Closed
supng opened this issue Mar 9, 2021 · 8 comments
Closed

Connection problem #1

supng opened this issue Mar 9, 2021 · 8 comments
Assignees

Comments

@supng
Copy link

supng commented Mar 9, 2021

Thank you in advance for developing this tool.

Executing it gives me the following output:

thread 'main' panicked at 'called Result::unwrap() on an Err value: reqwest::Error { kind: Request, url: Url { scheme: "https", host: Some(Domain("www.archlinux.org")), port: None, path: "/mirrors/status/json/", query: None, fragment: None }, source: hyper::Error(Connect, ConnectError("dns error", Custom { kind: Other, error: "failed to lookup address information: Try again" })) }', src/mirrors.rs:140:10
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Doing a ping to www.archlinux.org I get this:

PING www.archlinux.org (95.217.163.246) 56(84) bytes of data.
64 bytes from 95.217.163.246: icmp_seq=1 ttl=46 time=61.5 ms
64 bytes from 95.217.163.246: icmp_seq=2 ttl=46 time=62.9 ms
64 bytes from 95.217.163.246: icmp_seq=3 ttl=46 time=58.7 ms
64 bytes from 95.217.163.246: icmp_seq=4 ttl=46 time=59.4 ms
64 bytes from 95.217.163.246: icmp_seq=5 ttl=46 time=60.2 ms
^C
--- www.archlinux.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4004ms
rtt min/avg/max/mdev = 58.710/60.515/62.859/1.496 ms

Unsure wheres the problem.

@westandskif
Copy link
Owner

Hi, supng!

Thank you for flagging this!
I'll investigate whether there is a room for improvement (adjusting dns lookup timeouts or sth) or there are any open DNS related issues in libraries in use.

While I'm looking into this, could you please let me know whether the issue persists or happens sporadically.

Thanks,
Nikita A

@supng
Copy link
Author

supng commented Mar 9, 2021

Yesterday was the first time I used rate-arch-mirrors and I got this problem.

I just tried it again and I got the same output.

Tell me if theres something I can do to help from my end. Glad to be helpful!

@westandskif
Copy link
Owner

Hi, supng!

I've failed to reproduce the issue, but what I've managed to do is to notice a significant slowdown in the step, you have issues with, when I tried enabling VPN.
I also read about rust-lang/rust#8925, which doesn't seem to be changed.

So, I've tried to enable trust-dns feature like this:

reqwest = { version = "0.11", features = ["json", "trust-dns"] }

to enable more sophisticated dns resolver.

If you want to avoid building yourself, please try the resulting binary:
https://drive.google.com/file/d/15e6jzvYh307p4HSdLh2fyVolSrLDJN5g/view?usp=sharing

Please, let me know whether this helps. Then I would release the update.

Thank you!
Nikita A

@westandskif westandskif self-assigned this Mar 14, 2021
@westandskif
Copy link
Owner

Supng, sorry for bothering:/
Have you had a chance to test the above on your environment?

@supng
Copy link
Author

supng commented Mar 18, 2021

Sorry for the delay, I havent been able to check it.

Using the new binary with full backtrace:

$ RUST_BACKTRACE=full ./rate_arch_mirrors
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Request, url: Url { scheme: "https", host: Some(Domain("www.archlinux.org")), port: None, path: "/mirrors/status/json/", query: None, fragment: None }, source: hyper::Error(Connect, ConnectError("dns error", ResolveError { kind: Message("No connections available") })) }', src/mirrors.rs:140:10
stack backtrace:
   0:     0x7fb05e8c89f0 - <unknown>
   1:     0x7fb05e90453c - <unknown>
   2:     0x7fb05e8c1a82 - <unknown>
   3:     0x7fb05e8cac25 - <unknown>
   4:     0x7fb05e8ca6d3 - <unknown>
   5:     0x7fb05e8cb3c1 - <unknown>
   6:     0x7fb05e8caf07 - <unknown>
   7:     0x7fb05e8c8e8c - <unknown>
   8:     0x7fb05e8cae69 - <unknown>
   9:     0x7fb05e902c51 - <unknown>
  10:     0x7fb05e902a73 - <unknown>
  11:     0x7fb05e4effd8 - <unknown>
  12:     0x7fb05e4c2d9e - <unknown>
  13:     0x7fb05e3c64c6 - <unknown>
  14:     0x7fb05e3c64dd - <unknown>
  15:     0x7fb05e8cb839 - <unknown>
  16:     0x7fb05e4c34e5 - <unknown>

Ping still works, and the system does DNS normally.

@westandskif
Copy link
Owner

Thank you!
This time the error says No connections available, at least something different :)

Two questions:

  1. What is in your /etc/resolv.conf?
  2. Do you experience issues with both variants?
    https://aur.archlinux.org/packages/rate-arch-mirrors/ - dynamically linked glibc
    https://aur.archlinux.org/packages/rate-arch-mirrors-bin/ - statically linked musl

@supng
Copy link
Author

supng commented Mar 19, 2021

  1. Is empty, only two commented lines describing the file.
  2. I just tried compiling myself (doing yay rate-arch-mirrors instead of yay rate-arch-mirrors-bin), I was actually using the binaries all along. Compiling worked! What a pleasant surprise.

My issue is fixed, but if you want to keep investigating why it wasnt working before I would be glad to do more testing for you. Thanks again! <3

@westandskif
Copy link
Owner

That's great! :)
Thank you and let's close this for now (looks like the issue was due to differences between musl and glibc name resolution and the way these work with empty resolv.conf)

@westandskif westandskif mentioned this issue May 23, 2021
Closed
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

2 participants