vscode-gitlens icon indicating copy to clipboard operation
vscode-gitlens copied to clipboard

Fetch-> fatal: could not read Username for 'https://github.com': No such device or address

Open matheusssilva opened this issue 5 years ago • 30 comments

  • GitLens Version: 10.2.1
  • VSCode Version: 1.45.0
  • OS Version: Ubuntu 20.04 LTS

Steps to Reproduce:

1 - Clone any repository 2 - Click in "Fatch Repositories Button".

gitlens_fetch_error

Output debug:

[2020-05-11 13:04:31:366] [9f] GitService.getOrderedRepositories
[2020-05-11 13:04:31:366] [a0] GitService.getRepositories
[2020-05-11 13:04:31:367] [a0] GitService.getRepositories completed • 0 ms
[2020-05-11 13:04:31:367] [9f] GitService.getOrderedRepositories completed • 0 ms
[2020-05-11 13:04:31:368] [a2] GitService.getOrderedRepositories
[2020-05-11 13:04:31:368] [a3] GitService.getRepositories
[2020-05-11 13:04:31:368] [a3] GitService.getRepositories completed • 0 ms
[2020-05-11 13:04:31:369] [a2] GitService.getOrderedRepositories completed • 0 ms
[2020-05-11 13:04:31:369] [a4] GitService.fetchAll — e=OculiNuboWeb, t={"all":false,"prune":false}
[2020-05-11 13:04:31:369] [a5] Repository(/home/matheus/megasync/programstudio/oculinuboweb/).fetch — {"all":false,"prune":false}
[2020-05-11 13:04:31:374] ChildProcess.exithandler
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch
fatal: could not read Username for 'https://github.com': No such device or address

[2020-05-11 13:04:31:374] ShowMessage(error, 'Unable to fetch repository. See output channel for more details', undefined, null)
[2020-05-11 13:04:31:378] [a4] GitService.fetchAll completed • 8 ms
[2020-05-11 13:04:31:378] [a5] Repository(/home/matheus/megasync/programstudio/oculinuboweb/).fetch completed • 9 ms
[2020-05-11 13:04:31:378] [a1] GitCommandsCommand.execute completed
[2020-05-11 13:04:43:349] ShowMessage(error, 'Unable to fetch repository. See output channel for more details', undefined, null) returned Open Output Channel
[2020-05-11 13:04:43:866] [a6] RepositoriesNode.onActiveEditorChanged
[2020-05-11 13:04:43:866] [a6] RepositoriesNode.onActiveEditorChanged completed • 0 ms

matheusssilva avatar May 11 '20 13:05 matheusssilva

Whereas the basic VS Code Git extension asks for the password in the GUI, and does not ask it if it is loaded into the credential helper, GitLens refuses to do either.

sanmai-NL avatar May 22 '20 07:05 sanmai-NL

Hi,

I've the same issue

GitLens Version: 10.2.1 VSCode Version: 1.45.1 (user setup) OS Version: Windows 10 Enterprise 1809

Steps to Reproduce:

1 - Clone any repository 2 - Click in "Fetch Repositories" button.

Output debug: [2020-06-09 07:21:46:485] ChildProcess.exithandler Error: Command failed: C:\Program Files\Git\cmd\git.exe -c core.quotepath=false -c color.ui=false fetch origin bash: /dev/tty: No such device or address error: failed to execute prompt script (exit code 1) fatal: could not read Password for 'https://[email protected]': No such file or directory

ghost avatar Jun 09 '20 07:06 ghost

Hi, pretty sure this is not potential bug. I experience it for 4 months maybe. Sorry, no new information, writing this to bump the thread.

AurimasAnskaitis avatar Aug 04 '20 13:08 AurimasAnskaitis

Same for me

[2020-11-24 07:34:37:699] /home/frappe/.vscode-server/extensions/eamodio.gitlens-11.0.1/dist/gitlens.js:2:817381
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch
fatal: could not read Username for 'https://github.com': No such device or address

pm-at avatar Nov 24 '20 07:11 pm-at

Same issue on

  • GitLens Version: 11.0.6
  • VSCode Version: 1.51.1 (user setup)
  • OS Version: Windows_NT x64 10.0.19041

I'm working on a remote server via remote ssh and the git remote sits on a machine in that same network on a mounted file system. GitLens log:

[2020-12-01 16:36:39:610] /fs/home/user/.vscode-server/extensions/eamodio.gitlens-11.0.6/dist/gitlens.js:2:822425
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch
fatal: could not read Username for 'https://remote-repo.com': No such device or address

mystery-e204 avatar Dec 01 '20 16:12 mystery-e204

