This repository does not have a GitLab API Token set

This repository does not have a GitLab API Token set


Error: POST - 428 (code)

Request return:
error: “This repository does not have a GitLab API Token set”
vcs: “gitlab”

Could someone help me by telling me how I can make my site work?

Do I need to add anything on Netlify?

I recently bought the “Premium SaaS Plan (Formerly Silver)” package so that I could put a token in my project, however, I still can’t understand why it’s giving this error. I created a token for the project, however, my build is not working, the site does not open when I try.

Could someone tell me how I can use this token that the Netlify api is asking to display my project’s deploy?

Hi @ErikDCAlmeida :wave:t6: ,

Welcome to Netlify thanks so much for reaching out! You will need to create and add your GitLab API token to your build’s env variables on Netlify:

  1. Go to your Netlify site dashboard and click on “Site settings”.
  2. Scroll down to the “Build & deploy” section and click on “Environment”.
  3. Click on “Edit variables” and add a new variable with the name GITLAB_API_TOKEN and the value of the token you just created.
  4. Try to trigger a new build. The build should be able to authenticate using the token you provided.

Finally, I encourage you to read our API build docs as it may answer any outstanding questions?

Hi @SamO ,

I did what you said, I created a new variable in Netlify, named it “GITLAB_API_TOKEN” and the value of the token I created. So, I closed the merge request I had opened and then opened another one to check if the error still persisted. However, when trying to load the deploy page I still have the problem displaying the same error.

Do I need to take any further steps to troubleshoot the issue?

hmm that’s weird. What does your build log say? Are there are any error messages related to the GitLab API token?

Also please check the variable name and confirm it matches what is set in Netlify.

Hi @SamO!

In the build deploy there are no errors occurring, everything is correct and the build is being performed correctly. It says nothing about GitLab, Token or API.

The name of the variable I put the same name as the token n GitLab and what you asked me to put: “GITLAB_API_TOKEN”, the value of the variable in Netlify is literally the same as the token in GitLab.

Hey @ErikDCAlmeida,

We’ve raised this with the devs and are waiting on their feedback. We’ll keep you posted. Meanwhile, I’ll close all your duplicate threads (in the helpdesk).

Hello there @ErikDCAlmeida! This error occurs when collaborative Deploy Previews don’t have permissions to read your merge request data. Have you tried following these instructions?