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

Cargo Binstall breaks with Safing Portmaster running #1698

Open
RayJW opened this issue May 11, 2024 · 11 comments
Open

Cargo Binstall breaks with Safing Portmaster running #1698

RayJW opened this issue May 11, 2024 · 11 comments

Comments

@RayJW
Copy link

RayJW commented May 11, 2024

So, I'm first reporting this issue here, because I think it's a problem with Binstall rather than Portmaster. All other applications work fine, and I tried disabling all Portmaster options for Binstall. On top of that, Portmaster isn't reporting any blocked connections, so I think it's some weird behaviour with DNS resolving in Binstall because the error is a rate limit rather than only a timeout or a resolve failure.

I've confirmed this issue on a Fedora 40 machine and an Ubuntu 22.04 machine on Binstall version 1.6.6. Both immediately start to work once Portmaster is disabled. Here is a log from trying to install the onefetch create with Binstall.

❯ cargo-binstall onefetch --verbose
DEBUG using (/home/user/.local/share/cargo) as cargo home
DEBUG Using install path: /home/user/.local/share/cargo/bin
 WARN Failed to retrieve token from `gh auth token` err=Os { code: 2, kind: NotFound, message: "No such file or directory" }
 WARN Failed to read git credential file
 INFO resolve: Resolving package: 'onefetch'
DEBUG resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2587, tv_nsec: 937954728 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}: Downloading from: 'https://index.crates.io/config.json'
DEBUG resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2587, tv_nsec: 937954728 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}:do_send_request{self=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2587, tv_nsec: 937954728 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) request=Request { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/config.json", query: None, fragment: None }, headers: {} } url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/config.json", query: None, fragment: None }}: Using system DNS resolver configuration
DEBUG get_target_from_rustc()=Some("x86_64-unknown-linux-gnu")
DEBUG Running `/usr/lib64/x86_64-linux-gnu/ld-linux-x86-64.so.2 --version`: err=Os { code: 2, kind: NotFound, message: "No such file or directory" }
DEBUG Running `/lib/ld-linux-x86-64.so.2 --version`: err=Os { code: 2, kind: NotFound, message: "No such file or directory" }
DEBUG Running `/lib64/x86_64-linux-gnu/ld-linux-x86-64.so.2 --version`: err=Os { code: 2, kind: NotFound, message: "No such file or directory" }
DEBUG `/lib64/ld-linux-x86-64.so.2 --version`: status=exit status: 0, stdout='ld.so (Ubuntu GLIBC 2.35-0ubuntu3.7) stable release version 2.35.
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
', stderr=''
DEBUG resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2587, tv_nsec: 937954728 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}: Downloading from: 'https://index.crates.io/on/ef/onefetch'
DEBUG resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2587, tv_nsec: 937954728 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}:parse_manifest{client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2588, tv_nsec: 87819346 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" crate_url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None } version="2.21.0" cksum="a04da6eadacb92accc1c94a4641ea5f75b7f5aa0f11d33112f3e2fd04884d01d"}: Fetching crate from: https://static.crates.io/crates/onefetch/2.21.0/download and extracting Cargo.toml from it
DEBUG resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2587, tv_nsec: 937954728 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}:parse_manifest{client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2588, tv_nsec: 87819346 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" crate_url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None } version="2.21.0" cksum="a04da6eadacb92accc1c94a4641ea5f75b7f5aa0f11d33112f3e2fd04884d01d"}:and_visit_tar{self=Download { client: Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2588, tv_nsec: 87819346 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }), url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }, data_verifier: Some(PhantomData<&mut dyn binstalk_downloader::download::DataVerifier>) } fmt=Tgz}: Downloading from: 'https://static.crates.io/crates/onefetch/2.21.0/download'
 INFO resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2587, tv_nsec: 937954728 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}:parse_manifest{client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2588, tv_nsec: 87819346 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" crate_url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None } version="2.21.0" cksum="a04da6eadacb92accc1c94a4641ea5f75b7f5aa0f11d33112f3e2fd04884d01d"}:and_visit_tar{self=Download { client: Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2588, tv_nsec: 87819346 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }), url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }, data_verifier: Some(PhantomData<&mut dyn binstalk_downloader::download::DataVerifier>) } fmt=Tgz}:do_send_request{self=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2588, tv_nsec: 87819346 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) request=Request { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }, headers: {} } url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }}: Received timeout error from reqwest. Delay future request by 200ms
DEBUG resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2587, tv_nsec: 937954728 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}:parse_manifest{client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2588, tv_nsec: 87819346 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" crate_url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None } version="2.21.0" cksum="a04da6eadacb92accc1c94a4641ea5f75b7f5aa0f11d33112f3e2fd04884d01d"}:and_visit_tar{self=Download { client: Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2588, tv_nsec: 87819346 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }), url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }, data_verifier: Some(PhantomData<&mut dyn binstalk_downloader::download::DataVerifier>) } fmt=Tgz}:do_send_request{self=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 2588, tv_nsec: 198124737 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {"static.crates.io": Instant { tv_sec: 2619, tv_nsec: 432118961 }}, poisoned: false, .. } } }) request=Request { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }, headers: {} } url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }}: server-side rate limit exceeded; sleeping.

@NobodyXu
Copy link
Member

It receives timeout error when fetching https://static.crates.io/crates/onefetch/2.21.0/download, which is strange, because static.crates.io usually does not fail like this.

It doesn't look like a dns thing, rather it's related to the tcp connection between binstall and static.crates.io server

I suspect there's two possible causes:

  • static.crates.io has reached its maximum capacity, checking https://status.crates.io/ I can't find any incident report, so no large outage
  • maybe portmaster was analyzing the connection and took so long that it caused a timeout in binstall

@RayJW I suggest you re-running the command, to see that if you could reproduce that (reliably)

@RayJW
Copy link
Author

RayJW commented May 11, 2024

I was able to reproduce this issue for days over multiple packages, different networks, and different machines. I think is definitely Binstall related since turning off Portmaster results in immediate success.

@NobodyXu
Copy link
Member

Thanks, I suspect that it could be an issue related to reqwest or hyper.

I suggest you to try if you could reproducing this problem, by using

reqwest = { version = "0.12.4", features = [
    "http2",
    "stream",
    "zstd",
    "gzip",
    "brotli",
    "deflate",
    "rustls-tls",
    "rustls-tls-webpki-roots",
    "rustls-tls-native-roots",
], default-features = false }

hickory-resolver = { version = "0.24.0", features = [
    "dnssec-ring",
    "dns-over-rustls",
    "dns-over-https-rustls",
    "dns-over-quic",
    "dns-over-h3",
]
] }

