When the SSH daemon and client have a race condition
Example from support:
The CLI tried to establish a connection at 17:07:30
On the build machine, the public SSH key was injected into the authorized_keys at 17:07:31
CLI closed the session immediately, instead of retrying.
When the exported SSH key has no rights to access the job.
Previously we would simply fail. Now we display a meaningful message.
Examples
✲ ~/code/cli (ssh-connection-test) sem debug job aa63c7dd-49de-4897-bea6-6a8d36ced508
* Creating debug session for job 'aa63c7dd-49de-4897-bea6-6a8d36ced508'
* Setting duration to 60 minutes
* Waiting for debug session to boot up ...
* Waiting for ssh daemon to become ready ....................
[ERROR] SSH connection can't be established; Permission denied (publickey); exit status 255
* Stopping debug session ..
* Session stopped
✲ ~/code/cli (ssh-connection-test) sem debug job aa63c7dd-49de-4897-bea6-6a8d36ced508
* Creating debug session for job 'aa63c7dd-49de-4897-bea6-6a8d36ced508'
* Setting duration to 60 minutes
* Waiting for debug session to boot up .....
* Waiting for ssh daemon to become ready .
Semaphore CI Debug Session.
- Checkout your code with `checkout`
- Run your CI commands with `source ~/commands.sh`
- Leave the session with `exit`
Documentation: https://docs.semaphoreci.com/article/75-debugging-with-ssh-access.
semaphore@semaphore-vm:~$ exit
logout
Connection to 235.204.56.15 closed.
* Stopping debug session ..
* Session stopped
This PR improves two cases:
When the SSH daemon and client have a race condition
Example from support:
CLI closed the session immediately, instead of retrying.
When the exported SSH key has no rights to access the job.
Previously we would simply fail. Now we display a meaningful message.
Examples