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

fix: don't retry if a transport error is caused by "no native certs f… #2129

Merged

Conversation

leruaa
Copy link
Contributor

@leruaa leruaa commented Mar 5, 2025

…ound"

Motivation

When proving on the prover network on an environment where the ca-certificates package is missing, the error returned contains "transport error" and is considered as a transient error, so we uselessly retry:

WARN Transient transport error when getting program: transport error, retrying...    
WARN Transient transport error when getting program: transport error, retrying...    
WARN Transient transport error when getting program: transport error, retrying...    
WARN Transient transport error when getting program: transport error, retrying...    
WARN Transient transport error when getting program: transport error, retrying...    
WARN Transient transport error when getting program: transport error, retrying...    
WARN Transient transport error when getting program: transport error, retrying...    
WARN Transient transport error when getting program: transport error, retrying...    
WARN Transient transport error when getting program: transport error, retrying...    
WARN Transient transport error when getting program: transport error, retrying...    
WARN Transient transport error when getting program: transport error, retrying...

thread 'main' panicked at src/main.rs:18:49:
called `Result::unwrap()` on an `Err` value: transport error

Caused by:
    no native certs found

Closes #2075

Solution

When the error is caused by "no native certs found", don't retry and return a permanent error:

ERROR Permanent error when getting program: no native certs found    

thread 'main' panicked at src/main.rs:18:49:
called `Result::unwrap()` on an `Err` value: transport error

Caused by:
    no native certs found

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@ratankaliani ratankaliani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a more type-safe way to handle this with an enum that returns the NoNativeCertsFound error?

I would prefer doing that, rather than parsing the string (which can change).

@leruaa
Copy link
Contributor Author

leruaa commented Mar 6, 2025

I don't think we can, TlsError is not public.

@ratankaliani
Copy link
Member

Made a PR to tonic: hyperium/tonic#2209.

Can you update your PR description to be more clear? Can you add a TODO that we can parse this with the TlsError type once a new version with that Tonic PR is merged?

Copy link
Member

@ratankaliani ratankaliani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once you've tested on an Ubuntu machine without ca-certificates.

@leruaa leruaa merged commit 9f202bf into dev Mar 6, 2025
13 checks passed
@leruaa leruaa deleted the aurelien/gro2-258-dont-retry-when-native-certs-are-not-present branch March 6, 2025 21:10
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

Successfully merging this pull request may close these issues.

SDK network prover client can be constructed Ok, but all requests eventually fails without libcurl
2 participants