Skip to content
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

bass --runner with protected ssh key fails (ssh-agent support?) #196

Open
srenatus opened this issue Jun 19, 2022 · 5 comments
Open

bass --runner with protected ssh key fails (ssh-agent support?) #196

srenatus opened this issue Jun 19, 2022 · 5 comments
Labels
cryptic A cryptic error message was returned by Bass

Comments

@srenatus
Copy link
Contributor

When I run bass --runner [email protected], I get this:

1: [8.91s] 10:27:59.557	error	failed to parse key	{"error": "ssh: this private key is passphrase protected", "key": "id_ed25519"}
1: [8.91s] 10:27:59.557	info	serving runtimes	{"host": "github.bass-lang.org", "port": "6455", "user": "srenatus"}
1: [9.26s] 10:27:59.904	error	failed to dial	{"error": "ssh: handshake failed: knownhosts: key is unknown"}

The error is accurate, the ssh key I use with github is password-protected. However, it's unlocked with the ssh-agent:

$ ssh [email protected]                                
PTY allocation request failed on channel 0
Hi srenatus! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
@srenatus srenatus added the cryptic A cryptic error message was returned by Bass label Jun 19, 2022
@vito
Copy link
Owner

vito commented Jun 29, 2022

bass --runner actually tries to use the agent if you have $SSH_AUTH_SOCK set, but it looks like it didn't use it in this case. Is that env set?

socket, hasAgent := os.LookupEnv("SSH_AUTH_SOCK")

You'll also need to add the remote SSH host key to ~/.ssh/known_hosts (sorry, I don't think this is documented atm) to avoid the error in the last line there:

ssh-keyscan -p 6455 github.bass-lang.org >> ~/.ssh/known_hosts

Hope this helps!

@srenatus
Copy link
Contributor Author

Sorry I've dropped the ball here -- just now tried to run this again. 😅

$ echo $SSH_AUTH_SOCK
/private/tmp/com.apple.launchd.azCoQjXH1l/Listeners

I now get an error still, but it seems to be doing something afterwards:

vito/bass % bass --runner [email protected]
20:31:12.541	error	failed to parse key	{"error": "ssh: this private key is passphrase protected", "key": "id_ed25519"}
=> [ssh] forward --os linux --arch amd64 [214.3s]
 ▕ 18:31:14.413    info    registered  {"side": "server"}                                                                                                                                                                                                                                                                            
 ▕ 18:32:14.415    debug   heartbeated {"side": "server"}                                                                                                                                                                                                                                                                            
 ▕ 18:33:14.415    debug   heartbeated {"side": "server"}                                                                                                                                                                                                                                                                            
 ▕ 18:34:14.414    debug   heartbeated {"side": "server"}                                                                                                                                                                                                                                                                            
=> bass --runner [email protected] [214.6s]
 ▕ 20:31:13.901    info    serving runtime {"platform": "os=linux, arch=any", "hosts": ["github.bass-lang.org:6455"], "user": "srenatus"}     

That said, a previously opened PR (#252) didn't seem to be run there 🤔 I might be misunderstanding something still, though.

@vito
Copy link
Owner

vito commented Sep 17, 2022

Looks like it's working, that error log is probably just noise; it'll try each key, and judging by the heartbeats it eventually tried the agent which worked.

Here's the run that ties to #252: https://loop.bass-lang.org/runs/4fcc96b4-d550-47fb-af1f-09d882b8e4a5 - it looks like it wasn't able to find any runtimes.

Maybe the PR was opened before the runner was up? 🤔

@srenatus
Copy link
Contributor Author

Maybe the PR was opened before the runner was up? 🤔

Yes indeed. What can I do now? Close and re-open or open a new one?

@vito
Copy link
Owner

vito commented Sep 17, 2022

Yeah, it failed at an early phase before checks could even be created so there's nothing to re-run unfortunately. Still need to fix that flow.

One thing you can do is just amend (maybe tweak the commit message) and force-push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cryptic A cryptic error message was returned by Bass
Projects
None yet
Development

No branches or pull requests

2 participants