Yet another issue has come up where the logging from SyncMirrors does not provide
enough context. This PR adds more context to these logging events.
Related #19038
Signed-off-by: Andrew Thornton <art27@cantab.net>
@ -225,7 +225,7 @@ func runSync(ctx context.Context, m *repo_model.Mirror) ([]*mirrorSyncResult, bo
// Now check if the error is a resolve reference due to broken reference
ifstrings.Contains(stderr,"unable to resolve reference")&&strings.Contains(stderr,"reference broken"){
log.Warn("Failed to update mirror repository %-v due to broken references:\nStdout: %s\nStderr: %s\nErr: %v\nAttempting Prune",m.Repo,stdoutMessage,stderrMessage,err)
log.Warn("SyncMirrors [repo: %-v]: failed to update mirror repository due to broken references:\nStdout: %s\nStderr: %s\nErr: %v\nAttempting Prune",m.Repo,stdoutMessage,stderrMessage,err)
err=nil
// Attempt prune
@ -255,7 +255,7 @@ func runSync(ctx context.Context, m *repo_model.Mirror) ([]*mirrorSyncResult, bo
// If there is still an error (or there always was an error)
iferr!=nil{
log.Error("Failed to update mirror repository %-v:\nStdout: %s\nStderr: %s\nErr: %v",m.Repo,stdoutMessage,stderrMessage,err)
log.Error("SyncMirrors [repo: %-v Wiki]: unable to get GetRemoteAddress Error %v",m.Repo,remoteErr)
}
// sanitize the output, since it may contain the remote address, which may
@ -322,7 +322,7 @@ func runSync(ctx context.Context, m *repo_model.Mirror) ([]*mirrorSyncResult, bo
// Now check if the error is a resolve reference due to broken reference
ifstrings.Contains(stderrMessage,"unable to resolve reference")&&strings.Contains(stderrMessage,"reference broken"){
log.Warn("Failed to update mirror wiki repository %-v due to broken references:\nStdout: %s\nStderr: %s\nErr: %v\nAttempting Prune",m.Repo,stdoutMessage,stderrMessage,err)
log.Warn("SyncMirrors [repo: %-v Wiki]: failed to update mirror wiki repository due to broken references:\nStdout: %s\nStderr: %s\nErr: %v\nAttempting Prune",m.Repo,stdoutMessage,stderrMessage,err)
err=nil
// Attempt prune
@ -350,7 +350,7 @@ func runSync(ctx context.Context, m *repo_model.Mirror) ([]*mirrorSyncResult, bo
// If there is still an error (or there always was an error)
iferr!=nil{
log.Error("Failed to update mirror repository wiki %-v:\nStdout: %s\nStderr: %s\nErr: %v",m.Repo,stdoutMessage,stderrMessage,err)