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

[ panic] isahc panicked at 'called Result::unwrap() on an Err #424

Open
txgj opened this issue Feb 1, 2023 · 6 comments
Open

[ panic] isahc panicked at 'called Result::unwrap() on an Err #424

txgj opened this issue Feb 1, 2023 · 6 comments

Comments

@txgj
Copy link

txgj commented Feb 1, 2023

thread 'isahc-agent-0' panicked at 'called Result::unwrap() on an Err value: Os { code: 1, kind: PermissionDenied, message: "..." }', /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/isahc-1.7.2/src/agent/mod.rs:548:68
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

@txgj
Copy link
Author

txgj commented Feb 1, 2023

cause:

self.selector.register(socket, readable, writable).unwrap();

code in fn register:

match result {
            Err(e) if is_bad_socket_error(&e) => {
                tracing::debug!(socket, error = ?e, "bad socket registered, will try again later");
                self.bad_sockets.insert(socket);
                Ok(())
            }
            result => result,
        }

@sagebind
Copy link
Owner

sagebind commented Feb 1, 2023

Thanks for filing an issue! I'll take a deeper look into this when I am able. At a cursory glance, the key part of this error is that the cause is an ErrorKind::PermissionDenied from the operating system. Off the top of my head the only reason why this error might occur is if your user doesn't have permission to open certain sockets.

Also, which operating system are you experiencing this error on? That might help lead me into the right direction.

@sagebind
Copy link
Owner

sagebind commented Feb 1, 2023

Could you share an example program that reproduces this problem? That would also be very helpful. You wouldn't happen to be using dial by chance, are you? Sometimes that can cause weird errors like this one if you supply invalid socket information, such as specifying an ordinary file path with the unix_socket option.

@txgj
Copy link
Author

txgj commented Feb 1, 2023

@sagebind Thank you very much!
The operating system is linux.
I just use isahc like this:

  let resp = self
            .client
            .put(&host)
            .headers(headers)
            .body(buf)
            .send()?;

This problem is sporadic. I run this on many machines and only one machine's application was crashed caused by this panic. Maybe at that point, something (such as network or hard disk) went wrong?

@men1n2
Copy link

men1n2 commented Feb 2, 2023

Hello,

I'm facing the same problem as @txgj when using isahc, with the same error message:

thread 'isahc-agent-0' panicked at 'called Result::unwrap() on an Err value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }', /usr/local/cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/isahc-1.7.2/src/agent/mod.rs:548:68

The application is using the isahc::client::HttpClient::send_async(request).await, and not trying to use dial or a custom path for a socket

The app is running on a container inside a k8s cluster, and the problem as @txgj mentioned is sporadic

Is there an investigation going on for this problem ?

Thanks :)

@sagebind
Copy link
Owner

sagebind commented Feb 3, 2023

@men1n2 This issue is the investigation. 😄 I cannot promise any sort of timeline for fixing this, but I will be looking into it over the next week or so to try and identify the problem. Right now I don't even know what the cause of this might be so it might be a little while before I can identify a fix.

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