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 7 forks source link

Upgrade Workflow Continues to Reboot Despite Failed Software Installation Attempts #103

Closed cdot65 closed 5 months ago

cdot65 commented 5 months ago

Describe the bug During the firewall upgrade process, if the software manager is busy and cannot install the target PAN-OS version, the script retries the installation up to three times with a 60-second delay between each attempt. If all attempts fail, the script proceeds to reboot the firewall without the new target version being successfully installed.

To Reproduce Steps to reproduce the behavior:

  1. Initiate the upgrade process on a firewall where the software manager is expected to be busy or unable to install the target PAN-OS version.
  2. Observe the script attempting to install the target PAN-OS version three times, failing each time due to the software manager being busy.
  3. Notice that after the third failed attempt, the script proceeds to reboot the firewall without the successful installation of the target version.

Expected behavior The expected behavior is for the script to halt the upgrade process and not proceed with the reboot if the target PAN-OS version cannot be installed after the specified number of retry attempts. The script should log an appropriate error message indicating the failure to install the target version and the decision not to proceed with the reboot.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context This issue may lead to unnecessary reboots of firewalls without completing the intended upgrade, potentially causing disruptions in network traffic and affecting production environments. A fix to ensure the script properly handles failed installation attempts before proceeding to the reboot phase is necessary to avoid unintended consequences.