question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fetch with ssh failed when succeed with bash

See original GitHub issue

Describe the bug

Unable to fetch origin with "Authentication failed. Some common reasons include:“

Version & OS

Win10 pro 19041.1165 Github desktop Ver 2.9.0 (x64)

Steps to reproduce the behavior

See actual behaviour.

Expected behavior

Fetch just like git bash.

Actual behavior

Poped windows when fetch.

Bash behaviour:

$ which ssh-agent
/usr/bin/ssh-agent
(base)

$ git -c credential.helper= fetch --progress --prune origin -v
 = [up to date]      main              -> origin/main
 = [up to date]      Modelling         -> origin/Modelling
 = [up to date]      analytic-solution -> origin/analytic-solution
(base)

git config about ssh:

[core]
	sshCommand = "ssh"

(ssh.exe is in C:\Program Files\Git\usr\bin)

ssh config:

Host uni.github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/uni

github repo remote: git@uni.github.com:my_user_name/my_repo_name.git

Screenshots

Add screenshots to help explain your problem, if applicable.

Logs

2021-08-17T12:45:23.384Z - info: [ui] [RepositoryIndicatorUpdater]: Refreshing sidebar indicators for 22 repositories took 14.7s of which 0.0s paused, total 14.7s 2021-08-17T12:47:56.686Z - info: [ui] Executing fetch: git -c credential.helper= fetch --progress --prune origin (took 1.640s) 2021-08-17T12:47:56.686Z - error: [ui] git -c credential.helper= fetch --progress --prune origin exited with an unexpected code: 128. stderr: git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

(The error was parsed as 2: Authentication failed. Some common reasons include:

  • You are not logged in to your account: see File > Options.
  • You may need to log out and log back in to refresh your token.
  • You do not have permission to access this repository.
  • The repository is archived on GitHub. Check the repository settings to confirm you are still permitted to push commits.
  • If you use SSH authentication, check that your key is added to the ssh-agent and associated with your account.)

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
stevewardcommented, Aug 18, 2021

@Clevin49958 any chance you mistyped your passphrase? There was a bug that is now fixed where the app would store an invalid passphrase.

0reactions
stevewardcommented, Sep 8, 2021

@Clevin4958 based on your reply it sounds like you were able to get things working, so I am going to close this out. Let us know if you are still having issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git fetch command succeeds at command line but fails in bash ...
the above command succeeds if I issue it from a terminal, but if I put it in a bash script, it will fail,...
Read more >
How to Fix SSH “Permission Denied” with Git Clone - Medium
While this warning won't let you proceed any further, there is a simple fix to it. Set the file permissions to 600 (owner...
Read more >
Quick GitHub 'Permission denied (publickey)' SSH error fix
You have not configured your public SSH key in your GitHub account; You must create GitHub SSH keys to be used by the...
Read more >
'Transfer failed': error during datalad get from remote ssh server
Hi everyone! My problem: I've been trying to download data from my remote repo using datalad get /path/to/file and obtained the following ...
Read more >
Troubleshooting SSH errors - Compute Engine - Google Cloud
SSH troubleshooting tool. Run the troubleshooting tool; Review the results. Common SSH errors. Linux errors; Windows errors. Diagnose failed SSH connections.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found