As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit b8a1bb4a authored by Igor Drozdov's avatar Igor Drozdov
Browse files

Merge branch 'sh-ignore-not-our-ref-errors' into 'main'

Ignore "not our ref" errors from gitlab-sshd error metrics

See merge request gitlab-org/gitlab-shell!656
parents 5085fe78 b5de4796
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -21,7 +21,10 @@ import (
"gitlab.com/gitlab-org/labkit/log"
)
const KeepAliveMsg = "keepalive@openssh.com"
const (
KeepAliveMsg = "keepalive@openssh.com"
NotOurRefError = `exit status 128, stderr: "fatal: git upload-pack: not our ref `
)
var EOFTimeout = 10 * time.Second
Loading
Loading
@@ -173,6 +176,8 @@ func (c *connection) trackError(ctxlog *logrus.Entry, err error) {
grpcCode := grpcstatus.Code(err)
if grpcCode == grpccodes.Canceled || grpcCode == grpccodes.Unavailable {
return
} else if grpcCode == grpccodes.Internal && strings.Contains(err.Error(), NotOurRefError) {
return
}
metrics.SliSshdSessionsErrorsTotal.Inc()
Loading
Loading
Loading
Loading
@@ -221,6 +221,7 @@ func TestSessionsMetrics(t *testing.T) {
{"unavailable Gitaly", grpcstatus.Error(grpccodes.Unavailable, "unavailable")},
{"api error", &client.ApiError{"api error"}},
{"disallowed command", disallowedcommand.Error},
{"not our ref", grpcstatus.Error(grpccodes.Internal, `rpc error: code = Internal desc = cmd wait: exit status 128, stderr: "fatal: git upload-pack: not our ref 9106d18f6a1b8022f6517f479696f3e3ea5e68c1"`)},
} {
t.Run(ignoredError.desc, func(t *testing.T) {
conn, chans = setup(1, newChannel)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment