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

[chef/chef]Knife SSH to Windows 2016 hangs unexpectedly #9447

Open
dheerajd-msys opened this issue Mar 5, 2020 · 1 comment · May be fixed by #9482
Open

[chef/chef]Knife SSH to Windows 2016 hangs unexpectedly #9447

dheerajd-msys opened this issue Mar 5, 2020 · 1 comment · May be fixed by #9482

Comments

@dheerajd-msys
Copy link
Contributor

@dheerajd-msys dheerajd-msys commented Mar 5, 2020

Description

The knife ssh subcommand “freezes” after printing the name of a remote Windows 2016 host.
The knife ssh process doesn’t get into the ch.on_requst “exit-status” block on Windows 2016. It does on Ubuntu hosts.
Command output does not print to screen.
There are no issues connecting via native SSH client or executing commands via native SSH client on Windows 2016 hosts.

Related Issues

chef/customer-bugs#115
https://getchef.zendesk.com/agent/tickets/23906

Chef Version

Platform Version

Replication Case

The possre_openssh recipe is attached to the Zendesk ticket.

// Steps to reproduce (kitchen)

Apply possre_openssh recipe to Windows 2016 host via WinRM transport.
Change transport to ssh.

// Steps to reproduce (datacenter)

Apply possre_openssh recipe to Windows 2016 host.
Run commands like knife ssh 'name:ms53885.starbucks.net' 'dir' -x m-00169-6 -Pcat ~/.169-6 -C 1. (attached: knife_ssh_command_ouput_1.png and knife_ssh_command_output_2.png)`.

// Steps to validate OpenSSH configuration

Apply possre_openssh recipe to Windows 2016 host.
Connect via native client e.g. ssh foo@server.com -> success.
Run remote command via native client e.g. ssh foo@server.com ‘ls’ -> success.
Use attached test_ssh.txt to leverage Net::SSH.start on Windows 2016 host -> success.

Expected Behaviour

Knife SSH should work on Windows 2016 the same way it does on Windows 2019

Actual Behaviour

using knife ssh (mac, windows, anything we've tried as client) to reach a windows host (as the ssh server) via ssh hangs and never reaches.

If the server is 2019 you can just add ssh via feature activation.

If you try 2016, open_ssh needs to be installed and configured on the windows server.

Same results either way. Haven't located the detailed ssh output but it doesn't show any difference up to the hang...

Client Output


Stacktrace

@dheerajd-msys

This comment has been minimized.

Copy link
Contributor Author

@dheerajd-msys dheerajd-msys commented Mar 9, 2020

Identified the issue, commenting out the line https://github.com/chef/chef/blob/master/lib/chef/knife/ssh.rb#L365 resolved the issue.
Figuring out possible solution.

@dheerajd-msys dheerajd-msys linked a pull request that will close this issue Mar 12, 2020
3 of 10 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.