I'm having the exact same issue when cloning a project on Linux with HTTPS :

  • GitLens version: 11.1.3
  • VSCode version: 1.52.1
  • OS Version: Linux Fedora 32 x86_64

My project is hosted on a private instance of Gitlab that can be accessible from anywhere and where I have access rights. However this same project can be fetched from VSCode on Windows, from VSCode on Linux when it has been cloned using SSH and from the Linux terminal (without VSCode).

Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch
fatal: could not read Username for 'https://gitlab.remoterepo.com': No such device or address

Nicryc avatar Jan 25 '21 16:01 Nicryc

I'm having the same issue, running VS Code via SSH remote. I have not problem on local machine, or on remote machine when I select pull, issue occurs when I fetch.

[2021-02-11 17:23:15:061] /home/pi/.vscode-server/extensions/eamodio.gitlens-11.2.1/dist/gitlens.js:2:888662 Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch origin SeaBreeze fatal: could not read Username for 'https://github.com': No such device or address

aswyatt avatar Feb 11 '21 17:02 aswyatt

This has happened to me after my primary SSH key has changed. Looking into a fix.

EDIT: Fixed now. The SSH key change was a coincidence. Kind of. Actually, I was hit in two ways at the same time from this, one of the problems was probably definitely caused the the SSH identity key change, the other problem was definitely unrelated and not caused by it however.

For the first problem, just doing a fetch from Source Control sidebar with GitLens was giving me the exact same error in output as what others had reported here:

No such device or address

To fix that, I did the following, not sure which steps ultimately resolved the issue:

  1. Remove GitHub app auth from Github.com profile settings, then re-authorize.
  2. Sign out of Github profile (profile icon in lower left corner of VSCode), re-sign in, re-authorize.
  3. Disable GitLens plugin and reload (up to this point, issue was NOT fixed. Somewhere after here things got fixed)
  4. Uninstall GitLens
  5. Shut down VScode, upgrade from Dec 2020 update to Jan (v1.53.2), restart
  6. Completely re-sign out of GitHub and Github profile (again, lower left icon of VSCode) and re-sign in, re-authorize
  7. Attempt fetch with standard source control plugin.

So somewhere between steps 3 and 7 fixed the issue. Could re-install GitLens and things were working again.

BUT, after all the above, I was still getting a prompt for a Github.com username / password when running a git clone from bash. This is not good because would require a PAT for the password, and I previously have never enabled one.

However, this second issue ended up being unrelated to the first. The issue was, I was independently testing out a new automation with tox. Tox by default does not inherit all environment variables. Specifically, the ones starting with VSCODE and containing GIT_ASKPASS are required, as this is what VSCode uses to trickle down the plugin authorization down to the git cli.

In the case of tox not working with Github.com ops within VS Code, the following line in your tox.ini would fix the issue: passenv = *GIT_ASKPASS* VSCODE*

hans2520 avatar Feb 16 '21 21:02 hans2520

Can anyone still reproduce this on the latest GitLens version 11.3 or later (or the current insiders version)?

eamodio avatar Apr 07 '21 06:04 eamodio

This issue needs more information and has not had recent activity. Please provide the missing information or it will be closed in 7 days. Thanks!

github-actions[bot] avatar Apr 15 '21 05:04 github-actions[bot]

I cannot reproduce this issue any more on GitLens 11.4.1. Thanks for taking care of it.

mystery-e204 avatar Apr 15 '21 08:04 mystery-e204

Hi! GitLens Version: 11.4.1 VSCode Version: 1.55.2 (user setup) OS Version: Windows 10 Pro Build: 19042.928

I use the VSCode on windows, the code runs in a WSL2 docker image.

In VSCode->WSL2->Docker->terminal, the /usr/bin/git -c core.quotepath=false -c color.ui=false fetch command works but GitLens fetch returns the same error:

[2021-04-17 11:31:09:640] [/home/user/work/repos/some_folder] Git Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch • could not read Username for 'https://github.com': No such device or address • 1486 ms 
[2021-04-17 11:31:09:642] /home/user/.vscode-server/extensions/eamodio.gitlens-11.4.1/dist/gitlens.js:53:36614
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch
fatal: could not read Username for 'https://github.com': No such device or address

Should I reinstall/reinitialize something?

best Ákos

astrackomni avatar Apr 17 '21 11:04 astrackomni

I would be great if anyone who can reproduce this could try to debug it. I haven't been able to see this in action. Sorry.

eamodio avatar Apr 18 '21 05:04 eamodio

Hi and thanks for the support.

I'm having this issue when working on remote - ssh extension:

  • Local: Windows 10
  • Remote: Debian 10 server
  • VSCode 1.57.1
  • GitLens 11.5.1

