Skip to content

fix(api/errcode): propagate 503 Service Unavailable status thrown by CGS

João Pereira requested to merge 503-status-gcs into master

So far these were being treated as unknown errors and therefore leading to a 500 Internal Server Error response. For correctness, we should propagate a status unavailable response from a service that we depend on to serve a given request. This change is an attempt to fix that.

These events can be seen in Sentry: https://sentry.gitlab.net/gitlab/container-registry/issues/2446060/?environment=gprd

The error message has the format googleapi: got HTTP response code 503 with body: Service Unavailable. Looking at the google SDK code, we can see these come from here. The error Code is said to be always populated. This MR takes advantage of that to capture these errors when possible.

Related to &6348.

Merge request reports