Open jnikolich opened 1 year ago
For what it's worth, dropping that 5-second delay down to 1 second also seems to consistently work for me. 0.5 secs consistently failed. 0.9secs intermittently failed. The router itself is very lightly loaded during these tests, averaging 4-5% CPU utilization throughout.
Environment Details
Host: Fedora 38 Netmiko: 4.1.1 (locally modified, see below) Networking Device: Mikrotik RB5009 Router Networking OS: RouterOS 7.12beta3
Problem Description: file_transfer to Mikrotik RouterOS device fails verification (not waiting long enough)
(Please note - due to issue #3291, this problem was tested utilizing a locally-modified version of Netmiko 4.11 that removes
flash/
from the destination filename).I am in the process of testing netmiko's
file_transfer()
against a Mikrotik RB5009 router, running RouterOS 7.12beta3. When transferring an already-exiisting file, the transfer completes successfully. However when transferring a new file to the RB5009, the transfer fails with the following traceback:In file 'mikrotik_ssh.py', function
remote_file_size()
issues a command to the target device similar to/file print detail where name="testfile.rsc"
. This fails - no output seems to be returned.The notes/warnings in Mikrotik's Wiki include the following note as of 2023-09-14:
The RB5009 is a multicore device with 1GB of NAND storage.
On a hunch, I tried inserting a 5-second delay after the file is transferred, but before
remote_file_size()
retrieves the file details. This worked. Further testing is probably required, but it appears that when pushing a file to (at least) an RB5009 router, the file details may take a few seconds to become available for query.Change Request
I'm not sure what the best approach to handling this would be from netmiko's perspective, but a simplistic fix would be to introduce support for configurable (possibly defaulting to zero) post-transfer delay for Mikrotik ROS devices, to occur immediately after the file_transfer has occurred, before any post-transfer verification/reporting occurs.