-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First authorization via OAUTH fails #31470
Comments
I noticed the same issue using a similar setup (OIDC instead of LDAP). |
It seems that this issue is similar to #30991? Maybe |
I found a related issue ( maybe ) in GCM: Maybe this is a problem from upstream (not directly related) ? |
@yp05327 Good find, thats exactly what happens on my system. I ran a GCM_TRACE a few days back and it is similar to the one in the gcm issue. In my log the first push ends with the command erase and only on the 2nd push a new token is saved. See https://gist.github.com/Remmert-PBE/1ccecd8d82c4b19d700835bff1b3567b Now the question is, which tool is at fault? |
I have the same, after a little while, when I push again, the first time always fails, second time succeeds. im also logged in via the vscode -> oauth in browser |
First push fails with: remote: Verify second git push is ok |
same issue here. |
same, this only just started to be an issue |
I can't be sure but I think this started when I stopped using the gogit build of gitea... This was partially due to sha256 |
The same thing has been happening to me recently. Since some of my pulls/pushes are automated to happen at night, it's a real pain. I think it started after upgrading git-for-windows to 2.45.2.windows.1 and switching to GCM. A workaround has been discussed in the forums here: That does work to make it occur less often throughout the day if I set it to 24 hours vs. 1 hour, but it will still expire eventually. So, before my automated processes, I just made sure that I do an extra "git push" to force that expired token to be deleted, so the rest of the batch still works. That seems to get around the problem for now. |
Can confirm the same issue using git manually. Works on the second call. I believe this is also causing actions to fail on the checkout step. |
Same issue here for my team, tried the workaround to see if it at least mitigates the problem to once a day... |
I also still face this issue. Quite annoying tbh. |
I want to know if there are any good solutions at present, such as rolling back the git-for-windows version? Or rolling back the gitea version? |
It would be rolling back git-for-windows to the version that used a windows specific solution. |
I got it working by prepending the username to the remote url, i.e. |
It's a GCM issue, when it arbitrarily started to enforce OAuth when assuming a Gitea remote. The issue is that token expiration dates are (still) not saved, so there is currently no other way than try and fail. Mitigations boil down to
|
Description
The first authorization attempt after some hours fails, while the second one directly afterwards succeeds:
The gitea logfile shows that it tries to login with the user "OAUTH_USER" to our LDAP server, like it is saved by the Git Credential Manager:

The authorization after the initial error works for a few hours, but after a while it reappears (token becomes invalid?).
The credential settings in git are:
Gitea Version
1.21.11
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
https://gist.github.com/Remmert-PBE/959e1e243a2d8243a757aef754571270
Screenshots
No response
Git Version
git version 2.45.2.windows.1
Operating System
Windows Server 2019 Standard
How are you running Gitea?
Running as a service on a windows server. Behind a nginx reverse proxy (configured like the example in the gitea docs)
Database
MSSQL
The text was updated successfully, but these errors were encountered: