diff --git a/changelogs/unreleased/avar-log-update-ref-errors.yml b/changelogs/unreleased/avar-log-update-ref-errors.yml new file mode 100644 index 0000000000000000000000000000000000000000..6d206b1658b74a6ce0a64da270b231a05488f294 --- /dev/null +++ b/changelogs/unreleased/avar-log-update-ref-errors.yml @@ -0,0 +1,5 @@ +--- +title: 'Operations: log failed update-ref commands' +merge_request: 3044 +author: +type: fixed diff --git a/internal/gitaly/service/operations/update_with_hooks.go b/internal/gitaly/service/operations/update_with_hooks.go index 2e2ce16e356082b09f2c22ec7d5908b3d9da9896..603fe4ee116ad84d98c51f30a8b9d1ebf5a0ba83 100644 --- a/internal/gitaly/service/operations/update_with_hooks.go +++ b/internal/gitaly/service/operations/update_with_hooks.go @@ -7,6 +7,7 @@ import ( "fmt" "strings" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/updateref" "gitlab.com/gitlab-org/gitaly/internal/gitaly/hook" @@ -93,11 +94,14 @@ func (s *Server) updateReferenceWithHooks(ctx context.Context, repo *gitalypb.Re return err } - if err := updater.Update(git.ReferenceName(reference), newrev, oldrev); err != nil { + referenceName := git.ReferenceName(reference) + if err := updater.Update(referenceName, newrev, oldrev); err != nil { + ctxlogrus.Extract(ctx).WithError(err).Errorf("'git update-ref' in %v failed with args (%v, %v, %v)", repo.GetGlProjectPath(), referenceName, newrev, oldrev) return err } if err := updater.Wait(); err != nil { + ctxlogrus.Extract(ctx).WithError(err).Errorf("'git update-ref' in %v failed on exit", repo.GetGlProjectPath()) return updateRefError{reference: reference} }