-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
bad credentials despite normal cli being fine #495
Comments
The same. |
Unfortunately I cannot reproduce the issue. Anything special about the way you push? |
Thanks for a quick reply, Stephan! |
i think the issues is in the fact gitui does git push <branch_name> instead of git push origin <branch_name>. Is there any way to make the latter the default push option? |
can you share the way your remote is setup in
|
since you use the brew-version it only supports pushing to |
My remote is setup in this way: [core] And if i do git push <branch_name> from the cli, i get Please make sure you have the correct access rights |
@dmytro-tolkodubov I cannot see anything obviously problematic unfortunately. |
@extrawurst did execute with -l flag, but can't find the file with with the log output :). |
|
Ah, thanks! This is what i see there:
|
you did not try to push in that session |
i think i did, here is the error line (did not paste the whole log, it is a bit bigger)
|
Ok I have no idea what's happening there. |
Thanks for the great tool though! |
Thanks man, the push feature is still quiet new and there are so many flavours of how this can fail, but I am sure we will find the culprit of this. Two things for you to keep in mind: |
Thanks! There were no creds, but some info i thought i would not publish, not something confidential :) |
Same issue on macOS, but Linux works fine. Using My config:
Log:
|
dirs-next docs say it is supposed to be here: would be cool if you could validate this on windows and make PR for the readme to extend the documentation for where to find the win logs |
@extrawurst created PR #579 for readme. |
Log:
|
Platform: OSX 10.15.7 Same here. Our git repo lives behind VPN. If I try to pull/push without connecting to it from console it will yield error after some timeout.
But when I am connected it fetch/push just fine from console, but gitui for some reason fails and displays two modal windows:
|
Is it that you are using 2 factor authentication on github? i had the same problem and you need to generate a personal access token and enter that instead of your password |
Enter that where? |
We don't use 2fa, just regular ssh keys via vpn connection |
I have to rerun the |
This is largely a libssh2 issue (it doesn't parse
ssh-agent will not start when you're ssh'd into a box (since an ssh-agent-based workflow would run on the client side, not on the server side), but libssh2 is forcing this incorrect configuration to exist. |
A quick note related to libssh2 and A workaround for me was to use this form when checking out: The result is that I can now push and pull from gitui :) Thanks for the wonderful tool, by the way! |
If you're using the Github CLI This means that for me (Mac M1), the previous So what I did instead in order to get gitui to work (and btw, it also fixed lazygit as well), is Basically, pay attention to your exact key ssh key format, and add that one to the ssh agent. |
I was about to add to this bug report, but in doing my due dilligence I did manage to make it work through a combination of the above and adding the relevant SSH key to my SSH-Agent (which may be important since I have a bunch of keys and keep them in a non-standard folder). Leaving this comment mainly to help anyone else who happens to come upon this issue: The solution for me is to use the |
I'm still experience this issue on macOS v13.2, I followed every steps in Here is the log
|
if I have a remote like
Note the ~5 minutes of nothing in the log between lines 35 & 36 |
On Windows11 , after started OpenSSH Authentication Agent service , and run |
this worked for me, thank you. |
|
git-push figures out this from os environment and overall has complicated resolution logic as for general ssh connections as for commit signing. AFAIK it wasn't implemented yet inside underlying library on the rust side so it's impossible to do the same what regular git does. That's require some expertise in a field and that's why this issue marked as |
Do you think it will be possible to add a popup to add the password to push? |
Maybe you could try this to manage multiple Git Identities: https://github.com/InderdeepBajwa/gitid |
@extrawurst the problem still persists. In the past I had no pushing problems with gitui. Looks like the problem has returned with the some latest changes. |
Same here, on a Linux box: % gitui --version
gitui 0.24.3
% ssh-agent -k
% eval $(ssh-agent)
% ssh-add ~/.ssh/id_ed25519
% ssh-add -l
256 SHA256:... user@host (ED25519)
# a single entry
% gitui -l
# Then push (press 'p')
% cat ~/.cache/gitui/gitui.log
10:03:55 [TRACE] (1) gitui::app: [src/app.rs:123] open repo at: RefCell { value: Path(".") }
10:03:55 [TRACE] (6) mio::poll: [/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-0.8.5/src/poll.rs:532] registering event source with poller: token=Token(0), interests=READABLE
10:03:55 [TRACE] (6) mio::poll: [/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-0.8.5/src/poll.rs:532] registering event source with poller: token=Token(1), interests=READABLE
10:03:55 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 7003927015617394622] (type: WorkingDir)
10:03:55 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 7177724718573686462] (type: Stage)
10:03:55 [TRACE] (5) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 7177724718573686462 (type: Stage)
10:03:55 [TRACE] (1) gitui: [src/main.rs:216] app start: 32 ms
10:03:55 [TRACE] (1) gitui::app: [src/app.rs:497] update
10:03:55 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:96] request blocked, still pending
10:03:55 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 7020450438269687951] (type: Stage)
10:03:55 [TRACE] (3) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 7003927015617394622 (type: WorkingDir)
10:03:55 [TRACE] (2) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 7020450438269687951 (type: Stage)
10:03:55 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Status)
10:03:55 [TRACE] (1) asyncgit::diff: [asyncgit/src/diff.rs:98] request DiffParams { path: ".gitignore", diff_type: WorkDir, options: DiffOptions { ignore_whitespace: false, context: 3, interhunk_lines: 0 } }
10:03:55 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Branches)
10:03:55 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Status)
10:03:55 [TRACE] (1) asyncgit::diff: [asyncgit/src/diff.rs:98] request DiffParams { path: ".gitignore", diff_type: WorkDir, options: DiffOptions { ignore_whitespace: false, context: 3, interhunk_lines: 0 } }
10:03:55 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Status)
10:03:55 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Diff)
10:03:56 [TRACE] (1) gitui::app: [src/app.rs:400] event: Input(Key(KeyEvent { code: Char('p'), modifiers: NONE, kind: Press, state: NONE }))
10:03:56 [INFO] push: branch '...' has no upstream - looking up default remote
10:03:56 [INFO] push: branch '...' to remote 'origin'
10:03:56 [TRACE] (1) asyncgit::push: [asyncgit/src/push.rs:82] request
10:03:56 [TRACE] (1) gitui::app: [src/app.rs:497] update
10:03:56 [TRACE] (1) asyncgit::diff: [asyncgit/src/diff.rs:98] request DiffParams { path: ".gitignore", diff_type: WorkDir, options: DiffOptions { ignore_whitespace: false, context: 3, interhunk_lines: 0 } }
10:03:56 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 17309418712830783626] (type: WorkingDir)
10:03:56 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 1663522749782520975] (type: Stage)
10:03:56 [TRACE] (3) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 1663522749782520975 (type: Stage)
10:03:56 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Diff)
10:03:56 [TRACE] (4) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 17309418712830783626 (type: WorkingDir)
10:03:56 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Status)
10:03:56 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Status)
10:03:56 [ERROR] push error: git error:failed to start SSH session: Unable to exchange encryption keys; class=Ssh (23)
10:03:56 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Push)
10:03:56 [TRACE] (1) gitui::app: [src/app.rs:497] update
10:03:56 [TRACE] (1) asyncgit::diff: [asyncgit/src/diff.rs:98] request DiffParams { path: ".gitignore", diff_type: WorkDir, options: DiffOptions { ignore_whitespace: false, context: 3, interhunk_lines: 0 } }
10:03:56 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 16374901233706118069] (type: WorkingDir)
10:03:56 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 13765958480891183974] (type: Stage)
10:03:56 [TRACE] (5) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 13765958480891183974 (type: Stage)
10:03:56 [TRACE] (4) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 16374901233706118069 (type: WorkingDir)
10:03:56 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Push)
10:03:56 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Diff)
10:03:56 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Status)
10:03:56 [TRACE] (1) gitui::app: [src/app.rs:517] update_async: Git(Status)
10:03:58 [TRACE] (1) gitui::app: [src/app.rs:400] event: Input(Key(KeyEvent { code: Char('c'), modifiers: CONTROL, kind: Press, state: NONE })) |
any update on this? this is the only issue that keeps me from switching from lazygit |
This worked for me, and I created an alias for gitui in zshrc. |
I just came here to say this was super helpful, I both understood and the problem and the workaround is confirmed good! The only thing is that on my mac I had to modify it slightly (haven't tried it on Linux yet): Thank you! |
Adapting the workaround to nushell (there's no
Using a function is necessary at the moment according to nushell/nushell#10088. |
If you are using a systemd based distro don't mess around with trying to get your shell to auto start ssh-agent and run ssh-add Just create a user service that does that to do just create a file ~/.config/systemd/user/ssh-agent.service and put this as the file content
Then start and enable the service with
This will prevent creating multiple instances of the ssh-agent and works independent of whatever shell you use. |
I thought it was a good practice and tried it, but I'm sorry it didn't work for me. I'm not sure why, but it made me find that my previous command would start multiple ssh-agent but not destroy them.The right thing to do is to destroy the ssh-agent after the end of the gitui. The modified command should look like this.
-k means kill the current agent (given by the SSH_AGENT_PID environment variable). |
@kyruzic Thanks for the feedback. Your approach works in nushell if we also set |
I have verified this solution here too, although I only have the OpenSSH Authentication Agent service listed. Starting that seems to be all that's needed along with Cheers |
This solution works for me! Except that I had to change the command to gitui-ssh() {
key="${1:-$HOME/.ssh/id_rsa}"
eval "$(ssh-agent)" \
&& ssh-add "$key" \
&& command gitui "${@:2}" \
&& eval "$(ssh-agent -k)"
} |
|
On Mac, need run 'ssh-add --apple-use-keychain ~/.ssh/id_rsa', You need to do this every time the terminal restarts. |
Describe the bug
I can push from the command line normally
git push
, but pushing withingitui
always fails due to 'bad credentials'.To Reproduce
Commit some changes in
gitui
, pressp
to trigger a push. It always fails.Expected behavior
Pushing should succeed as my ssh key is valid and works outside of gitui.
Screenshots
If applicable, add screenshots to help explain your problem.
Context (please complete the following information):
Additional context
gitui
installed from cargo.The text was updated successfully, but these errors were encountered: