Backport #19045
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>
@ -215,7 +215,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
@ -240,7 +240,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
@ -302,7 +302,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
@ -325,7 +325,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)