Open
Description
SUMMARY
Transferring a file to a cisco router results in Initializing SCP session of remote file [bootflash:cat9k_iosxe.17.12.04.SPA.bin] for write failed with error [b'Socket error: No such file or directory'
I looked through the source code, the failure occurs when pylibssh calls the libssh.ssh_scp_init method. But, I didn't go any further. (See line 64 here: https://github.com/ansible/pylibssh/blob/devel/src/pylibsshext/scp.pyx)
Workaround
This works fine if ansible_network_cli_ssh_type: paramiko
ISSUE TYPE
- Bug Report
PYLISSH and LIBSSH VERSION
ansible-pylibssh 1.2.2
OS / ENVIRONMENT
ansible [core 2.17.6]
config file = /workspaces/topco.network_automation/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.12/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.12.7 (main, Oct 1 2024, 00:00:00) [GCC 14.2.1 20240912 (Red Hat 14.2.1-3)] (/usr/bin/python3)
jinja version = 3.1.4
libyaml = True
STEPS TO REPRODUCE
- name: Copy the candidate IOS image to the switch. This can take 5+ minutes for 1GB switch bundles.
when: ios_verify.parsed.present is false
vars:
ansible_command_timeout: 600
ansible.netcommon.net_put:
src: "{{ local_image_dir }}/{{ ios_image }}"
dest: "{{ flash_dir }}{{ ios_image }}"
protocol: scp
overwrite: true
EXPECTED RESULTS
File is copied
ACTUAL RESULTS
Initializing SCP session of remote file [bootflash:cat9k_iosxe.17.12.04.SPA.bin] for write failed with error [b'Socket error: No such file or directory'
Metadata
Metadata
Assignees
Labels
No labels