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

x/crypto/acme: Retry on LetsEncrypt rate limit #40161

Open
leesjensen opened this issue Jul 10, 2020 · 4 comments
Open

x/crypto/acme: Retry on LetsEncrypt rate limit #40161

leesjensen opened this issue Jul 10, 2020 · 4 comments

Comments

@leesjensen
Copy link

@leesjensen leesjensen commented Jul 10, 2020

What version of Go are you using?

go version go1.14 darwin/amd64

What did you do?

I called acme.Client.AuthorizeOrder when the renewal rate limit for the desired domain has been exceeded.

See: https://letsencrypt.org/docs/rate-limits/

What did you expect to see?

I expected the call to fail quickly and return the rate limit error. There is no value in retrying for a rate limit failure.

What did you see instead?

The acme HTTP client code will retry for 429 errors.

acme/http.go

func isRetriable(code int) bool {
	return code <= 399 || code >= 500 || code == http.StatusTooManyRequests
}

In the case of a LetsEncrypt rate violation LetsEncrypt returns 429. For example:

429 urn:ietf:params:acme:error:rateLimited: Error creating new order :: too many certificates already issued for exact set of domains: example.com: see https://letsencrypt.org/docs/rate-limits/

This results in the retry code executing until the context timeout is reached. If the context has no timeout then the code will make calls to LetsEncrypt forever.

@gopherbot gopherbot added this to the Unreleased milestone Jul 10, 2020
@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Jul 11, 2020

@x1ddos
Copy link

@x1ddos x1ddos commented Jul 11, 2020

This results in the retry code executing until the context timeout is reached. If the context has no timeout then the code will make calls to LetsEncrypt forever.

Could've not defined "working as intended" more precise than that.

@FiloSottile
Copy link
Contributor

@FiloSottile FiloSottile commented Jul 13, 2020

This results in the retry code executing until the context timeout is reached. If the context has no timeout then the code will make calls to LetsEncrypt forever.

Could've not defined "working as intended" more precise than that.

If you think this is working as intended, please elaborate. This is a weekly rate-limit, so it's not obvious the code should keep trying for a week rather than inform the operator.

With a timeout, is the returned error the rate-limit one, or a generic timeout one?

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 24, 2020

Change https://golang.org/cl/272927 mentions this issue: x/crypto/acme: only retry GET requests on 429

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants