Not found, Problem fetching Git Organization Repos

Hi,
my proplem is, that I can not log into my admin of my deployed site, which is comming from an organisation repository.

For the organization repository at /admin/ I can type my username and password but afterwards and error is popping up in the UI:“Not found”

I guess it has to do with the authenification in Github, but we cannot find any problem.Do you have any suggestions what could be the problem?

Setup:
Gatsby, Github, Netlify
Kind of Repository: Organization Repository
Netlify Backend: Git Gateway

Errors:

In my console I am getting the following message:

ajv-errors: Ajv option jsonPointers changed to true netlify-cms.js:53:47823

Problem fetching repo data from Git Gateway netlify-cms.js:168:87955
hasWriteAccess netlify-cms.js:168

API_ERROR: “Not Found” t netlify-cms.js:46 netlify-cms.js:46 request netlify-cms.js:168

In the networks analytics there I am getting the following message:

200 GET {GeneratedURL}(GeneratedURLWithHTTP)settings fetch json 380 B 85 B 142 ms

404 GET {GeneratedURL}(GeneratedURLWithHTTP) master?ts=1562680369511 fetch json 1,18 KB 114 B 360 ms

404 GET {GeneratedURL}(GeneratedURLWithHTTP) master?ts=1562680927684 fetch json 1,18 KB 114 B

GeneratedURL is a name for the real URL, which I want to keep private. Replace the {} around it with [
].
I am wondering why the second link is http instead of https

I already did this to fix the problem:

  • uninstalled the Gatsby plugin offline(Service Worker) as described in the gatsby docu
  • deployed site in another private repos, which is working perfectly => Netlify CMS runs as expected
  • deployed a new Site from the same organization repository, which is not working
  • Re-generated my access token

Nothing of these things fixed the problem.

I have no access to the organization account settings and the person that has access is only remote so if anything there needs to be changed please let me know.

thank you in advance

Regards
Leon

1 Like

Hi Leon,

Yes i can confirm my issue is the same as yours. A user Cannot sign into the CMS using the netlify github auth gateway if the repo is private and belongs to an org (of which the user is the owner, with full permissions). Furthermore i can confirm that the Netlify github App permissions within the github organization are correct read/write.

I have used your workaround - by deploying from a private personal repo. In this case the CMS works fine, indicating that this is not a user error.

I had the exact same problem and had to first approve the app for the organization on Github. You can follow the docs here: https://help.github.com/en/articles/requesting-organization-approval-for-oauth-apps

2 Likes

thanks for that suggestion @bernhard ! That will probably help some folks get configured.

Two other possibilities:

  1. you should redeploy your site after any config change for identity or git_gateway, particularly if relinking a repo or regenerating a token. We have some internal config that gets updated when you set things, that gets ACTIVATED at next deploy (remember your site is static and it’s a snapshot in time so config like that may not be applied dynamically).

  2. if the person who configured the connection to GitHub has left the Netlify team or Github org , that link will need to be regenerated.

Do any of those suggestions fix your problem, prior posters?

Hello,

thank you 2 for your answers! @bernhard In github, the organization repository is connected, which I guess is indicated by the red X. If the X means something different than “click it and the the access to this repos will be removed” please let me know. This is not 100% clear to me.

@fool I was trying that. I push to github each time I change something. This deploys the site again. I even deployed a new netlify site of the same repository(organization).

Do you have any other suggestions?

a red X likely means it was rejected. Github uses green checks where things are configured well usually :slight_smile:

Perhaps you could share a screenshot?

1 Like

Oh, then this could be the problem. Here is a screenshot:

I blurred the organization’s name left of the red X

Thank you in advance!

Hi @leond, since you are using git-gateway, have you generated a token for git-gateway? Git-gateway requires that your account have owner access to the repository that you want to use with the netlify-cms.

Hi, thank you all for your answers,
it finally works!!
The problem was, that in the company’s profile settings, the acces of the Netlify Auth app was denied. We changed it based on the description in the link below, but instead of setting up the restriction, we gave access for the Netlify Auth app.

The problem is solved now and everything works fine, good job!

https://help.github.com/en/articles/enabling-oauth-app-access-restrictions-for-your-organization

1 Like

thanks for keeping us updated! This definitely helps other people who might have the same issue :muscle: