Git Gateway error

Please help. Trying to log in to the admin for my new site.

This is the error i am getting

git Gateway Error: Please ask your site administrator to reissue the Git Gateway token

4 Likes

Hi @PhilomenaMbura, do you mind trying to re-generate the git-gateway token under your Netlify site setting? Can you share the network traffic from the browser when the error occurs?

I have re-generated the token but it still does not work.
This is the new error after re-generating

Git Gateway Error: [object Object]

What do you mean share the network traffic?

Hi @PhilomenaMbura, sorry for not being clear enough. Most browsers supply developer tools with a network tab.
For example in Chrome it looks like this:

Can you look for errors there/share the content for requests+responses? Similar, there should be a console table that might expose relevant errors.

I’m not the original poster but I got the same problem of Git Gateway Error: [object Object]. Here’s a screenshot of the error I get on the console.

I already tried reissuing the token and redeploying the site after. Appreciate your help!

1 Like

Hi @bunnydreams and welcome to the community. Can you share the response for that failed request?

I managed to solve the error. Sorry for the late one and thanks for the help!

I’m guessing I was getting that error because the name on my github repo was different from the one on netlify.

I hope that helps.

1 Like

Thanks for following up @PhilomenaMbura!

I’m having the same issue after renaming my Github repository. Before the rename Netlify CMS was working. Since then I can’t login. I’ve reset the linked repository under Build settings and then disabled/enabled the git-gateway under Identity settings. I’ve cleared cookies and local storage, but when I try to login I get

“Git Gateway Error: Please ask your site administrator to reissue the Git Gateway token”

in a yellow notification box and I can see a 401 HTTP response from Github API from a request to https://api.github.com/repositories/<number>/branches/master
{message: "Bad credentials", documentation_url: "https://developer.github.com/v3"}

I’ve tried to reset the token a few times + clearing cookies/storage as well, but no combination of token reset or re-connecting Github repo is solving this.

Any recommendations how to solve @PhilomenaMbura or @erez ?

aaaaaand as soon as I post that, I refreshed my browser and I am logged in successfully. After about an hour of trying various token resetting and Github repo reconnecting did it let me log in - maybe cache invalidation?

1 Like

Thanks for following up @scottserok and I’m glad it worked out.
I’ve seen similar issues where just disabling & enabling git-gateway will result in a 404 when trying to access it so it might be related (in that case it the issue is resolve just by waiting some time). We’re still investigating it with our backend team.

I am having a similar issue. My error is Git Gateway Error: [object Object] in a yellow box.
In Netlify I have tried reseting the Deploy Key in settings->Build & deploy

I have also tried Disable Git Gateway in settings->Identity

I have also cleared my cache, reloaded, as well as giving it time. Still no luck.

Any help is appreciated

I was using the static/admin/config.yml file automatically generated by the getting started buttons on netlifycms.org.

I am not sure why but this yaml file did not include repo under backend:

backend:
  name: github
  repo: your-username/your-repo-name

By adding that and making sure it exactly matched my username and repo name I was able to log in.

1 Like

Same issue here after changing my github repo name. Sounds like other people’s issues have been resolved by just waiting.


Getting a 401 unauthorized response. Hopefully, this issue resolves itself within the next few minutes.

1 Like

Hi @whipplepoint, thank for sharing your config.yml. By setting the backend to GitHub you’re actually not using git-gateway anymore, which is one way to solve this issue.
@bloxy, since you changed your repo name you might need to disable/enable git-gateway from Netlify’s site settings or even re-link the repo under build settings.

1 Like

Removing all cookies and refreshing the page worked for me

…
Might not be the real solution, but it should at least give a valid error response instead of Git Gateway Error: [object Object]

2 Likes

I am having a similar issue here. I setup an account on Netlify using an email instead of a github account.

When setting up the site I pointed it to my github repo. Even though I used a different email than the one I use for github.

After I setup my config file like so:

backend:
  name: git-gateway
  repo: byebyers/clearingkarmas
  branch: master

And was able to turn on identity and set up git-gateway like so

When creating an access token I was able to log into my github account so I figured that it would work. Still I am getting the same error.

Git Gateway Error: Please ask your site administrator to reissue the Git Gateway token.

I have tried creating a new one several times, cleared cache, reset the browser, and reset my pc but no luck.

Does my netlify email have to match my github one in order for this to work or am I missing something here?

I’m having the same problems and I cannot find a solution for this

@nogueira @byebyers I’m not sure if both of you have tried this but it was able to fix my issue!

Try switching your branch in config.yml from master to main. I initially had mine set to master, but then I noticed that my “Deploy contexts” section on Netlify showed my production branch as main.

Changing my yml branch to main worked! I also regenerated the key after changing the branch.

4 Likes