Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cannot push with an ssh alias - failed to resolve address #496

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

Open
mckellygit opened this issue Jan 20, 2021 · 23 comments
Open

Cannot push with an ssh alias - failed to resolve address #496

mckellygit opened this issue Jan 20, 2021 · 23 comments
Labels
help wanted Extra attention is needed

Comments

@mckellygit
Copy link

Hi,

Thank you so much for gitui.
I cannot push from gitui, always getting the error -

[ERROR] push error: git error:failed to resolve address for github.com-foo: Name or service not known; class=Net (12)

But git push works fine from the cmdline.
I have in my .ssh/config the alias -

Host github.com-foo
HostName github.com

Is there a way around this ?

I am using version gitui v0.11.0 on Ubuntu 18.04

thx,
-m

@mckellygit
Copy link
Author

@extrawurst Does git2-rs using libgit2 also bring in libssh ?

@and-0-1
Copy link

and-0-1 commented Jun 13, 2021

Yeah - i am having the same issue

@ViridiFox
Copy link

I found a way around this error message by changing the host in my ssh config from github.com-foo to foo.github.com, but now it hangs up, repeating in the logs:

15:23:05 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:352] update
15:23:05 [TRACE] (6) mio::poll: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.13/src/poll.rs:478] registering event source with poller: token=Token(0), interests=READABLE
15:23:05 [TRACE] (6) mio::poll: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.13/src/poll.rs:478] registering event source with poller: token=Token(1), interests=READABLE
15:23:05 [TRACE] (1) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:95] request: [hash: 89737437399671470] (type: WorkingDir)
15:23:05 [TRACE] (1) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:95] request: [hash: 11904231227679536291] (type: Stage)
15:23:05 [TRACE] (5) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:151] status fetched: 11904231227679536291 (type: Stage)
15:23:05 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:371] update_async: Git(Status)
15:23:05 [TRACE] (2) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:151] status fetched: 89737437399671470 (type: WorkingDir)
15:23:05 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:371] update_async: Git(Status)
15:23:07 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:280] event: Input(Key(KeyEvent { code: Char('f'), modifiers: NONE }))
15:23:07 [TRACE] (1) asyncgit::fetch: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/fetch.rs:70] request
15:23:07 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:352] update
15:23:07 [TRACE] (1) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:95] request: [hash: 4284137435065681905] (type: WorkingDir)
15:23:07 [TRACE] (1) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:95] request: [hash: 11035345982447737487] (type: Stage)
15:23:07 [TRACE] (2) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:151] status fetched: 11035345982447737487 (type: Stage)
15:23:07 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:371] update_async: Git(Status)
15:23:07 [TRACE] (3) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:151] status fetched: 4284137435065681905 (type: WorkingDir)
15:23:07 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:371] update_async: Git(Status)
15:23:10 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:352] update
...
15:23:35 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:352] update
15:23:35 [TRACE] (1) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:95] request: [hash: 14911695346240988513] (type: WorkingDir)
15:23:35 [TRACE] (1) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:95] request: [hash: 16499679971357477691] (type: Stage)
15:23:35 [TRACE] (5) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:151] status fetched: 16499679971357477691 (type: Stage)
15:23:35 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:371] update_async: Git(Status)
15:23:35 [TRACE] (3) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:151] status fetched: 14911695346240988513 (type: WorkingDir)
15:23:35 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:371] update_async: Git(Status)
15:23:40 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:352] update
15:23:40 [TRACE] (1) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:95] request: [hash: 3477886633936259483] (type: WorkingDir)
15:23:40 [TRACE] (1) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:95] request: [hash: 14388519014811246931] (type: Stage)
15:23:40 [TRACE] (3) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:151] status fetched: 14388519014811246931 (type: Stage)
15:23:40 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:371] update_async: Git(Status)
15:23:40 [TRACE] (2) asyncgit::status: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.17.0/src/status.rs:151] status fetched: 3477886633936259483 (type: WorkingDir)
15:23:40 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:371] update_async: Git(Status)
15:23:41 [TRACE] (1) gitui::app: [/home/viridi/.cargo/registry/src/github.com-1ecc6299db9ec823/gitui-0.17.0/src/app.rs:280] event: Input(Key(KeyEvent { code: Char('c'), modifiers: CONTROL }))

