gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Cannot push with an ssh alias - failed to resolve address

Open mckellygit opened this issue 4 years ago • 23 comments

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 avatar Jan 20 '21 01:01 mckellygit

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

mckellygit avatar Apr 09 '21 01:04 mckellygit

Yeah - i am having the same issue

andoni0305 avatar Jun 13 '21 03:06 andoni0305

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

ViridiFox avatar Aug 31 '21 15:08 ViridiFox

@ViridiCanis what does hangup mean exactly?

extrawurst avatar Aug 31 '21 15:08 extrawurst

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

ViridiFox avatar Aug 31 '21 16:08 ViridiFox

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.

extrawurst avatar Aug 31 '21 16:08 extrawurst

pull at 16:34:25 gitui.log

ViridiFox avatar Aug 31 '21 16:08 ViridiFox

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.

ViridiFox avatar Sep 05 '21 08:09 ViridiFox

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

mckellygit avatar Sep 11 '21 20:09 mckellygit

Same Issue here, gitui 0.16.2

realtica avatar Sep 14 '21 01:09 realtica

Same here 0.18.0

wennaspeedy avatar Oct 21 '21 07:10 wennaspeedy

Same here 0.19.0

dr-kristau avatar Dec 22 '21 13:12 dr-kristau

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

extrawurst avatar Jan 22 '22 16:01 extrawurst

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?

PhlegmaTREEc avatar Feb 17 '22 16:02 PhlegmaTREEc

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

ViridiFox avatar Feb 17 '22 17:02 ViridiFox

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

mckellygit avatar Feb 18 '22 13:02 mckellygit

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[bot] avatar Sep 28 '22 04:09 stale[bot]

I can still reproduce this in 0.21.0

dr-kristau avatar Sep 28 '22 09:09 dr-kristau

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[bot] avatar May 21 '23 11:05 stale[bot]

AFAIK it's still relevant

JKubovy avatar May 22 '23 10:05 JKubovy

https://github.com/libgit2/libgit2/pull/6617 - soon supported by upstream

extrawurst avatar Aug 31 '23 08:08 extrawurst

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[bot] avatar Mar 17 '24 15:03 stale[bot]

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

JKubovy avatar Mar 23 '24 11:03 JKubovy