Git Gateway error

Thanks! After confirming that my organization permission was set for Git Gateway, I was still having trouble. Adding the lines for the repo and branch in the config.yml file did the trick.

1 Like

Problem is that some important things aren’t described there in the “extensive documentation” provided in netlifycms.org. It just did not help.

The article I mentioned is this one: Git Gateway | Netlify CMS | Open-Source Content Management System.

Just thanks a lot!

I had to find and try a lot of differente solutions, and you compiled them here. Just thanks :heart_eyes:

1 Like

@alexblbl , you’re a freakin rock star. Thank you. This worked after smashing my head against the table for 2 hours. Thank you!

+1 for clearing all cookies. I also unlinked and relinked repo and added my repo into config.yml file, but clearing cookies was the final touch that fixed this issue on my end.

2 Likes

I had the exact same problem and this answer solved it. Thanks alot.

1 Like

Same issue here. I am using StaticCMS right now (fork of netlify cms).

Relevant info:

  • I am logged in to netlify via email.

  • My repo is hosted on a private repo on GitLab and I have added the repo to netlify via Netlify App

  • Activated git-gateway via Netlify App

  • My cms is set up with backend: { name: "git-gateway", branch: "master",}. Master is my main branch obviously.
    My Deploy Context on Netlify confirms that is is on master:
    image

  • YES I did change the gitlab repo url at some point. Might be that’s what has broken it (as others had observed previously), BUT I have since unlinked and re-linked my repo via Netlify App and I am getting THE SAME ISSUES

Issue Describtion:
Git-gateway works for a few hours (at max), then it ceases to work. I am getting: Git Gateway Error: [object Object]. Inspector console shows:

https://<subdomain>.netlify.app/.netlify/git/gitlab/repository/tree?path=src%2Fpages&ref=master&recursive=true 401

Above link shows:
{"code":401,"msg":"This endpoint requires a Bearer token"}

Workaround (works only for a few hours max):

  • I go to Netlify App select “Disable Git Gateway” and then I re-enable it. After that IT WORKS FINE, but only for a few hours. Then I need to repeat the process, which seems to be a reliable way to make it work.

Since it DOES WORK for limited amount of time, every time, this seems to be a Netlify issue?

Other things that DO NOT solve above issue:

  • deleting cookies
  • browser private mode
  • setting the branch

This is actually a different problem you are running into than the ones in this thread. Check out this article for details on the change GitLab made that broke this last year, and offers a path to work around it:

1 Like

Oh damn, yes it seems like that was it :astonished:

I would suggest to at least add some warning to the UI for GitLab users, or else it is VERY difficult for to the user to figure out what is going on (given the 2 hour delay).

I’m experiencing the same error, I’ve tried everything and nothing has worked.
I’ve tried:

  • clearing cookies
  • disabling and re-enabling Git Gateway
  • browser private mode
  • setting the branch to main in config and in netlify
  • adding repo: your-username/your-repo-name to config

Nothing worked

I have the same issue. This happened when I change my GitHub username (also change the repo link). Solution for this error:

  1. Delete and Re-link the Github Repo
  2. If (1) does not work, delete the Git Gateway and Re-link it.
    Done! It is working now!
1 Like

Thank you for sharing that :netliheart: