The remote repository "..." is not accessible with the current token. Please grant the necessary permissions

Often when I try to push commits to my repository (org repository where I have Admin rights) I get this message:

The remote repository “…” is not accessible with the current token. Please grant the necessary permissions.

I can push to this repository locally with the same GitHub account just fine, I can edit stuff in the GH web UI just fine as well. The branch I am trying to push to even was created with Gitpod just a few minutes ago.

What is going on there?

(Dashboard — Gitpod also shows that I gave all permissions, and I also made sure the Gitpod app has access to the org)

Turns out trying again also just makes it work sometimes.

Are you using a custom docker image? Then it could be Gitpod Extension warning that I have to grant necessary permissions · Issue #4062 · gitpod-io/gitpod · GitHub which has been fixed and will be deployed in the next days.

No, just used the Gitpod browser extension button to open some random repositories from the prisma organisation.

This time I observe that Gitpod tells me it can not push, but going to the repository shows that is actually pushed just fine. (Panic about losing my changes was unjustified - fortunately.)

Thanks a lot for your continuous reports.

We check whether the scopes of a token are enough to perform a Git operation and inform the user in case they have to grant more privileges,. But these checks are done out of band and they don’t block anything. In your case, the check seems to return a false negative but the token actually works fine, which is why your git operation succeeds.

I dug through the code and tried a lot of things but I could not reproduce this so far. It would be awesome if you had any more hints how to force this, like repos on which this happens often, a workspace ID and time when this happened or similar. Other than that, I’ll try to improve our logging around this. We switched it off to not log any tokens, but we could log a lot of useful other stuff. BTW, there is a logfile in your workspace /tmp/gitpod-credential-helper.log which could contain valuable info for us already.

1 Like

Good to know, I will try to open and look at that next time I see the message. How do I open this file? Ctrl+P and then the path?

I filed [git] false negatives when validating token scopes · Issue #4478 · gitpod-io/gitpod · GitHub