gekmihesg/ansible-openwrt

"sftp transfer mechanism failed" warnings

Closed this issue · 7 comments

When running my role via Ansible 2.9.4, I received the warning:

[WARNING]: sftp transfer mechanism failed on [router18]. Use ANSIBLE_DEBUG=1 to see detailed information

The above line appeared 5 times in the log.

I added scp_if_ssh = True under the [ssh_connection] heading in ansible.cfg (source) and the warning messages stopped. The role seems to work properly with or without this fix.

Alternatively, I think installing openssh-sftp-server on the guest would fix this (untested).

Perhaps this could be mentioned in README.md or similar.

Alternatively, I think installing openssh-sftp-server on the guest would fix this (untested).

I just tested it on 21.02, works fine.
opkg update && opkg install openssh-sftp-server

Rather than using the openssh-sftp-server, you can also use Dropbear in conjunction with the scp -O option; e.g. this ansible.cfg:

[ssh_connection]
scp_if_ssh: true
scp_extra_args: "-O"
a1ad commented

Rather than using the openssh-sftp-server, you can also use Dropbear in conjunction with the scp -O option; e.g. this ansible.cfg:

[ssh_connection]
scp_if_ssh: true
scp_extra_args: "-O"

I get the following error:
unknown option -- O\r\nusage: scp [-346ABCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file]\n [-J destination] [-l limit] [-o ssh_option] [-P port]\n [-S program] source ... target\n"}

Its working without the -O arg just fine

@a1ad Time to update your scp then. What version are you running?

a1ad commented

@a1ad Time to update your scp then. What version are you running?

Idk, the debian 11 one :-)

Edit: scp on Ubuntu 22.04 is indeed working like expected.

Debian 11 appears to be shipping openssh-client in version 8.4.
Starting in 8.8 it uses sftp per default.

You should currently not even be affected by the issue at all and therefore not need the workaround of the -O flag.
I think you came to a random issue, applied whatever fix Hurricos recommended for those affected by it and documented, that you are not affected?

a1ad commented

When i use Debian11 i get:

[WARNING]: sftp transfer mechanism failed on [10.100.102.6]. Use ANSIBLE_DEBUG=1 to see detailed information
[WARNING]: sftp transfer mechanism failed on [10.100.102.7]. Use ANSIBLE_DEBUG=1 to see detailed information
[WARNING]: sftp transfer mechanism failed on [10.100.102.5]. Use ANSIBLE_DEBUG=1 to see detailed information

When i add:
[ssh_connection]
scp_if_ssh: true

The warning msg's are gone, so yea i dont need the -O flag.