junipernetworks.junos icon indicating copy to clipboard operation
junipernetworks.junos copied to clipboard

'utf8' codec can't decode byte 0xff in position 20986: invalid start byte

Open Haoyongcxrus opened this issue 2 years ago • 2 comments

SUMMARY

After upgrading the network device junos_commands is unable to run any commands. Here the version of the router. New Upgraded Junos version: 19.4R3-S7.3 Old Juno version: 17.4R2-S11

TASK [check-junos : Run Junos Commands on routers] ***************************** task path: /tmp/bwrap_19670_g1qkujlt/awx_19670_qp3v75ak/project/roles/check-junos/tasks/juniper_router.yml:7 <192.168.0.20> ESTABLISH LOCAL CONNECTION FOR USER: awx <192.168.0.20> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /var/lib/awx/.ansible/tmp/ansible-local-6826gWT9Q9/ansible-tmp-1654239511.81-176957734643016" && echo ansible-tmp-1654239511.81-176957734643016="echo /var/lib/awx/.ansible/tmp/ansible-local-6826gWT9Q9/ansible-tmp-1654239511.81-176957734643016" ) && sleep 0' Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/junos/junos_command.py <192.168.0.20> PUT /var/lib/awx/.ansible/tmp/ansible-local-6826gWT9Q9/tmpKrn6ls TO /var/lib/awx/.ansible/tmp/ansible-local-6826gWT9Q9/ansible-tmp-1654239511.81-176957734643016/AnsiballZ_junos_command.py <192.168.0.20> EXEC /bin/sh -c 'chmod u+x /var/lib/awx/.ansible/tmp/ansible-local-6826gWT9Q9/ansible-tmp-1654239511.81-176957734643016/ /var/lib/awx/.ansible/tmp/ansible-local-6826gWT9Q9/ansible-tmp-1654239511.81-176957734643016/AnsiballZ_junos_command.py && sleep 0' <192.168.0.20> EXEC /bin/sh -c '/usr/bin/python /var/lib/awx/.ansible/tmp/ansible-local-6826gWT9Q9/ansible-tmp-1654239511.81-176957734643016/AnsiballZ_junos_command.py && sleep 0' <192.168.0.20> EXEC /bin/sh -c 'rm -f -r /var/lib/awx/.ansible/tmp/ansible-local-6826gWT9Q9/ansible-tmp-1654239511.81-176957734643016/ > /dev/null 2>&1 && sleep 0' The full traceback is: WARNING: The below traceback may not be related to the actual failure. File "/tmp/ansible_junos_command_payload_D53Jwb/ansible_junos_command_payload.zip/ansible/modules/network/junos/junos_command.py", line 370, in main File "/tmp/ansible_junos_command_payload_D53Jwb/ansible_junos_command_payload.zip/ansible/module_utils/connection.py", line 185, in rpc raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)

[WARNING]: arguments wait_for, match, rpcs are not supported when using transport=cli

fatal: [juniper]: FAILED! => { "changed": false, "invocation": { "module_args": { "commands": [ "show ntp associations no-resolve | no-more" ], "display": null, "host": null, "interval": 1, "match": "all", "password": null, "port": null, "provider": null, "retries": 10, "rpcs": null, "ssh_keyfile": null, "timeout": null, "transport": null, "username": null, "wait_for": null } }, "msg": "'utf8' codec can't decode byte 0xff in position 20986: invalid start byte" }

PLAY RECAP *********************************************************************

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
2.9
COLLECTION VERSION

CONFIGURATION

OS / ENVIRONMENT
STEPS TO REPRODUCE

EXPECTED RESULTS
ACTUAL RESULTS

Haoyongcxrus avatar Jun 06 '22 10:06 Haoyongcxrus

@Haoyongcxrus Thanks for reporting this, Could you please share the config and actual task, and also the detailed debug logs

rohitthakur2590 avatar Nov 09 '22 08:11 rohitthakur2590

I've already tried to debug the output of the juniper command manually but unable to find any special characters.

config

[defaults] library = library roles_path = /etc/ansible/roles:/usr/share/ansible/roles stdout_callback = yaml #host_key_checking = false connect_timeout = 60 command_timeout = 50

Task

  • name: Run Junos command module for "request support information" command connection: network_cli vars: ansible_command_timeout: 300 junos_command: commands: "request support information" register: router_request_support_info ignore_errors: true when: request_support_survey == "run"

Logs

TASK [check-junos : Run Junos command module for "request support information" command] *** task path: /tmp/bwrap_87267_fdg7q5a6/awx_87267_fi26brps/project/roles/check-junos/tasks/juniper_router.yml:15 <192.168.99.100> ESTABLISH LOCAL CONNECTION FOR USER: awx <192.168.99.100> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /var/lib/awx/.ansible/tmp/ansible-local-13550sPaoju/ansible-tmp-1672989797.88-185445607154605" && echo ansible-tmp-1672989797.88-185445607154605="echo /var/lib/awx/.ansible/tmp/ansible-local-13550sPaoju/ansible-tmp-1672989797.88-185445607154605" ) && sleep 0' Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/junos/junos_command.py <192.168.99.100> PUT /var/lib/awx/.ansible/tmp/ansible-local-13550sPaoju/tmpKz0AEd TO /var/lib/awx/.ansible/tmp/ansible-local-13550sPaoju/ansible-tmp-1672989797.88-185445607154605/AnsiballZ_junos_command.py <192.168.99.100> EXEC /bin/sh -c 'chmod u+x /var/lib/awx/.ansible/tmp/ansible-local-13550sPaoju/ansible-tmp-1672989797.88-185445607154605/ /var/lib/awx/.ansible/tmp/ansible-local-13550sPaoju/ansible-tmp-1672989797.88-185445607154605/AnsiballZ_junos_command.py && sleep 0' <192.168.99.100> EXEC /bin/sh -c '/usr/bin/python /var/lib/awx/.ansible/tmp/ansible-local-13550sPaoju/ansible-tmp-1672989797.88-185445607154605/AnsiballZ_junos_command.py && sleep 0' <192.168.99.100> EXEC /bin/sh -c 'rm -f -r /var/lib/awx/.ansible/tmp/ansible-local-13550sPaoju/ansible-tmp-1672989797.88-185445607154605/ > /dev/null 2>&1 && sleep 0' The full traceback is: WARNING: The below traceback may not be related to the actual failure. File "/tmp/ansible_junos_command_payload_eveNyN/ansible_junos_command_payload.zip/ansible/modules/network/junos/junos_command.py", line 370, in main File "/tmp/ansible_junos_command_payload_eveNyN/ansible_junos_command_payload.zip/ansible/module_utils/connection.py", line 185, in rpc raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)

fatal: [SN-SINTP1-BO330]: FAILED! => { "changed": false, "invocation": { "module_args": { "commands": [ "request support information" ], "display": null, "host": null, "interval": 1, "match": "all", "password": null, "port": null, "provider": null, "retries": 10, "rpcs": null, "ssh_keyfile": null, "timeout": null, "transport": null, "username": null, "wait_for": null } }, "msg": "'utf8' codec can't decode byte 0xb0 in position 142307: invalid start byte" } ...ignoring

Haoyongcxrus avatar Jan 12 '23 07:01 Haoyongcxrus