I can push and I can pull - it prompts for user and pass. But when i try to fetch from the GitLens Remotes View it doesn't prompt and I get the same error:

[2021-06-21 11:18:13:306] Git Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch origin develop • could not read Username for 'https://bitbucket.example.org': No such device or address • 5155 ms 
[2021-06-21 11:18:13:307] /home/almeidam/.vscode-server/extensions/eamodio.gitlens-11.5.1/dist/gitlens.js:55:36671
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch origin develop
fatal: could not read Username for 'https://bitbucket.example.org': No such device or address

I'm glad to debug it further, but I'm not sure of what you need.

nirodaonline avatar Jun 21 '21 11:06 nirodaonline

I encountered this bug a while ago (VSCode default git interface is fine, but GitLens fetch will invoke this bug), today I finally solved it by a simple

git config credential.helper store

before an add-commit-push. Then, this problem is solved for GitLens.

scaomath avatar Jul 20 '21 17:07 scaomath

I encountered this bug a while ago (VSCode default git interface is fine, but GitLens fetch will invoke this bug), today I finally solved it by a simple

git config credential.helper store

This solves it by storing your git credentials on disk. But it's a workaround, it doesn't actually address the problem.

nirodaonline avatar Jul 21 '21 08:07 nirodaonline

I also have this bug on linux with: GitLens - Git Supercharged v11.6.0 VS Code Version : 1.58.2 Commit : c3f126316369cd610563c75b1b1725e0679adfb3 Date : 2021-07-14T22:30:16.440Z Electron : 12.0.13 Chrome : 89.0.4389.128 Node.js : 14.16.0 V8 : 8.9.255.25-electron.0 OS : Linux x64 5.4.0-80-generic

When trying a fetch, I have the same info stated above.

[2021-07-30 13:11:45:151] [/local/home/ccossou/CLionProjects/yam_stat] Git Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch origin master • could not read Username for 'https://github.com': No such device or address • 186 ms 
[2021-07-30 13:11:45:151] /local/home/ccossou/.vscode/extensions/eamodio.gitlens-11.6.0/dist/gitlens.js:55:36633
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch origin master
fatal: could not read Username for 'https://github.com': No such device or address

If I can help, tell me what command to run, or what log to copy here.

I removed the OAuth on github.com, but it doesn't even ask for my login. I logged in manually in VS code, gitlens is reinstalled and can access this account, but don't ask for it it seems.

Note that I can use gitlab, but not Github.com (Not entirely sure because I have no gitlab repository where I can push to test that fully)

ccossou avatar Jul 30 '21 13:07 ccossou

I am having the exact same issue on my linux. I can use git from the terminal just fine however. It happened right after changing the remote's url from the terminal, because I renamed the repo on github.

Edit: An error log I just got. Notice the first line especially.

[2021-08-02 13:24:54:694] [/home/jh] Git Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel • not a git repository (or any parent up to mount point /) • Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). • 7 ms 
[2021-08-02 23:05:40:028] [/home/jh/Developer/server] Git Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch origin main • could not read Username for 'https://github.com': No such device or address • 153 ms 
[2021-08-02 23:05:40:029] /home/jh/.vscode/extensions/eamodio.gitlens-11.6.0/dist/gitlens.js:55:36633
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch origin main
fatal: could not read Username for 'https://github.com': No such device or address

jhoogstraat avatar Aug 01 '21 15:08 jhoogstraat

I am getting this error, too. This formerly worked fine, but I had to change the origin from git@<foo> to https://<foo> due to internal server issues. Ever since then, I am not able to fetch with GitLens. Doing so from the command-line works fine. I tried uninstalling GitLens and reinstalling, as per a previous post, but that did not help.

Here's the error I see:

[2021-08-17 14:38:52:872] [/home/username/myproj] Git Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch • could not read Username for 'https://local.gitlab.net': No such device or address • 121 ms 
[2021-08-17 14:38:52:873] /home/username/.vscode-server/extensions/eamodio.gitlens-11.6.0/dist/gitlens.js:55:36633
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch
fatal: could not read Username for 'https://local.gitlab.net': No such device or address

jg572h avatar Aug 17 '21 14:08 jg572h

Same here using macOS.

[2021-08-25 18:48:32:560] [/] Git Command failed: /opt/homebrew/bin/git -c core.quotepath=false -c color.ui=false fetch origin master • could not read Username for 'https://github.com': Device not configured • 473 ms 
[2021-08-25 18:48:32:561] /.vscode/extensions/eamodio.gitlens-11.6.0/dist/webpack:/gitlens/src/git/shell.ts:190:6
Error: Command failed: /opt/homebrew/bin/git -c core.quotepath=false -c color.ui=false fetch origin master
fatal: could not read Username for 'https://github.com': Device not configured

