Skip to content
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

"No Such File or Directory" on Cisco IOS XE router using net_put #673

Open
JustinGrote opened this issue Jan 16, 2025 · 0 comments
Open

Comments

@JustinGrote
Copy link

JustinGrote commented Jan 16, 2025

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)

Context: https://stackoverflow.com/questions/76789209/no-such-file-or-directory-error-when-using-ansibles-net-put-and-libssh-to-a

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant