Commit Tracking not working on Gitlab Integration

Hi,
I have followed the Gitlab integration steps and successfully connected my on-premise Gitlab to my on-premise Sentry. I have added the repository to Sentry.

Issue tracking work Ok and I can see list of Sentry issues on Gitlab, but commit tracking does not work it shows Hook executed successfully but returned HTTP 400 on a Push-Event
and from the Sentry_web logs I can see
[INFO] sentry.webhooks: gitlab.webhook.invalid-token (token=u'178.62.21.xx:xx:8:c583axxxxxxxxxxxxxxxxd7b7e1d7')

I have tried redoing the integration steps as different gitlab users including admin but result is always the sames.

Version Sentry 20.9.0.dev0

After days digging around the internet and hitting dead ends :expressionless:
I decided to skim through the code and see how the token from Gitlab is authenticated and here is where I found this comment
# Munge the token to extract the integration external_id. # gitlab hook payloads don't give us enough unique context # to find data on our side so we embed one in the token.
So apparently Sentry is adding additional data to the token using : separators and spiting them that way. Since my on-prem Gitlab is running on a port(:81) this ended up in the split content Sentry is trying to validate yet its not part of the token.
In conclusion Gitlab integration for commit tracking does not work if your Gitlab is running on another port other than 80

1 Like