[target."cfg(windows)".dependencies]
default-net = { version = "0.22.0", }
ipconfig = { version = "0.3.2", default-features = false }

For hickory-dns, we have some custom workarounds on windows.

Honestly, I don't think this is a hickory-dns issue, I think it's a reqwest or hyper issue and I think you can reproduce it without hickory-dns

@RayJW
Copy link
Author

RayJW commented May 11, 2024

I built the binary with the options you mentioned added to the binstalk-downloader Cargo.toml. I did however leave the optional = true in hickory-resolver because it wouldn't compile otherwise.

However the outcome looks mostly the same to me.

❯ ./target/release/cargo-binstall onefetch --verbose
DEBUG using (/home/user/.local/share/cargo) as cargo home
DEBUG Using install path: /home/user/.local/share/cargo/bin
 INFO resolve: Resolving package: 'onefetch'
DEBUG resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 468511283 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}: Downloading from: 'https://index.crates.io/config.json'
DEBUG resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 468511283 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}:do_send_request{self=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 468511283 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) request=Request { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/config.json", query: None, fragment: None }, headers: {} } url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/config.json", query: None, fragment: None }}: Using system DNS resolver configuration
DEBUG get_target_from_rustc()=Some("x86_64-unknown-linux-gnu")
DEBUG Running `/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 --version`: err=Os { code: 2, kind: NotFound, message: "No such file or directory" }
DEBUG Running `/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 --version`: err=Os { code: 2, kind: NotFound, message: "No such file or directory" }
DEBUG Running `/usr/lib64/x86_64-linux-gnu/ld-linux-x86-64.so.2 --version`: err=Os { code: 2, kind: NotFound, message: "No such file or directory" }
DEBUG Running `/lib64/x86_64-linux-gnu/ld-linux-x86-64.so.2 --version`: err=Os { code: 2, kind: NotFound, message: "No such file or directory" }
DEBUG `/lib64/ld-linux-x86-64.so.2 --version`: status=exit status: 0, stdout='ld.so (GNU libc) stable release version 2.39.
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
', stderr=''
DEBUG Running `/lib/ld-linux-x86-64.so.2 --version`: err=Os { code: 2, kind: NotFound, message: "No such file or directory" }
DEBUG resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 468511283 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}: Downloading from: 'https://index.crates.io/on/ef/onefetch'
DEBUG resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 468511283 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}:parse_manifest{client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 783376059 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" crate_url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None } version="2.21.0" cksum="a04da6eadacb92accc1c94a4641ea5f75b7f5aa0f11d33112f3e2fd04884d01d"}: Fetching crate from: https://static.crates.io/crates/onefetch/2.21.0/download and extracting Cargo.toml from it
DEBUG resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 468511283 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}:parse_manifest{client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 783376059 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" crate_url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None } version="2.21.0" cksum="a04da6eadacb92accc1c94a4641ea5f75b7f5aa0f11d33112f3e2fd04884d01d"}:and_visit_tar{self=Download { client: Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 783376059 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }), url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }, data_verifier: Some(PhantomData<&mut dyn binstalk_downloader::download::DataVerifier>) } fmt=Tgz}: Downloading from: 'https://static.crates.io/crates/onefetch/2.21.0/download'
 INFO resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 468511283 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}:parse_manifest{client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 783376059 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" crate_url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None } version="2.21.0" cksum="a04da6eadacb92accc1c94a4641ea5f75b7f5aa0f11d33112f3e2fd04884d01d"}:and_visit_tar{self=Download { client: Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 783376059 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }), url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }, data_verifier: Some(PhantomData<&mut dyn binstalk_downloader::download::DataVerifier>) } fmt=Tgz}:do_send_request{self=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 783376059 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) request=Request { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }, headers: {} } url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }}: Received timeout error from reqwest. Delay future request by 200ms
DEBUG resolve:fetch_crate_matched{self=SparseRegistry { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.crates.io")), port: None, path: "/", query: None, fragment: None }, dl_template: OnceCell { value: None } } client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 468511283 }, state: Ready { rem: 1 } }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" version_req=VersionReq { comparators: [] }}:parse_manifest{client=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 783376059 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }) crate_name="onefetch" crate_url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None } version="2.21.0" cksum="a04da6eadacb92accc1c94a4641ea5f75b7f5aa0f11d33112f3e2fd04884d01d"}:and_visit_tar{self=Download { client: Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1845, tv_nsec: 783376059 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {}, poisoned: false, .. } } }), url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }, data_verifier: Some(PhantomData<&mut dyn binstalk_downloader::download::DataVerifier>) } fmt=Tgz}:do_send_request{self=Client(Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, service: DelayRequest { inner: Mutex { data: Inner { client: Client { accepts: Accepts { gzip: true, brotli: true, zstd: true, deflate: true }, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*", "user-agent": "cargo-binstall/1.6.6"} }, num_request: 1, per: 10ms, until: Instant { tv_sec: 1846, tv_nsec: 747710565 }, state: Limited }, poisoned: false, .. }, hosts_to_delay: Mutex { data: {"static.crates.io": Instant { tv_sec: 1906, tv_nsec: 953534854 }}, poisoned: false, .. } } }) request=Request { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }, headers: {} } url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }}: server-side rate limit exceeded; sleeping.

@NobodyXu
Copy link
Member

sorry we have some misunderstanding, I'm suggesting that this could be a hyper/reqwest bug, and @RayJW I recommended you to create a new crate, with the reqwest dependency:

reqwest = { version = "0.12.4", features = [
    "http2",
    "stream",
    "zstd",
    "gzip",
    "brotli",
    "deflate",
    "rustls-tls",
    "rustls-tls-webpki-roots",
    "rustls-tls-native-roots",
], default-features = false }

and then use reqwest directly to download from https://static.crates.io/crates/onefetch/2.21.0/download , to see if you can reproduce this error.

The features I enabled is same as the default feature set of cargo-binstall.

@RayJW
Copy link
Author

RayJW commented May 15, 2024

sorry we have some misunderstanding, I'm suggesting that this could be a hyper/reqwest bug, and @RayJW I recommended you to create a new crate, with the reqwest dependency:

Sorry, currently my development experience with Rust is rather limited, and I use Binstall mostly to download CLI tools that are distributed with Cargo. Could you perhaps give me some more guidance what exactly you would want me to do?

@NobodyXu
Copy link
Member

@RayJW I've put up a cargo-script for you:

  • Install rust nightly using rustup: rustup toolchain add nightly
  • Copy the code below into a file reqwest.rs
  • chmod +x reqwest.rs
  • Run it: ./reqwest.rs

Please post the result of it here, I suspect there will be errors from reqwest

#!/usr/bin/env cargo +nightly -Zscript
---
[dependencies]
reqwest = { version = "0.12.4", features = [
    "http2",
    "stream",
    "zstd",
    "gzip",
    "brotli",
    "deflate",
    "rustls-tls",
    "rustls-tls-webpki-roots",
    "rustls-tls-native-roots",
], default-features = false }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
---

#[tokio::main]
async fn main() {
    reqwest::get("https://static.crates.io/crates/onefetch/2.21.0/download")
        .await
        .unwrap()
        .error_for_status()
        .unwrap()
        .bytes()
        .await
        .unwrap();
}

@RayJW
Copy link
Author

RayJW commented May 15, 2024

@NobodyXu I did have to add the -S option to the Shebang, otherwise it won't run extra flags.

It seems that actually works fine, the output looks like this:

warning: `package.edition` is unspecified, defaulting to `2021`
    Updating crates.io index
     Locking 141 packages to latest compatible versions
      Adding addr2line v0.21.0 (latest: v0.22.0)
      Adding gimli v0.28.1 (latest: v0.29.0)
      Adding hyper-rustls v0.26.0 (latest: v0.27.1)
      Adding object v0.32.2 (latest: v0.35.0)
      Adding rustls v0.22.4 (latest: v0.23.5)
      Adding sync_wrapper v0.1.2 (latest: v1.0.1)
      Adding tokio-rustls v0.25.0 (latest: v0.26.0)
      Adding wasi v0.11.0+wasi-snapshot-preview1 (latest: v0.13.0+wasi-0.2.0)
      Adding windows-sys v0.48.0 (latest: v0.52.0)
      Adding windows-targets v0.48.5 (latest: v0.52.5)
      Adding windows_aarch64_gnullvm v0.48.5 (latest: v0.52.5)
      Adding windows_aarch64_msvc v0.48.5 (latest: v0.52.5)
      Adding windows_i686_gnu v0.48.5 (latest: v0.52.5)
      Adding windows_i686_msvc v0.48.5 (latest: v0.52.5)
      Adding windows_x86_64_gnu v0.48.5 (latest: v0.52.5)
      Adding windows_x86_64_gnullvm v0.48.5 (latest: v0.52.5)
      Adding windows_x86_64_msvc v0.48.5 (latest: v0.52.5)
  Downloaded serde v1.0.202
  Downloaded 1 crate (77.7 KB) in 0.15s
   Compiling libc v0.2.154
   Compiling once_cell v1.19.0
   Compiling proc-macro2 v1.0.82
   Compiling unicode-ident v1.0.12
   Compiling pin-project-lite v0.2.14
   Compiling bytes v1.6.0
   Compiling futures-core v0.3.30
   Compiling cfg-if v1.0.0
   Compiling log v0.4.21
   Compiling itoa v1.0.11
   Compiling autocfg v1.3.0
   Compiling rustls-pki-types v1.7.0
   Compiling pkg-config v0.3.30
   Compiling fnv v1.0.7
   Compiling futures-task v0.3.30
   Compiling pin-utils v0.1.0
   Compiling httparse v1.8.0
   Compiling futures-sink v0.3.30
   Compiling spin v0.9.8
   Compiling hashbrown v0.14.5
   Compiling equivalent v1.0.1
   Compiling untrusted v0.9.0
   Compiling tinyvec_macros v0.1.1
   Compiling futures-util v0.3.30
   Compiling rustls v0.22.4
   Compiling try-lock v0.2.5
   Compiling crc32fast v1.4.0
   Compiling tracing-core v0.1.32
   Compiling alloc-no-stdlib v2.0.4
   Compiling zstd-safe v7.1.0
   Compiling tinyvec v1.6.0
   Compiling slab v0.4.9
   Compiling want v0.3.1
   Compiling futures-channel v0.3.30
   Compiling alloc-stdlib v0.2.2
   Compiling subtle v2.5.0
   Compiling smallvec v1.13.2
   Compiling tower-layer v0.3.2
   Compiling serde v1.0.202
   Compiling adler v1.0.2
   Compiling tower-service v0.3.2
   Compiling zeroize v1.7.0
   Compiling percent-encoding v2.3.1
   Compiling http v1.1.0
   Compiling brotli-decompressor v4.0.0
   Compiling miniz_oxide v0.7.2
   Compiling base64 v0.22.1
   Compiling unicode-bidi v0.3.15
   Compiling ryu v1.0.18
   Compiling memchr v2.7.2
   Compiling form_urlencoded v1.2.1
   Compiling openssl-probe v0.1.5
   Compiling tracing v0.1.40
   Compiling indexmap v2.2.6
   Compiling webpki-roots v0.26.1
   Compiling ipnet v2.9.0
   Compiling sync_wrapper v0.1.2
   Compiling quote v1.0.36
   Compiling jobserver v0.1.31
   Compiling mio v0.8.11
   Compiling socket2 v0.5.7
   Compiling num_cpus v1.16.0
   Compiling getrandom v0.2.15
   Compiling unicode-normalization v0.1.23
   Compiling flate2 v1.0.30
   Compiling syn v2.0.63
   Compiling cc v1.0.97
   Compiling rustls-pemfile v2.1.2
   Compiling mime v0.3.17
   Compiling http-body v1.0.0
   Compiling rustls-native-certs v0.7.0
   Compiling brotli v6.0.0
   Compiling http-body-util v0.1.1
   Compiling idna v0.5.0
   Compiling url v2.5.0
   Compiling ring v0.17.8
   Compiling zstd-sys v2.0.10+zstd.1.5.6
   Compiling serde_urlencoded v0.7.1
   Compiling tokio-macros v2.2.0
   Compiling pin-project-internal v1.1.5
   Compiling tokio v1.37.0
   Compiling pin-project v1.1.5
   Compiling rustls-webpki v0.102.3
   Compiling zstd v0.13.1
   Compiling tokio-util v0.7.11
   Compiling tower v0.4.13
   Compiling async-compression v0.4.10
   Compiling tokio-rustls v0.25.0
   Compiling h2 v0.4.4
   Compiling hyper v1.3.1
   Compiling hyper-util v0.1.3
   Compiling hyper-rustls v0.26.0
   Compiling reqwest v0.12.4
   Compiling reqwest v0.0.0 (/home/user/)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 25.35s
     Running `/home/user/.local/share/cargo/target/f6/8b7471f0481ce8/debug/reqwest`

@NobodyXu
Copy link
Member

Thanks, so the error didn't occur.

I wonder if the reqwest options we set in binstalk-downloader makes any difference, would update the script and post it here tomorrow.

@RayJW
Copy link
Author

RayJW commented May 15, 2024

I wonder if the reqwest options we set in binstalk-downloader makes any difference

So, I did change the script to the following:

#!/usr/bin/env -S cargo +nightly -Zscript
---
[dependencies]
reqwest = { version = "0.12.4", features = [
    "http2",
    "stream",
    "zstd",
    "gzip",
    "brotli",
    "deflate",
], default-features = false }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
---

#[tokio::main]
async fn main() {
    reqwest::get("https://static.crates.io/crates/onefetch/2.21.0/download")
        .await
        .unwrap()
        .error_for_status()
        .unwrap()
        .bytes()
        .await
        .unwrap();
}

which changes the output to this:

warning: `package.edition` is unspecified, defaulting to `2021`
   Compiling reqwest v0.12.4
   Compiling reqwest v0.0.0 (/home/user/)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.45s
     Running `/home/user/.local/share/cargo/target/f6/8b7471f0481ce8/debug/reqwest`
thread 'main' panicked at /home/user/.local/share/cargo/target/f6/8b7471f0481ce8/reqwest.rs:19:10:
called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("static.crates.io")), port: None, path: "/crates/onefetch/2.21.0/download", query: None, fragment: None }, source: Error { kind: Connect, source: Some("invalid URL, scheme is not http") } }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

However, the output looks the same when I disable Portmaster, so maybe this isn't the problem after all.

@passcod
Copy link
Member

passcod commented May 16, 2024

Yeah, that change just disabled HTTPS support entirely.

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

3 participants