When license is expired Git push error is nil
When a customer's license has expired there are certain circumstances which can lead to the Gitlab::ExpiringSubscriptionMessage
being nil
. This is the message passed back to the Git client as part of the Gitlab::GitAccess::ForbiddenError
. When the message is nil
, the only error the client sees is the exception class itself.
There are dozens of places where GitLab raises Gitlab::GitAccess::ForbiddenError
. @cody, @dstanley and I debugged this issue with a customer in a call. It was extremely difficult to find the root cause since the error message was nil/generic.
We ultimately tracked it down to a blocked push because the license was expired. The license had expired on January 18, 2020. They thought they had uploaded a new license but did not.
- License is checked as part of
check_change_access!
. - The
license_message
is generated fromGitlab::ExpiringSubscriptionMessage
.
The piece here that is confusing is how much logic goes into the very first line of the Gitlab::ExpiringSubscriptionMessage#message
method. No matter what the case, for an expired license, we should show some message when we block a push.
Maybe the disconnect happens because this class is also used to decide whether we display a banner to users/admins in the UI. But we also didn't see a banner in the UI when signed in as an admin, either. So I think this is a bug affecting both pushes and the lack of banner in the UI when the license is expired.