enricodias avatar Aug 25 '21 18:08 enricodias

I also had this problem with GitLens on Windows + WSL2 (I running my workspace in a Docker container, but I don't think that makes any difference).

I went for the 'git config credential.helper store' fix and this worked. I believe that Git Credential Manager Core is part of WSL2, so the username/password is not stored unencrypted on disk. Certainly when I check the contents of ~/.git-credentials it looks encrypted.

peterswords avatar Sep 27 '21 01:09 peterswords

I was getting this until I switched to use ssh from https...

before...

https://github.com:myName/myRepo.git

then I ran

git remote set-url origin [email protected]:myName/myRepo.git

now fetch works properly

jimSampica avatar Oct 07 '21 19:10 jimSampica

@jamesSampica thanks for the suggestion.

But it doesn't work for me. My repository is on bitbucket. I followed your suggestion - git remote set-url origin git@bitbucket.<Organization>.org:7999/myRepo.git - and got this on fetch:

[2021-10-07 20:52:00:390] [/var/www/<myBase>] Git Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch • ssh: connect to host bitbucket.<Organization>.org port 22: Connection refused • Could not read from remote repository. • • Please make sure you have the correct access rights • and the repository exists. • 26 ms

It may be that some configuraton is missing on the bitbucket side, but IMHO, the main issue remains open:

The basic VS Code Git extension asks for the password in the GUI, and GitLens does not

(paraphrasing comment 2)

nirodaonline avatar Oct 07 '21 21:10 nirodaonline

I am also experiencing the issue @nirodaonline is experiencing. However, I'm just using a normal github repo on a standard port.

lacraig2 avatar Feb 19 '22 01:02 lacraig2

Same problem with a GitHub repo in GitLens. Any word on a real fix? I can do that credential helper thing, but it should be fixed.

I can pull/push/fetch etc in GitHub desktop or from command line, but it fails through GitLens: [2022-03-07 19:07:17:607] [c:/_Sites/Codebases/Mainline] Git Command failed: C:\Program Files\Git\cmd\git.exe -c core.longpaths=true -c core.quotepath=false -c color.ui=false fetch • bash: /dev/tty: No such device or address • error: failed to execute prompt script (exit code 1) • could not read Username for 'https://github.com': No such file or directory • 475 ms [2022-03-07 19:07:17:858] c:\Users<username>.vscode\extensions\maattdd.gitless-11.7.1\dist\webpack:\gitless\src\git\shell.ts:190:6 Error: Command failed: C:\Program Files\Git\cmd\git.exe -c core.longpaths=true -c core.quotepath=false -c color.ui=false fetch bash: /dev/tty: No such device or address error: failed to execute prompt script (exit code 1) fatal: could not read Username for 'https://github.com': No such file or directory

tfitzpatrickSymplr avatar Mar 08 '22 19:03 tfitzpatrickSymplr

For those who are still experiencing this issue, does running Git: Fetch from the command palette work?

eamodio avatar Mar 10 '22 06:03 eamodio

For those who are still experiencing this issue, does running Git: Fetch from the command palette work?

Hi @eamodio . Thanks for looking into this.

I just tried Git: Fetch from the command palette and it worked (i.e. it asked for the user/password in the GUI) I also tried from the terminal and it worked. I retried from within Gitlens and it did not work: Same error.

nirodaonline avatar Mar 10 '22 10:03 nirodaonline

@eamodio I just experienced this problem and fixed it by logging out of GitHub and then running Git: Fetch from the command palette.

What triggered the problem was mistakenly cancelling the master password popup that sometimes appears when starting VSCode, which probably made the GitHub login fail. This also produced a big problem where the GITLENS: COMMITS panel got stuck at loading, and it cascaded to the rest of the program, making it unusable, even after restarting VSCode.

This produced some errors when trying to close the VSCode:

  • Discarding backups is taking a bit longer...
  • onBeforeShutdown is taking a long time, pending operations: veto.backups
  • onWillShutdown is taking a long time, pending operations: join.workingCopyBackups
  • Closing the window is taking a bit longer... The following operations are still running:
    • Backup working copies

Hope it helps you debug it.

gonssal avatar Jun 23 '22 12:06 gonssal

After running Git: Fetch on command pallette, I was redirected to webpage with form "GitHub for VS Code is requesting additional permissions" where I pushed a button to "authorize Visual Studio Code" and entered my Github password. All problems dissapeared. VSCode on Ubuntu.

daliusbu avatar Sep 10 '22 05:09 daliusbu