Repository navigation
api: explain tls handshake failures when adding r2 buckets - #14
Merged
Merged
Conversation
A newly enabled Cloudflare R2 account can reject TLS handshakes for a few minutes while its endpoint certificate is not yet served. Adding a bucket then failed with a raw "remote error: tls: handshake failure", and retrying a little later worked. That specific alert now maps to an invalid-input error. The error tells the user to check the endpoint URL and, for a new R2 account, to try again shortly. Other TLS alerts and connection errors still return the generic message. The S3 storage docs mention the delay too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes UNB-371.
For the first few minutes after Cloudflare R2 is turned on, the account's endpoint can reject TLS handshakes because its certificate isn't being served yet. During that window, adding a bucket failed with a raw
remote error: tls: handshake failure, and the same request worked a few minutes later. That's why it seemed to work on the third try.mapS3Errornow spots that exact TLS alert and returns an invalid-input error. The message tells the user to check the endpoint URL and, for a new R2 account, to try again shortly.Tests