I am seeing the “scp transfer mechanism failed” error for one of my hosts, on only one interface. Most of the answers I can find about this are related to this issue with sftp being mis-configured (or not configured), which is not the problem in my case.
The server is fairly stock Debian 12, and is configured (as far as I know) identically to other Debian 12 systems on the network. The user I’m connecting as is also set up identically on all systems.
The host (like others) is accessible to me on more than one VLAN, and after a bunch of troubleshooting I figured out that the issue is only affecting one interface.
Here is the point at which it breaks, during the Gathering Facts phase:
34925 1760982268.22801: ANSIBALLZ: using cached module: /Users/matt/.ansible/tmp/ansible-local-349258qpxn6dn/ansiballz_cache/ansible.modules.setup-ZIP_DEFLATED-none
34925 1760982268.22941: transferring module to remote /home/matt/.ansible/tmp/ansible-tmp-1760982268.058399-35155-243036632544389/AnsiballZ_setup.py
34925 1760982268.23263: Sending initial data
34925 1760982268.23266: Sent initial data (164 bytes)
34925 1760982268.25558: stdout chunk (state=3):
>>>sftp> put /Users/matt/.ansible/tmp/ansible-local-349258qpxn6dn/tmpmh9gi0xu /home/matt/.ansible/tmp/ansible-tmp-1760982268.058399-35155-243036632544389/AnsiballZ_setup.py
<<<
34925 1760982286.21435: stderr chunk (state=3):
>>>Connection closed
<<<
34925 1760982286.21500: stderr chunk (state=3):
>>><<<
34925 1760982286.21518: stdout chunk (state=3):
>>><<<
For some reason ansible is logging a “Connection closed” message there, but not on other interfaces. Here’s the same thing run using a different interface on the remote host:
41445 1760982320.91614: ANSIBALLZ: using cached module: /Users/matt/.ansible/tmp/ansible-local-41445ldptp0cf/ansiballz_cache/ansible.modules.setup-ZIP_DEFLATED-none
41445 1760982320.91737: transferring module to remote /home/matt/.ansible/tmp/ansible-tmp-1760982320.761167-41676-215762960799291/AnsiballZ_setup.py
41445 1760982320.91937: Sending initial data
41445 1760982320.91942: Sent initial data (164 bytes)
41445 1760982320.94140: stdout chunk (state=3):
>>>sftp> put /Users/matt/.ansible/tmp/ansible-local-41445ldptp0cf/tmp297wye66 /home/matt/.ansible/tmp/ansible-tmp-1760982320.761167-41676-215762960799291/AnsiballZ_setup.py
<<<
41445 1760982320.96222: stderr chunk (state=3):
>>><<<
41445 1760982320.96224: stdout chunk (state=3):
>>><<<
41445 1760982320.96242: done transferring module to remote
This suggests a network issue, but I think I’ve eliminated the obvious potential network problems.
The remote host’s working interface is in the same broadcast domain as the local host, and traffic to the “broken” interface passes through the local router. However, other hosts on the same VLANs do not have this issue, so it doesn’t seem to be the network itself. That suggests the interface configuration on the affected host, however I can scp files into that interface with the same user just fine, so it’s not as simple as that, either.
I don’t have any local firewall set up on the host.
Is there more that I can do to debug this? It would be helpful to get more information out of Ansible about what exactly is going wrong, but I haven’t found what other nobs I an turn to do that.
System Details
Source: Ansible 2.19.3 on MacOS 15.7.1 (pip installed under Py 3.14.0)
Destination: Debian 12 (up to date)