Running knife ssh against multiple hosts with a sudo command (e.g. knife ssh 'chef_environment:blah' 'sudo uptime') failed with an ArgumentError, while the same command without sudo worked fine. The bug was in the ssh session handling when a pseudo-terminal was needed for sudo across multiple sessions. The failure only appeared with sudo because that is what forced the pty allocation across the sessions.