1

I'm using VS Code 1.74.0 to push changes to my GitHub repository. When I click on Sync changes, VS Code asks me for the password for a user named 22298273@github.com.

GitHub sync - password dialog

This "user" is unknown to me and I don't know where that number (22298273) originates from. When I press ESC when the dialog is shown, I get the following error message in the git output:

2022-12-13 14:00:55.675 [info] > git push origin master:master [1546ms]
2022-12-13 14:00:55.676 [info] remote: Invalid username or password.
    fatal: Authentication failed for 'https://github.com/some-user-name/my-first-app.git/'

This does make sense, even though I don't know the user shown above. However, when I repeatedly press Sync changes again and always press ESC when the dialog for entering the password comes up, the sync finally succeeds after a couple of times (without entering anything as a password):

2022-12-13 14:00:58.138 [info] > git push origin master:master [1051ms]
2022-12-13 14:00:58.138 [info] To https://github.com/some-user-name/my-first-app.git
    b098c51..16d459f  master -> master

Alternatively, when I enter my valid access token from GitHub into the password field, the sync works straight away, but my question remains: Where does that user number (22298273) come from? And why does the sync work without entering anything into the password field after a couple of attempts?

Update

After following some of the advices given in the comment, I still have the same behaviour:

    >>> I performed a change, added a file via "Commit" and then pressed "Sync Changes" <<<

2022-12-15 14:54:21.810 [info] > git log --oneline --cherry master...master@{upstream} -- [1ms]
2022-12-15 14:54:22.351 [info] > git pull --tags -r origin master [537ms]
2022-12-15 14:54:22.351 [info] From https://github.com/gorgsenegger/my-first-app
 * branch            master     -> FETCH_HEAD
2022-12-15 14:54:23.522 [info] > git ls-files --stage -- /home/johndoe/projects/my-first-app/src/app/servers/servers.component.html [0ms]
2022-12-15 14:54:23.528 [info] > git cat-file -s 573c25317a9597ab31b651934d4d309c74105cec [1ms]
2022-12-15 14:54:23.587 [info] > git show --textconv :src/app/servers/servers.component.html [0ms]

    >>> Here VS Code asks for the password for my user id <<<
    >>> I just pressed ESC <<<
    
2022-12-15 14:54:31.348 [info] > git push origin master:master [9530ms]
2022-12-15 14:54:31.348 [info] remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/gorgsenegger/my-first-app.git/'

    >>> Now I pressed "Sync Changes" again, VS Code asks for the password for my user id <<<
    >>> I just pressed ESC again <<<
    
2022-12-15 14:54:41.412 [info] > git log --oneline --cherry master...master@{upstream} -- [0ms]
2022-12-15 14:54:42.411 [info] > git push origin master:master [991ms]

    >>> Despite NOT having entered anything into the password field, not my commit is pushed <<<
    
2022-12-15 14:54:42.412 [info] To https://github.com/gorgsenegger/my-first-app.git
   0b0ca9a..319c84d  master -> master
2022-12-15 14:54:42.421 [info] > git config --get commit.template [2ms]
2022-12-15 14:54:42.426 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/master refs/remotes/master [1ms]
2022-12-15 14:54:42.435 [info] > git status -z -uall [6ms]
2022-12-15 14:54:42.436 [info] > git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname) [2ms]
2022-12-15 14:54:43.575 [info] > git config --get commit.template [1ms]
2022-12-15 14:54:43.580 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/master refs/remotes/master [2ms]
2022-12-15 14:54:43.588 [info] > git status -z -uall [5ms]
2022-12-15 14:54:43.588 [info] > git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname) [1ms]
2022-12-15 14:54:43.682 [info] > git ls-files --stage -- /home/johndoe/projects/my-first-app/src/app/servers/servers.component.html [1ms]
2022-12-15 14:54:43.688 [info] > git cat-file -s 573c25317a9597ab31b651934d4d309c74105cec [1ms]
2022-12-15 14:54:43.740 [info] > git show --textconv :src/app/servers/servers.component.html [1ms]
2022-12-15 14:54:49.575 [info] > git pull --tags -r origin master [8159ms]
2022-12-15 14:54:49.575 [info] remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/gorgsenegger/my-first-app.git/'

I signed out of my GitHub account within VS Code and also first updated the VS Code entry in the Windows Credential Manager. When this didn't work I deleted the entry and tried again, to no avail.

I can enter my personal access token when the dialog comes up in VS Code and it works, but I have to do it every time when I click on Sync Changes. And I still don't understand why I can click ESC (multiple times) and eventually the sync is performed without entering any password/access token.

Gorgsenegger
  • 7,356
  • 4
  • 51
  • 89
  • 1
    Apparently there is a github user id, check here if that matches https://caius.github.io/github_id/ – Mike Kim Dec 13 '22 at 19:03
  • I had the same issue. I think it is because the Access Token expired. I just created a new one and used it as the password in that prompt in VSCode. All seems to work properly now. I hope that was the issue, anyway. – Murrah Dec 14 '22 at 02:47
  • Actually, no. It only works sometimes! When it does work I can confirm the changes are in the remote repo by logging into GitHub through the browser. And the GitHub log in VSCode says all is well. But then, another push in a few minutes asks to authenticate again! Que?? – Murrah Dec 14 '22 at 02:58
  • 1
    Same for me, entering the newly created personal access token works. But then the next time (possibly after I closed VS Code and reopened it, but have to check again) when I try to sync, same error happens. @MikeKim that is indeed my user id, thanks for the link. I still don't know though, where to proceed from here and with that knowledge (at least I know where that this is the number for my id now). – Gorgsenegger Dec 14 '22 at 19:54
  • This might have some clues, Windows > Credentials etc, I'll look closer at it later https://stackoverflow.com/questions/42318673/changing-the-git-user-inside-visual-studio-code – Mike Kim Dec 15 '22 at 02:24
  • ... I took a look, looks like "Yousha Arif" has the solution for you. – Mike Kim Dec 15 '22 at 03:09
  • Tried the suggested steps, to no avail (see updated question). – Gorgsenegger Dec 15 '22 at 14:17
  • The problems seem to have "disappeared" after installation of 1.74.1. What I can't see from the [release notes](https://github.com/microsoft/vscode/issues?q=is%3Aissue+milestone%3A%22November+2022+Recovery+1%22+is%3Aclosed) though is anything related to the problems in my question. – Gorgsenegger Dec 19 '22 at 12:13

0 Answers0