-
Notifications
You must be signed in to change notification settings - Fork 127
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-audit fails to fetch advisory database: "Could initialize the http client" #1029
Comments
The error message missing a "not" originates from the Once that's fixed it will at least start reporting the underlying problem correctly, so we will be able to debug it. |
The lack of detail is due to the One could add a custom printer to additionally follow the error chain via |
No change!
Given that I'm sure I am running the new code, this indicates that an error type involved isn't reporting a |
The error being printed here is a
Patching that, .map_err(|err| {
format_err!(
ErrorKind::Repo,
"failed to prepare fetch: {}",
display_error_chain::DisplayErrorChain::new(&err)
)
})? I get the following actual error:
According to info turned up from a web search, this is an error from So, the remaining task for |
In order to fix all the eager stringification (and the relevant one above) it'd be necessary to change this macro (semver breaking, and a hassle for all other error types using it), introduce a different macro that has an additional parameter, or introduce a method for inline augmentation ( I'm not sure what the best way to proceed is. I have a self-contained change that enhances |
Is that macro really public? It certainly does not appear in documentation. I don't see a Let's try transparently moving the source from the error being formatted to the parent one and see how far that gets us. I'd rather avoid inline augmentation because we'll just forget to use it half the time. |
No, it isn't. My mistake; when constructing my understanding of the situation I mixed up
That's not possible (without hacks like autoref specialization, or looking for arguments named (Note also that in order to avoid redundant and theoretically-exponentially-growing printing, it's important to ensure that any contained error value is either formatted in |
I think we'll need to rework (and semver-break) the We have these requirements:
|
The Re: |
I don't think this work is necessarily a semver break; it just needs to become a little more generic. This is what I did in my WIP: #[derive(Debug)]
pub struct Error {
kind: ErrorKind,
msg: String,
/// Error::source() returns this
source: Option<Box<dyn std::error::Error + Send + Sync>>,
} Basically a mini |
Oh, since the fields are private that's not even going to be semver-breaking. Yes, I'd love to have such a PR! |
Same issue here on macOS 10.15.7:
|
@bitfield that release of macOS is EOL |
I just decided to upgrade my
cargo-audit
fromv0.17.6
tov0.18.2
. The command then failed:I thought that perhaps there was a problem with the existing advisory-db, so I deleted ~/.cargo/advisory-db. Now it fails with:
cargo audit --no-fetch
succeeds, given a manually updatedadvisory-db
.cargo install --locked cargo-audit
did not make a difference to the behavior.I'm assuming this is a bug, but if it's some misconfiguration then it would be nice if the error message explained what to do about it (and wasn't missing a "not" after "Could").
The text was updated successfully, but these errors were encountered: