Open epicanthal opened 2 years ago
I also have this issue using the newer libssh method instead of paramiko. It occurs when I'm pulling facts using the nxos.nxos_facts module. Interestingly enough, it works fine the 1st time I run it in a playbook, but after the device reboots - nxos_facts fails the second time it runs when trying to refresh device facts for an assertion before moving forward. I'm running same Ansible version as you.
Here is a snippet of my code. #########################################################################
name: Initialize upgrade on switch, wait, and verify block:
name: Begin Upgrade cisco.nxos.nxos_install_os: system_image_file: nxos64-cs.10.2.3.F.bin issu: desired
name: Wait 5 minutes then start verifying if switch is up ansible.builtin.wait_for: port: 22 state: started timeout: 1800 delay: 300 when: ansible_net_version == '9.3(8)'
name: Refresh device information cisco.nxos.nxos_facts: gather_subset: '!all'
name: Verify installed version is correct ansible.builtin.assert: that:
name: Print current version to console ansible.builtin.debug: msg: This switch has been upgraded to version {{ ansible_net_version }} ######################################################################################
Here is my error: ###################################################################################### 90 p=79700 u=newtonw-sa@medres.strpweb.org n=ansible | TASK [Wait 5 minutes then start verifying if switch is up] ***** 2022-08-05 00:16:01,354 p=79700 u=newtonw-sa@medres.strpweb.org n=ansible | ok: [mvp-core-sw01] 2022-08-05 00:16:01,368 p=79700 u=newtonw-sa@medres.strpweb.org n=ansible | TASK [Refresh device information] ** 2022-08-05 00:16:02,644 p=79700 u=newtonw-sa@medres.strpweb.org n=ansible | fatal: [mvp-core-sw01]: FAILED! => changed=false msg: Negative size passed to PyBytes_FromStringAndSize #######################################################################################
Any updates? i have same issue with routeros.command module with libssh and paramiko transport
SUMMARY
I am toying with the libssh connection method. I've learned of it via the Ansible 6.0.0 release notes for ansible.netcommon. When I switch to
ssh_type=libssh
orssh_type=auto
the errorNegative size passed to PyBytes_FromStringAndSize
is produced. The same playbook continues to work as expected when switching tossh_type=paramiko
ISSUE TYPE
COMPONENT NAME
network_cli libssh
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Docker:
Target Device:
PIP List:
STEPS TO REPRODUCE
Run:
$ ansible-playbook -i inventory.ini ios_cli_test_connectivity.yml -l ios -v
EXPECTED RESULTS
I expect the contents of the
show version
ios command to be output (with -v) and successful completion of play. As mentioned above, I do receive the expected result ifssh_type=paramiko
ACTUAL RESULTS