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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch with ssh works, but pull does not. #2158

Open
nuke-web3 opened this issue Mar 25, 2024 · 6 comments
Open

Fetch with ssh works, but pull does not. #2158

nuke-web3 opened this issue Mar 25, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@nuke-web3
Copy link

Describe the bug

Fetch works... pull doesn't.

To Reproduce
Steps to reproduce the behavior:

  1. shift+f -> fetch remote, yubikey touch for SSH, works fine 馃憣
  2. p -> pull remote, yubikey touch for SSH, fetch failed: git error: Bad credentials. 馃槶

Context (please complete the following information):

Additional context

I have multiple ssh and gpg configs that occasionally will error on one that is incorrect, but then try another that is for git - I have not tried to see if that is the issue here, but I do not think it's at play in testing so far.

@nuke-web3 nuke-web3 added the bug Something isn't working label Mar 25, 2024
@nuke-web3 nuke-web3 mentioned this issue Mar 25, 2024
4 tasks
@nuke-web3
Copy link
Author

Update: I am testing against my fork and I can fetch from it and push just fine... but with the remote set to this repo, I get bad credentials on all pull/push/fetch operations 馃

So unclear why it kinda works on my remote, but nothing works on this as a remote 馃し

@extrawurst
Copy link
Owner

is there any addional info logged with gitui -l ?

@nuke-web3
Copy link
Author

gitui fetch from master here:

19:27:23 [TRACE] (1) gitui::app: [src/app.rs:395] update_async: Git(Status)
19:27:23 [DEBUG] (7) asyncgit::sync::remotes::callbacks: creds: 'git@github.com:extrawurst/gitui.git' Some("git") (CredentialType(SSH_KEY | SSH_MEMORY | SSH_CUSTOM))
19:27:26 [TRACE] (1) gitui::app: [src/app.rs:375] update
19:27:26 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 4778997356414528227] (type: WorkingDir)
19:27:26 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 12826884458498410352] (type: Stage)
19:27:26 [TRACE] (3) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 12826884458498410352 (type: Stage)
19:27:26 [TRACE] (1) gitui::app: [src/app.rs:395] update_async: Git(Status)
19:27:26 [TRACE] (2) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 4778997356414528227 (type: WorkingDir)
19:27:26 [TRACE] (1) gitui::app: [src/app.rs:395] update_async: Git(Status)
19:27:26 [DEBUG] (7) asyncgit::sync::remotes::callbacks: creds: 'git@github.com:extrawurst/gitui.git' Some("git") (CredentialType(SSH_KEY | SSH_MEMORY | SSH_CUSTOM))
19:27:26 [TRACE] (1) gitui::app: [src/app.rs:395] update_async: Git(Pull)
19:27:26 [ERROR] fetch error: git error:Bad credentials.
19:27:26 [TRACE] (1) gitui::app: [src/app.rs:375] update

gitui pull from master:

19:30:21 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 14121315089973767102] (type: Stage)
19:30:21 [TRACE] (3) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 14121315089973767102 (type: Stage)
19:30:21 [TRACE] (1) gitui::app: [src/app.rs:395] update_async: Git(Status)
19:30:21 [TRACE] (2) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 4965103449275967055 (type: WorkingDir)
19:30:21 [TRACE] (1) gitui::app: [src/app.rs:395] update_async: Git(Status)
19:30:22 [DEBUG] (7) asyncgit::sync::remotes::callbacks: creds: 'git@github.com:extrawurst/gitui.git' Some("git") (CredentialType(SSH_KEY | SSH_MEMORY | SSH_CUSTOM))
19:30:23 [DEBUG] (7) asyncgit::sync::remotes::callbacks: creds: 'git@github.com:extrawurst/gitui.git' Some("git") (CredentialType(SSH_KEY | SSH_MEMORY | SSH_CUSTOM))
19:30:23 [TRACE] (1) gitui::app: [src/app.rs:395] update_async: Git(Pull)
19:30:23 [ERROR] fetch error: git error:Bad credentials.
19:30:23 [TRACE] (1) gitui::app: [src/app.rs:375] update
19:30:23 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 13432677788232178716] (type: WorkingDir)
19:30:23 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 14977766551226020821] (type: Stage)
19:30:23 [TRACE] (3) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 14977766551226020821 (type: Stage)
19:30:23 [TRACE] (1) gitui::app: [src/app.rs:395] update_async: Git(Pull)
19:30:23 [TRACE] (1) gitui::app: [src/app.rs:395] update_async: Git(Status)
19:30:23 [TRACE] (2) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 13432677788232178716 (type: WorkingDir)
19:30:23 [TRACE] (1) gitui::app: [src/app.rs:395] update_async: Git(Status)
19:30:24 [TRACE] (1) gitui::app: [src/app.rs:375] update
19:30:24 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 14068606657252922944] (type: WorkingDir)

Seems maybe the pull fails once, then succeeds? could be related to round robin trying the SSH in the keyring...? I do have github set explicitly for one key in ~/.ssh/config:

Host github
    HostName github.com
    Port 22
    User git
    IdentitiesOnly yes
    IdentityFile ~/.ssh/github.pub

@extrawurst
Copy link
Owner

almost nothing from .ssh/config is currently supported by the libgit2 version we use (see #2096)

@Liso77
Copy link

Liso77 commented Apr 2, 2024

gitui fetch from master here:

...
19:27:26 [ERROR] fetch error: git error:Bad credentials.
...

Neither fetch is working (as you could see above). What is worse it fails quietly!

@cebarks
Copy link

cebarks commented May 19, 2024

I'm also running into this issue when pulling or pushing to a github repo with a yubikey-backed ssh key.

OS/Distro + Version: Fedora 40
GitUI Version: gitui nightly 2024-05-19
Rust version: rustc 1.80.0-nightly (b1ec1bd65 2024-05-18)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants