Skip to content
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

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

Closed
matheusssilva opened this issue May 11, 2020 · 37 comments
Labels
bug Something isn't working help wanted Want community input and/or pull request
Milestone

Comments

@matheusssilva
Copy link

  • 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
@sanmai-NL
Copy link

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.

@ghost
Copy link

ghost commented Jun 9, 2020

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://myusername@PrivateRemoteGitRepo.com': No such file or directory

@AurimasAnskaitis
Copy link

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.

@pm-at
Copy link

pm-at commented Nov 24, 2020

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

@mystery-e204
Copy link

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

@eamodio eamodio added the triage Needs to be looked at label Dec 23, 2020
@Nicryc
Copy link

Nicryc commented Jan 25, 2021

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

@aswyatt
Copy link

aswyatt commented Feb 11, 2021

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

@dpkkdn
Copy link

dpkkdn commented Feb 16, 2021

I had the same issue and solved it by changing the origin url as suggested here https://stackoverflow.com/questions/22147574/fatal-could-not-read-username-for-https-github-com-no-such-file-or-directo#comment38938891_22852314

@hans2520
Copy link

hans2520 commented Feb 16, 2021

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*

@eamodio
Copy link
Member

eamodio commented Apr 7, 2021

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

@eamodio eamodio added needs-more-info Needs further information, steps, details, etc. and removed triage Needs to be looked at labels Apr 7, 2021
@github-actions
Copy link

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 github-actions bot added the inactive Issue has not had recent required feedback label Apr 15, 2021
@mystery-e204
Copy link

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

@github-actions github-actions bot removed the inactive Issue has not had recent required feedback label Apr 16, 2021
@astrackomni
Copy link

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

@eamodio eamodio added bug Something isn't working help wanted Want community input and/or pull request and removed needs-more-info Needs further information, steps, details, etc. potential-bug labels Apr 18, 2021
@eamodio
Copy link
Member

eamodio commented Apr 18, 2021

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 eamodio added this to the Backlog milestone Apr 18, 2021
@nirodaonline
Copy link

nirodaonline commented Jun 21, 2021

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.

@scaomath
Copy link

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.

@nirodaonline
Copy link

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.

@ccossou
Copy link

ccossou commented Jul 30, 2021

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)

@jhoogstraat
Copy link

jhoogstraat commented Aug 1, 2021

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

@jg572h
Copy link

jg572h commented Aug 17, 2021

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

@enricodias
Copy link

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

@peterswords
Copy link

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.

@jimSampica
Copy link

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 git@github.com:myName/myRepo.git

now fetch works properly

@nirodaonline
Copy link

nirodaonline commented Oct 7, 2021

@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)

@lacraig2
Copy link

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

@tfitzpatrickSymplr
Copy link

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

@eamodio
Copy link
Member

eamodio commented Mar 10, 2022

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

@nirodaonline
Copy link

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.

@gonssal
Copy link

gonssal commented Jun 23, 2022

@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.

@daliusbu
Copy link

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.

@MillerGregor
Copy link

I avoided this by switching my remote from https to ssh:

git remote set-url origin git@github.com:<org>/<repo>.git

of course, you'll need to set up ssh keys

@tachtler
Copy link

Hi,
with GitLens v13.1.1 under Linux, fetching a private Gitlab-Repository via HTTPS, the username will not be promted, only the password, BUT it ends up with following error:

[2022-12-10 10:55:28.258] /home/klaus/.vscode-oss/extensions/eamodio.gitlens-13.1.1-universal/dist/gitlens.js:12:8200
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch origin development:refs/remotes/origin/development
fatal: could not read Username for 'https://[REDACTED]': No such device or address```

Is this still a issue?

Thank you in advance!
Klaus.

@Alejo-Fonseca-Pyxis
Copy link

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.

I did this and it worked. I did a fetch on the default git manager in VS Code and after that I used Git Lents and didn't get the error again.

@nirodaonline
Copy link

I did this and it worked. I did a fetch on the default git manager in VS Code and after that I used Git Lents and didn't get the error again.

Did you store your credentials on the disk? Are you working locally or on a remote server?

I can confirm that this issue is still happening on a remote server: The username / password prompt appears when fetching from the command line / command palette , but not via the GitLens fetch button. I get the same error:

[2022-12-20 14:37:30.877] /home/----------/.vscode-server/extensions/eamodio.gitlens-13.1.1/dist/gitlens.js:12:8200 Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false fetch fatal: could not read Username for 'https://bitbucket.iucn.org': No such device or address

GitLens v13.1.1

foxwoods369 pushed a commit to foxwoods369/vscode-gitlens that referenced this issue Feb 2, 2023
…Username

Uses the core git fetch command instead of a command-line
git fetch so VsCode will prompt the user for their username
and password. Pull & push also use their corresponding core commands.
foxwoods369 pushed a commit to foxwoods369/vscode-gitlens that referenced this issue Feb 2, 2023
…Username

Uses the core git fetch command instead of a command-line
git fetch so VsCode will prompt the user for their username
and password. Pull & push also use their corresponding core commands.
foxwoods369 pushed a commit to foxwoods369/vscode-gitlens that referenced this issue Feb 20, 2023
…Username

Uses the core git fetch command instead of a command-line
git fetch so VsCode will prompt the user for their username
and password. Pull & push also use their corresponding core commands.
d13 pushed a commit to foxwoods369/vscode-gitlens that referenced this issue Mar 10, 2023
…Username

Uses the core git fetch command instead of a command-line
git fetch so VsCode will prompt the user for their username
and password. Pull & push also use their corresponding core commands.
d13 pushed a commit that referenced this issue Mar 10, 2023
Uses the core git fetch command instead of a command-line
git fetch so VsCode will prompt the user for their username
and password. Pull & push also use their corresponding core commands.
@d13
Copy link
Member

d13 commented Mar 10, 2023

Resolved with #2481

@d13 d13 closed this as completed Mar 10, 2023
@nezort11
Copy link

before...

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

then I ran

git remote set-url origin git@github.com:myName/myRepo.git

I had to change before:

https://github.com/Rock-n-block/d-etf

to

https://github.com/Rock-n-block/d-etf.git

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Want community input and/or pull request
Projects
None yet
Development

No branches or pull requests