using gitui 0.17.0

@extrawurst
Copy link
Collaborator

@ViridiCanis what does hangup mean exactly?

@ViridiFox
Copy link

I used pull instead of push compared to OP, and it says "Pull" "preparing". the loading symbol top left next to status keeps moving, but nothing else happens

@extrawurst
Copy link
Collaborator

I used pull instead of push compared to OP, and it says "Pull" "preparing". the loading symbol top left next to status keeps moving, but nothing else happens

hm I never had these issues. so I depend on you to help me on this. I pushed to a branch debug-496-fetch and if you build from this and run with logging could you provide me with the full log? feel free to send it to me via email if you don't want to paste it here or on gist.

@ViridiFox
Copy link

pull at 16:34:25
gitui.log

@ViridiFox
Copy link

I changed my setup to use keychain in my shell's startup script, and gitui works normally. Still don't know how to fix it with only using ssh-agent.

@mckellygit
Copy link
Author

mckellygit commented Sep 11, 2021

Hi,

hm I never had these issues. so I depend on you to help me on this.

Do you have a .ssh/config with a Host entry that is not a real hostname ?
I have an arbitrary label for Host that will never resolve to a network address.
git tools use the Hostname entry for this label. I get a feeling this indirection is not happening here ??
Just guessing at that though.
thx,
-m

@realtica
Copy link

Same Issue here, gitui 0.16.2

@extrawurst extrawurst added the help wanted Extra attention is needed label Sep 14, 2021
@wennaspeedy
Copy link

Same here 0.18.0

@dr-kristau
Copy link

Same here 0.19.0

@extrawurst
Copy link
Collaborator

@mckellygit I can't find anything conclusive here but it seems libssh2 is not reading the config and applying these aliases

@PhlegmaTREEc
Copy link

I changed my setup to use keychain in my shell's startup script, and gitui works normally. Still don't know how to fix it with only using ssh-agent.

@ViridiCanis Hey, could you please provide more info on how to do that?

@ViridiFox
Copy link

@Phl3gmaTREEc sorry, it's been a while since I used it and I can't get it to work again. It should just be installing keychain and adding keychain -q --eval [list of keys] | eval to your shell's startup script.
But currently I'm getting problems with gitui (git cli works), where with my normal key without alias, there is an auth sock problem (also affects ssh-add) and with my other one with alias it is the same as original issue.

@mckellygit
Copy link
Author

@extrawurst I agree. Maybe see -
libgit2/libgit2#4338
Could maybe one day libssh be used instead ?
I will try to look around. thx.

@stale
Copy link

stale bot commented Sep 28, 2022

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label Sep 28, 2022
@dr-kristau
Copy link

I can still reproduce this in 0.21.0

@stale stale bot removed the dormant Marked by stale bot on close label Sep 28, 2022
@stale
Copy link

stale bot commented May 21, 2023

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label May 21, 2023
@JKubovy
Copy link

JKubovy commented May 22, 2023

AFAIK it's still relevant

@stale stale bot removed the dormant Marked by stale bot on close label May 22, 2023
@extrawurst
Copy link
Collaborator

libgit2/libgit2#6617 - soon supported by upstream

Copy link

stale bot commented Mar 17, 2024

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label Mar 17, 2024
@JKubovy
Copy link

JKubovy commented Mar 23, 2024

Still relevant. What's the status of implementation if the libgit2 library integrates OpenSSH support?

@stale stale bot removed the dormant Marked by stale bot on close label Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants