[PR #198] [CLOSED] fix: try multiple ssh keys for push actions #198

Closed
opened 2026-03-04 00:41:51 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/thegeeklab/git-sv/pull/198
Author: @pat-s
Created: 5/23/2025
Status: Closed

Base: mainHead: fix/ssh-keys


📝 Commits (1)

  • c9aae1a fix: try multiple ssh keys

📊 Changes

1 file changed (+143 additions, -3 deletions)

View changed files

📝 app/app.go (+143 -3)

📄 Description

fix #192

Finally had time to debug this.

The main reason why it failed was because my id_rsa wasn't avail on this specific forge. The current implementation in git-sv currently only checks a single key and doesn't try/look for others.

On another forge it worked OOB because there my id_rsa was configured. This explain why I saw the flacky behavior.

The "handshake key mismatch" error is subsequently a (soft) false-positive.

/Users/pjs/git/github.com/thegeeklab/git-sv/dist/git-sv --log-level trace tag
9:08PM DBG Creating tag annotate=false local=false tag=v0.1.0
9:08PM DBG Tag created successfully tag=v0.1.0
9:08PM DBG Preparing to push tag to remote tag=v0.1.0
9:08PM DBG Got remote repository details remote={"Fetch":["+refs/heads/*:refs/remotes/origin/*"],"Mirror":false,"Name":"origin","URLs":["ssh://git@codefloe.com/devxy/helm-rdepot.git"]}
9:08PM DBG Pushing tag with refspec refSpec=refs/tags/v0.1.0:refs/tags/v0.1.0
9:08PM DBG Remote URL remoteURL=ssh://git@codefloe.com/devxy/helm-rdepot.git
9:08PM DBG Using SSH authentication
9:08PM DBG Using SSH key sshKeyPath=/Users/pjs/.ssh/id_rsa
9:08PM DBG Set custom HostKeyCallback for debugging
9:08PM DBG Push options details pushOptions="marshaling error: json: unsupported type: ssh.HostKeyCallback"
9:08PM DBG Ignoring host key verification hostname=codefloe.com:22
9:08PM ERR Failed to push tag error="ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain" tag=v0.1.0
9:08PM FTL Execution error error="error generating tag version: 0.1.0: failed to push tag: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain"

It works with the patches in this PR.

They are quite verbose (and vibe-coded), so you might want to take a look what level of detail you want to keep.
Maybe there is also another way to implement this in a more tidy way.
Some imports are anyhow duplicated and you surely don't like this 😄
Anyhow, feel free to take it from here, I am happy to test it afterwards :)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/thegeeklab/git-sv/pull/198 **Author:** [@pat-s](https://github.com/pat-s) **Created:** 5/23/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/ssh-keys` --- ### 📝 Commits (1) - [`c9aae1a`](https://github.com/thegeeklab/git-sv/commit/c9aae1a180e193487ae84e167d6ad76575b0fae0) fix: try multiple ssh keys ### 📊 Changes **1 file changed** (+143 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `app/app.go` (+143 -3) </details> ### 📄 Description fix #192 Finally had time to debug this. The main reason why it failed was because my `id_rsa` wasn't avail on this specific forge. The current implementation in `git-sv` currently only checks a single key and doesn't try/look for others. On another forge it worked OOB because there my `id_rsa` was configured. This explain why I saw the flacky behavior. The "handshake key mismatch" error is subsequently a (soft) false-positive. ``` /Users/pjs/git/github.com/thegeeklab/git-sv/dist/git-sv --log-level trace tag 9:08PM DBG Creating tag annotate=false local=false tag=v0.1.0 9:08PM DBG Tag created successfully tag=v0.1.0 9:08PM DBG Preparing to push tag to remote tag=v0.1.0 9:08PM DBG Got remote repository details remote={"Fetch":["+refs/heads/*:refs/remotes/origin/*"],"Mirror":false,"Name":"origin","URLs":["ssh://git@codefloe.com/devxy/helm-rdepot.git"]} 9:08PM DBG Pushing tag with refspec refSpec=refs/tags/v0.1.0:refs/tags/v0.1.0 9:08PM DBG Remote URL remoteURL=ssh://git@codefloe.com/devxy/helm-rdepot.git 9:08PM DBG Using SSH authentication 9:08PM DBG Using SSH key sshKeyPath=/Users/pjs/.ssh/id_rsa 9:08PM DBG Set custom HostKeyCallback for debugging 9:08PM DBG Push options details pushOptions="marshaling error: json: unsupported type: ssh.HostKeyCallback" 9:08PM DBG Ignoring host key verification hostname=codefloe.com:22 9:08PM ERR Failed to push tag error="ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain" tag=v0.1.0 9:08PM FTL Execution error error="error generating tag version: 0.1.0: failed to push tag: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain" ``` It works with the patches in this PR. They are quite verbose (and vibe-coded), so you might want to take a look what level of detail you want to keep. Maybe there is also another way to implement this in a more tidy way. Some imports are anyhow duplicated and you surely don't like this 😄️ Anyhow, feel free to take it from here, I am happy to test it afterwards :) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 00:41:51 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-sv#198
No description provided.