cdot65 / pan-os-upgrade

An efficient tool to execute configuration backups, network state snapshots, system readiness checks, and operating system upgrades of Palo Alto Networks firewalls and Panorama appliances.
https://cdot65.github.io/pan-os-upgrade/
Apache License 2.0
39 stars 9 forks source link

Upgrade Process Fails When Software Manager is Busy #21

Closed cdot65 closed 9 months ago

cdot65 commented 9 months ago

Issue Summary

The perform_upgrade function in the pan-os-upgrade script encounters an error and exits when attempting to install a new PAN-OS version while the software manager is already in use.

Detailed Description

Behavior: When the script tries to upgrade the PAN-OS version using firewall.software.install, it fails if the software manager on the device is currently in use. The script then raises a PanDeviceError and exits.

Error Message:

PanDeviceError: Device [serial] attempt to install version [version] failed: ['Failed to install [version] with the following errors.\nThe software manager is currently in use. Please try again later.\nFailed to install version [version] type panos\n\n']

Expected Behavior: The script should handle this scenario gracefully by retrying the installation after a brief wait period.

Steps to Reproduce

Run the pan-os-upgrade script to upgrade a PAN-OS firewall. If the software manager on the firewall is busy, observe the script failing with the mentioned error.

Suggested Fix

Improve the error handling in the perform_upgrade function to catch PanDeviceError and implement a retry mechanism. The script should wait for a configurable amount of time and then retry the upgrade process a few times before finally failing.

Impact

This bug impedes the ability of the script to reliably perform upgrades, especially in environments where the software manager might be frequently busy.

Request for Assistance

We are looking for contributions to:

cdot65 commented 9 months ago

This was resolved in commit 66822d1e5515f5e08859216fca6542aab309f984