VCS integration - Gitlab webhook gets 401

Hi, I am running a website hosted on my local machine which uses an nginx server as a reverse proxy.

Youtrack is served through a docker container living at http://localhost:8080. The nginx config forwards any requests to on to the youtrack server. All seems to be working fine.

I'm now trying to set up VCS integration with an external Gitlab account. I've created the app password as per documentation and it says the connection is working. If I click the little button in the VCS integration settings screen to "Import commits and open pull requests", then I get the commit/PR updates displayed on the issue.

However it appears the webhook is not working in Gitlab. When I push commits, I can see no updates to the ticket and requests being rejected in my nginx logs:

[08/Dec/2021:22:35:02 +0000] "POST /track/api/vcsHooksReceiver/gitlab/142-4 HTTP/1.1" 401 68 "-" "GitLab/14.6.0-pre"
[08/Dec/2021:22:35:02 +0000] "POST /track/api/vcsHooksReceiver/gitlab/142-4 HTTP/1.1" 401 68 "-" "GitLab/14.6.0-pre"
[08/Dec/2021:22:35:02 +0000] "POST /track/api/vcsHooksReceiver/gitlab/142-4 HTTP/1.1" 401 68 "-" "GitLab/14.6.0-pre"
[08/Dec/2021:22:35:02 +0000] "POST /track/api/vcsHooksReceiver/gitlab/142-4 HTTP/1.1" 401 68 "-" "GitLab/14.6.0-pre"

This is confirmed when I manually test the webhook in gitlab:

What authorization does this require?


Gitlab gives the following breakdown:


 Push Hook  

Completed in 0.54 seconds ()


{"error":"Unauthorized","error_description":"HTTP 401 Unauthorized"}
Server: nginx
Date: Wed, 08 Dec 2021 22:47:43 GMT
Content-Type: application/json;charset=utf-8
Content-Length: 68
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Location
X-Xss-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Cache-Control: no-cache, no-store, no-transform, must-revalidate


  "object_kind": "push",
  "event_name": "push",
  "before": "6af85dc897b6a59c20acaf6daf2cbf56b9291d5b",
  "after": "40180590dcb0f8de6e77eec8166921807a8ab8d0",
  "ref": "refs/heads/ISSUE-1",
  "checkout_sha": "40180590dcb0f8de6e77eec8166921807a8ab8d0",
  "message": null,
  "user_id": 1772994,
  "user_name": "user",
  "user_username": "user
  "user_email": "",
  "user_avatar": null,
  "project_id": 123456,
  "project": {
    "id": 123456,
    "name": "project",
    "description": "",
    "web_url": "",
    "avatar_url": null,
    "git_ssh_url": "",
    "git_http_url": "",
    "namespace": "user",
    "visibility_level": 0,
    "path_with_namespace": "my/repo",
    "default_branch": "master",
    "ci_config_path": null,
    "homepage": "",
    "url": "",
    "ssh_url": "",
    "http_url": ""
  "commits": [
      "id": "40180590dcb0f8de6e77eec8166921807a8ab8d0",
      "message": "ISSUE-1 commit message",
      "title": "ISSUE-1 commit message",
      "timestamp": "2021-12-08T22:47:36+00:00",
      "url": "",
      "author": {
        "name": "user",
        "email": "user@emailcom"
      "added": [

      "modified": [
      "removed": [

  "total_commits_count": 1,
  "push_options": {
  "repository": {
    "name": "repo",
    "url": "",
    "description": "",
    "homepage": "",
    "git_http_url": "",
    "git_ssh_url": "",
    "visibility_level": 0
Content-Type: application/json
User-Agent: GitLab/14.6.0-pre
X-Gitlab-Event: Push Hook


If you didn't omit it intentionally, then there should also be an 'X-Gitlab-Token'  header that would serve an authentication purpose, which seems to be the main problem here. 

I suggest that you do the following: 

  • make sure that you configured your reverse proxy in accordance with the documentation
  • try to disable → enable the VCS integration in the YouTrack settings. It should recreate a webhook, which might fix the issue 

If it doesn't help, then please reach out to our support and share the following details: 

We'll inspect the data and get back to you with further details. Thanks. 


Hi Sergey, thanks for the help disabling and re-enabling added the auth token and now it works!

Strange as I'd deleted and re-made the integration several times, but never disabled/re-enabled.
I've confirmed by resetting all back to normal, creating the integration does not add the auth token. After disabling and re-enabling the auth token is added. A bug?



Sorry for the late reply. We've been testing this case and have not reproduced this behavior yet. Creating a new GitLab integration has added a secret token in all the cases. So it might be related to specifics in your GitLab account, which we have no means to verify. 

As of now, we added additional logging for hook creation that will be included in one of the upcoming YouTrack releases. After that, we'll keep an eye on related errors to see if we'll be able to identify why such a case may occur. Thanks for bringing it to our attention. 



Had the exact same problem with Youtrack's in-cloud service as well; testing webhooks on Gitlab also returned 401. 

Disabling and re-enabling also fixed the issue. 


Some keywords for people to find this:

Cannot see commits in Youtrack VCS changes

VCS Integration does not work

Gitlab CI/CD integration does not work


Please sign in to leave a comment.