scp_handler.py - Intermittent issue when verifying md5 checksum
See original GitHub issueHello,
When calling verify_file() to compare the md5 checksum of an image on a Cisco router I am intermittently getting the error below. When changing line 356 of scp_handler.py from dest_md5 = self.ssh_ctl_chan.send_command(remote_md5_cmd, max_loops=1500)
to dest_md5 = self.ssh_ctl_chan.send_command_timing(remote_md5_cmd, max_loops=1500)
the issue goes away. Is there any chance this change can be made to the repository or do you know of another way to fix this? Seems like the verify command is taking too long sometimes causing netmiko to not find the prompt when using the send_command and send_command_timing fixes it.
File "C:\Users\john\PycharmProjects\ios_upgrade\venv\lib\site-packages\netmiko\scp_handler.py", line 382, in verify_file return self.compare_md5()
File "C:\Users\john\PycharmProjects\ios_upgrade\venv\lib\site-packages\netmiko\scp_handler.py", line 339, in compare_md5 remote_md5 = self.remote_md5()
File "C:\Users\john\PycharmProjects\ios_upgrade\venv\lib\site-packages\netmiko\scp_handler.py", line 356, in remote_md5 dest_md5 = self.ssh_ctl_chan.send_command(remote_md5_cmd, max_loops=1500)
File "C:\Users\john\PycharmProjects\ios_upgrade\venv\lib\site-packages\netmiko\utilities.py", line 500, in wrapper_decorator return func(self, *args, **kwargs)
File "C:\Users\john\PycharmProjects\ios_upgrade\venv\lib\site-packages\netmiko\base_connection.py", line 1535, in send_command
raise IOError( OSError: Search pattern never detected in send_command: JKGHO\-MDF001\-RTR001\#
Thank you, John
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
@ktbyers I installed the
develop
branch and tested transferring & validating the image. It worked 5 times in a row which is much better than when it was failing intermittently. I’d say the issue it is fixed for now but agree it would be nice to be pass an argument to change the timeout. Thanks for your help.Hi Abdul,
This is the code I was trying to get to work. Specifically, the
request_scp_transfer
&request_transfer
would be of most interest to you. It looks like the error you are getting is because there is nonet_connect.flash
, try replacing that withflash
. I see you declared that as a variable in your code.Thanks, John