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
scp: fail on newer OpenSSH builds - protocol error: filename does not match request #52640
Comments
|
Files identified in the description: If these files are inaccurate, please update the |
|
An updated openssh had been shipped on ubuntu 16 & 18 now. Marking this as p2. It's a bit tricky as this isn't a regression so i don't think it blocks the 2.8 release but it is very important that we fix this |
|
@jborean93 @mattclay I think I found a way that we can quote compatibly: In other words, instead of passing interior quotes to scp, pass backslash escaped spaces to scp. |
|
@jborean93 @mattclay, yeah, the fix is to change connection/ssh.py to quote spaces in the remote path with backslashes instead of calling shell.quote() on them. |
|
Using |
|
Added a further comment on https://bugzilla.mindrot.org/show_bug.cgi?id=2966, will wait until we get a reply. While waiting for a reply I thought it best to recap this issue. Currently this should only affect you if;
If you are affected by this issue you have a few options to workaround this;
If you do come across any other scenario that we missed above, please let us know. |
|
@jborean93 Just making sure that you are going to have a PR to "fix" this? It looks like upstream isn't going to fix this interface that they broke and we've decided that we're going to just warn people when this problem occurs? rc1 is next week so all P2s should be fixed by next week. |
SUMMARY
A newer release of OpenSSH has included the commit openssh/openssh-portable@3d896c1 which adds validation around the file name returned by the server. This causes issues when scp is used to fetch a file as Ansible will use single quotes around the path causing a validation failure.
We've currently started to see this issue in #47732 and have added a workaround by setting
ansible_scp_extra_args: -Tto get the test working again but this should be removed once this has been fixed.This does not necessarily have to be handled in Ansible, this issue is just to keep track of the issue until further details can be gotten from OpenSSH. If left unfixed we may start seeing these issues the next time we build a new test container, currently the
defaultcontainer is affected.Potentially related to https://bugzilla.mindrot.org/show_bug.cgi?id=2966.
ISSUE TYPE
COMPONENT NAME
ssh
ANSIBLE VERSION
CONFIGURATION
N/A
OS / ENVIRONMENT
Linux with the latest OpenSSH build. This is something that affects the scp client and not the scp version on the target.
STEPS TO REPRODUCE
You can easily test this out by running a container that installs the latest nightly of OpenSSH.
EXPECTED RESULTS
The file is fetched without any issues
ACTUAL RESULTS
You can manually run the scp command outside of Ansible to verify that this is what scp is returning. More specifically it's the fact that the path of the remote file is enclosed in single quotes like
'[host.docker.internal]:'"'"'/tmp/file space.txt'"'"''The text was updated successfully, but these errors were encountered: