pyntc icon indicating copy to clipboard operation
pyntc copied to clipboard

Error Handling ios_device.py not catching failed upgrade

Open susanhooks opened this issue 10 months ago • 0 comments

Environment

  • Python version: 3.10
  • pyntc version: 2.0.2

Expected Behavior

If there's an error adding and installing the file, the job should exit and error should be raised.

Observed Behavior

The error was not caught, or passed and the job using this function ran until it timed out.

This is the error:

2025-03-19 19:41:30,256: INFO/ForkPoolWorker-2] Host 136.X.X.X: Command install add file flash:cat9k_iosxe.17.06.04.SPA.bin activate commit prompt-level none was executed successfully with response: install_add_activate_commit: START Wed Mar 19 19:41:29 UTC 2025 install_add: Adding IMG [2] Switch 2 Warning!!! Image is being downgraded from 17.09.04a.0.6 to 17.06.04.0.4912. FAILED: add_activate_commit /mnt/sd3/user/cat9k_iosxe.17.06.04.SPA.bin Wed Mar 19 19:41:29 UTC 2025

I think the issue is here, as the error does not start with FAILED:

Steps to Reproduce

  1. Upload an invalid image to a device. In this case, the MD5 was not valid.
  2. Run the install_os job in OS onboarding, which uses the pyntc install_ios.py.
  3. See error in logs, not caught, job keeps processing.

susanhooks avatar Mar 20 '25 18:03 susanhooks