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

Firewall snapshot after upgrade not generated #106

Closed jpirhon closed 5 months ago

jpirhon commented 5 months ago

Describe the bug Firewall snapshot after upgrade not generated, and therefore the reports are not generated either (standalone firewall). The script returns after "LabFW1: Waiting for the device to become ready for the post upgrade snapshot.". This happens when using settings.yaml file.

I assume that the issue lies in code "upgrade.py" line 716 ->

# Load settings if the file exists
if settings_file_path.exists():

This seems to check if the settings file exists and whether snapshots are enabled or not. In this case when snapshots are enabled it skips the snapshots due to the snapshot and reporting part being included in the else statement (which is never reached due to constuction of the if/else statement).

To Reproduce Steps to reproduce the behavior:

  1. Generate settings.yaml file
  2. Run the script (using: "pan-os-upgrade firewall")
  3. Post-upgrade snapshot not generated

Expected behavior Post upgrade snapshots and reports to be generated.

Log output LabFW1: Upgrade completed successfully
LabFW1: Rebooting the target device. LabFW1: Retry attempt 1 due to error: URLError: reason: [Errno 110] Connection timed out LabFW1: Retry attempt 2 due to error: URLError: reason: [Errno 111] Connection refused LabFW1: Current device version: 11.0.1-h2 LabFW1: Device rebooted to the target version successfully. LabFW1: Performing backup of configuration to local filesystem. LabFW1: Waiting for the device to become ready for the post upgrade snapshot. Script exits here.

Environment

cdot65 commented 5 months ago

Hello @jpirhon , I believe this was related to this issue that was resolved in the latest release https://github.com/cdot65/pan-os-upgrade/issues/96

can you confirm your current version?

jpirhon commented 5 months ago

Yes, I'm running the latest: pan-os-upgrade 1.3.3

cdot65 commented 5 months ago

You are correct, this issue wasn't solved by the previously mentioned Issue, it was in fact created by it. Thanks for the report, I'll work on getting a hotfix out

cdot65 commented 5 months ago

the fix is in 1.3.4, currently working on a new pytest to catch the issue in the future and will keep the branch open until it's finished.

Thanks again for reporting this!