| Summary: | Pushing to a non-default remote sends wrong host info | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mark Macdonald <mamacdon> | ||||||||
| Component: | Git | Assignee: | Bartosz Grabski <bartosz.grabski> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | Maciej Bendkowski <maciej.bendkowski> | ||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | elijahe, maciej.bendkowski | ||||||||
| Version: | 5.0 | Flags: | maciej.bendkowski:
review+
|
||||||||
| Target Milestone: | 6.0 M2 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows 7 | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Mark Macdonald
Created attachment 241119 [details]
knownHosts while in problematic state
We didn't capture any network traffic while in the endless-dialogs state.
However we did capture the state of his knownHosts storage after he had clicked OK to the 'add key' dialog (note the entry for dev.eclipse.org).
Created attachment 241279 [details]
HAR showing the problem
Just hit this problem myself. I captured a network log this time. In this case I have 2 remotes: 'origin' (the default) and 'github'. I was trying to push my local master branch to github/master.
From the Git Status page
1. Click Push > Push Branch.
2. Branch prompt appears. Click more, then expand github and select github/master. Click OK
3. "Would you like to add ssh-rsa key for host github.com ...?" -- Click OK.
4. Repeat step 3 forever, or until you get tired of clicking OK.
Attaching Chrome header archive (HAR) log.
Created attachment 241280 [details]
HAR showing the problem
Previous HAR was incomplete-- this is the correct version.
What causes this bug is pushing to a remote that is not the current value of 'branch.master.remote'. In my case, it failed because my repo had branch.master.remote=origin and I was trying to push to 'github'. This put me in endless-dialog world. The good news is, when you get into endless-dialog world, you can reload the page and try again, and it will work.. That's because behind the scenes, the Push dialog sets 'branch.master.remote' equal to whatever remote you're trying to push to. But it doesn't seem to take effect until you reload the page. After a reload, since you're now pushing to the current value of branch.master.remote, it works OK. Mark, have you captured your local storage contents at the time the issue occurred? I'd guess that while pushing to a non-default remote we're sending the wrong known hosts content, hence getting rejected. After that, we're prompting for the known hosts again (even though we already have them stored), and so on. Probably the default remote's known hosts are used even though you're pushing to a different remote. (In reply to Maciej Bendkowski from comment #5) > I'd guess that while pushing to a non-default remote we're sending > the wrong known hosts content, hence getting rejected. After that, we're > prompting for the known hosts again (even though we already have them > stored), and so on. Probably the default remote's known hosts are used even > though you're pushing to a different remote. Yeah, I think you're right. My localStorage looks like this: > > localStorage.getItem("mamacdon/knownHosts") > [{"host":"github.com","port":22,"keyType":"ssh-rsa","hostKey":"AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="}] ... But this is what the push request actually sends to the server: > POST https://hub.jazz.net/code/gitapi/remote/github/master/file/Gc/mamacdon%20%7C%20unicrud/ > { > Force: false, > GitSshKnownHost: "", // ! > GitSshPassphrase: "", > GitSshPassword: "", > GitSshPrivateKey: "", > GitSshUsername: "", > PushSrcRef: "HEAD", > PushTags: false > } If I craft a knownHosts entry for the default remote, it gets sent in the request. Bartek, I think you could take a look at it. Proposed fix https://git.eclipse.org/r/#/c/27282/ I additionally introduced a fix for a similar issue with fetch command on status page. I had two remotes (origin, remote1). While fetching from another remote it kept displaying the "would you like to add..." prompt forever. Pushed to master. Thanks Bartek! |