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

BOSH CLI on Windows platform is holding file lock on ssh-known-hosts file prevent ssh child process to read it #585

Closed
shouah opened this issue Jan 10, 2022 · 4 comments
Assignees
Labels

Comments

@shouah
Copy link

shouah commented Jan 10, 2022

I'm using BOSH CLI v6.4.11 on 64-bits Windows 10 workstation with OpenSSH for Windows v8.6.

When executing "bosh ssh HOST_NAME" command, it fails unexpectedly as following:


Using deployment 'cf-*****'

Task 5448471. Done
No ED25519 host key is known for ****** and you have requested strict checking.
Host key verification failed.

Running SSH:
1 error occurred:
* Running command: 'ssh -tt -o ServerAliveInterval=30 -o ForwardAgent=no -o PasswordAuthentication=no -o IdentitiesOnly=yes -o IdentityFile=C:\Users*.bosh\tmp\ssh-priv-key1418698816 -o UserKnownHostsFile=C:\Users*.bosh\tmp\ssh-known-hosts3391161924 -o StrictHostKeyChecking=yes ****** -l bosh_28aebe2c0c1d491', stdout: '', stderr: '': exit status 255

Exit code 1**

Investigation shows the following behavior:

  1. bosh CLI creates the various .bosh/tmp/ssh-xxxx files
  2. however it holds onto the file handle/lock for the ssh-known-hosts-xxxx file
  3. then it launches the ssh CLI tool
  4. which then tries to open the ssh-known-hosts-xxx file but then encounters a sharing violation and dump the above output and then exit -- likely the ssh CLI is trying to open the file in edit mode to update the ssh key
  5. bosh CLI then closes the ssh-known-hosts-xxx file handle when it sees that the ssh CLI has exited

Request:
change the behavior of the bosh CLI to close the .bosh/tmp/ssh-xxxx files handles before launching the ssh CLI on windows to workaround the above file sharing violation issue so that the ssh CLI no longer experience the sharing violation -- or alternatively update bosh CLI to allow the ssh CLI to edit the ssh-known-hosts-xxx file

Additional note:
this issue is not seen when tested in other platforms

@rkoster rkoster self-assigned this Jan 13, 2022
@bosh-admin-bot
Copy link

This issue was marked as Stale because it has been open for 21 days without any activity. If no activity takes place in the coming 7 days it will automatically be close. To prevent this from happening remove the Stale label or comment below.

@shouah
Copy link
Author

shouah commented Feb 3, 2022

The following screenshot might help with the investigation.
bosh-cli-ssh-windows_issue

@bosh-admin-bot
Copy link

This issue was marked as Stale because it has been open for 21 days without any activity. If no activity takes place in the coming 7 days it will automatically be close. To prevent this from happening remove the Stale label or comment below.

@bosh-admin-bot
Copy link

This issue was closed because it has been labeled Stale for 7 days without subsequent activity. Feel free to re-open this issue at any time by commenting below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

3 participants