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
Modify the ACME renewing logs level #2520
Modify the ACME renewing logs level #2520
Conversation
@@ -448,7 +477,7 @@ func dnsOverrideDelay(delay int) error { | |||
return true, nil | |||
} | |||
} else if delay < 0 { | |||
err = fmt.Errorf("Invalid negative DelayDontCheckDNS: %d", delay) | |||
err = fmt.Errorf("invalid negative DelayDontCheckDNS: %d", delay) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come some of these messages start with a capital letter, and others don't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
acme/acme.go
Outdated
} | ||
log.Infof("Commit Certificate %+v renewed in data store", certificateResource.Domains) | ||
if err = transaction.Commit(account); err != nil { | ||
return fmt.Errorf("error Saving ACME account %+v: %s", account, err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Errorf("error Saving ACME account %+v: %v", account, err)
acme/acme.go
Outdated
|
||
if err = transaction.Commit(account); err != nil { | ||
log.Errorf("Error Saving ACME account %+v: %s", account, err.Error()) | ||
log.Errorf("datastore cannot sync: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you starts with a upper-case letter.
acme/acme.go
Outdated
PrivateKey: certificateResource.Certificate.PrivateKey, | ||
Certificate: certificateResource.Certificate.Certificate, | ||
}, true, OSCPMustStaple) | ||
log.Infof("Renewing certificate %+v from LE", certificateResource.Domains) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.Infof("Renewing certificate from LE: %+v", certificateResource.Domains)
acme/acme.go
Outdated
if err != nil { | ||
log.Errorf("Error renewing certificate: %v", err) | ||
log.Errorf("Error renewing from LE certificate: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.Errorf("Error renewing certificate from LE: %v", err)
acme/acme.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
log.Infof("Renewed certificate %+v from LE", certificateResource.Domains) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.Infof("Renewed certificate from LE: %+v", certificateResource.Domains)
acme/acme.go
Outdated
return fmt.Errorf("Error during transaction initialization for renewing certificate: %v", err) | ||
} | ||
account = object.(*Account) | ||
log.Infof("Renewing certificate %+v in data store", certificateResource.Domains) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.Infof("Renewing certificate in data store: %+v", certificateResource.Domains)
acme/acme.go
Outdated
log.Infof("Renewing certificate %+v in data store", certificateResource.Domains) | ||
err = account.DomainsCertificate.renewCertificates(renewedACMECert, certificateResource.Domains) | ||
if err != nil { | ||
return fmt.Errorf("error renewing certificate: %v in datastore", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("error renewing certificate in datastore: %v", err)
acme/acme.go
Outdated
oldAccount := a.store.Get().(*Account) | ||
for _, oldCertificateResource := range oldAccount.DomainsCertificate.Certs { | ||
if oldCertificateResource.Domains.Main == certificateResource.Domains.Main && strings.Join(oldCertificateResource.Domains.SANs, ",") == strings.Join(certificateResource.Domains.SANs, ",") && certificateResource.Certificate != renewedACMECert { | ||
return fmt.Errorf("renewed certificate %+v not stored", certificateResource.Domains) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("renewed certificate not stored: %+v", certificateResource.Domains)
acme/acme.go
Outdated
return fmt.Errorf("renewed certificate %+v not stored", certificateResource.Domains) | ||
} | ||
} | ||
log.Infof("Certificate %+v successfully renewed in data store", certificateResource.Domains) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.Infof("Certificate successfully renewed in data store: %+v", certificateResource.Domains)
acme/acme.go
Outdated
if err != nil { | ||
return fmt.Errorf("Error during transaction initialization for renewing certificate: %v", err) | ||
} | ||
account = object.(*Account) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add blank lines in this function to aerate the code.
c85099d
to
b6095de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
b6095de
to
0681fe5
Compare
What does this PR do?
This PR transforms the
DEBUG
logs generated during the ACME certificates renewing intoINFO
logs in the way to get more information about the process without getting all the othersDEBUG
logs.Motivation
Related #2158 and slack support about this subject.
Additional Notes
This PR does not solve the problem but allows getting more information about it.
It seems to be a concurrent access problem.
A test is currently running in the way to repoduce the problem on a long period.