-
Notifications
You must be signed in to change notification settings - Fork 351
Open
Labels
bugsomething isn't working as intendedsomething isn't working as intended
Description
Defect
Autorenew of Lets Encrypt fails.
Components
Traffic Ops
What did you do?
Autorenew Lets encrypt
What did you expect to happen?
Autorenewal of SSL Certs for all the relevants Delivery Services
What actually happened?
It failed with the following error
ERROR: autorenewcerts.go:186: 2024-06-24T17:48:51.293939Z: getting ssl keys for xmlId: dummy1 and version: 2 : could not begin Traffic Vault PostgreSQL transaction: context canceled: context canceled
ERROR: autorenewcerts.go:186: 2024-06-24T17:48:51.293978895Z: getting ssl keys for xmlId: dummy1 and version: 2 : could not begin Traffic Vault PostgreSQL transaction: context canceled: context canceled
Root Cause
Looks like this is because the Request handler renewCertificates does autorenew via goroutine with its context which gets cancelled once it returns.
Potential Fix
The following change appear to be working
Pass in db to RunAutorenewal from renewCertificates and in RunAutorenewal do the following
+ ctx, cancelCtx := context.WithTimeout(context.Background(), AcmeTimeout*time.Duration((totCerts)))
+ ctx = context.WithValue(ctx, api.DBContextKey, db)
+ defer cancelCtx()
Metadata
Metadata
Assignees
Labels
bugsomething isn't working as intendedsomething isn't working as intended