PaloAltoNetworks / PaloAltoNetworks/pan-os-python
Paloalto firewall upgrade fails with error in upgrade.py
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 400
- Forks
- 199
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Below is the script I am using to upgrade from 9.1.16 to 11.1.3 code:
from panos.firewall import Firewall
fw = Firewall("", "Username of PA Firewall ", "<Password of PA Firewall")
fw.software.upgrade_to_version("11.1.3")
Expected behavior
It should not present any error.
Current behavior
Below is the output and error I get after running this script:
(paupgrade) # python3 test-upgrade.py
current ver:9.1.16
target ver:11.1.3
next_minor_version:10.0.0
go to next minor
next_version:10.0.0
current ver:10.0.0
target ver:11.1.3
next_minor_version:10.1.0
not direct, intermediate minor being skipped: 10.0.0 to 11.1.3
direct not possible
next_version:10.1.0
current ver:10.1.0
target ver:11.1.3
next_minor_version:10.2.0
not direct, intermediate minor being skipped: 10.1.0 to 11.1.3
direct not possible
next_version:10.2.0
Traceback (most recent call last):
File "/home/paupgrade/test-upgrade.py", line 4, in
fw.software.upgrade_to_version("11.1.3")
File "/home/paupgrade/lib/python3.10/site-packages/panos/updater.py", line 400, in upgrade_to_version
result = self.upgrade_to_version(target_version, dryrun=dryrun)
File "/home/paupgrade/lib/python3.10/site-packages/panos/updater.py", line 400, in upgrade_to_version
result = self.upgrade_to_version(target_version, dryrun=dryrun)
File "/home/paupgrade/lib/python3.10/site-packages/panos/updater.py", line 398, in upgrade_to_version
self.download_install_reboot(next_version, sync=True)
File "/home/paupgrade/lib/python3.10/site-packages/panos/updater.py", line 228, in download_install_reboot
self.download_install(version, load_config, sync=True)
File "/home/paupgrade/lib/python3.10/site-packages/panos/updater.py", line 204, in download_install
self.download(target_version, sync=True)
File "/home/paupgrade/lib/python3.10/site-packages/panos/updater.py", line 97, in download
raise err.PanDeviceError(
panos.errors.PanDeviceError: Device attempt to download version 10.2.0-h3 failed: ['Successfully downloaded', 'Preloading into software manager', "The required '10.2.0' base image must be loaded before this image can be loaded. You do not have to install or run the base image, only download it. Once the base is loaded, re-download your target image.\n", 'Failed to load into software manager. Please retry.', 'Post processing failed. Please retry.']
(paupgrade) #
Possible solution
The updater.py script in python module “pan-os-python” try to download and install 10.2.0-h3 in place of 10.2.0.
Your Environment
python3.10
PA-VM-100 model
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in panos/updater.py, especially upgrade_to_version() and the download path that selects the intermediate 10.2.0 image. Reproduce the 9.1.16-to-11.1.3 upgrade with the reported output and inspect why 10.2.0-h3 is downloaded instead of the required 10.2.0 base image. Done means the upgrade can proceed without the reported base-image error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100