question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scp_handler.py - Intermittent issue when verifying md5 checksum

See original GitHub issue

Hello,

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:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
johngriegerjrcommented, Aug 19, 2021

@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.

0reactions
johngriegerjrcommented, Feb 17, 2022

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 no net_connect.flash, try replacing that with flash. I see you declared that as a variable in your code.

Thanks, John

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Generating an MD5 checksum of a file
Is there any simple way of generating (and checking) MD5 checksums of a list of files in Python? ( ...
Read more >
How to Check an MD5 Checksum on desktop/laptop (PC/ ...
This can be done by verifying the MD5 checksum from the steps below on your PC or Mac workstation. Solution: Windows. Open the...
Read more >
IOS XR Verify md5 checksum of the tar/individual rpms
I am upgrading from 6.6.3 to 7.5.2(64-bit) on an ASR 9904; i order to do so, i have to build a tar file...
Read more >
K8337: Verifying the MD5 checksum for the downloaded ...
To access the MD5 file for a given software file or patch, select the software name from the product container list and download...
Read more >
Checksum verification · Issue #12025 · conan-io/conan
4: I upload the package on Artifactory to verify the two MD5 checksums, the one I got in the above point 3 with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found