Generate API Requests crashes

Reply
L3 Networker

Generate API Requests crashes

I am trying to set up the first set of changes I am making to do some rule enrichment.

Within my project, I am going to Export, API Output Manager, and clicking "[Step 1] Generate API Requests". 

The status start changing, showing different phases, but after probably 35 seconds, I get kicked out of the web GUI and back to the login page. Is this a known bug? Is there a workaround, perhaps a config export to a file or something?

Also, what are the signifigance of the radio buttons for Mega, Atomic, Sub-atomic, and Clean?

 

 

L4 Transporter

Re: Generate API Requests crashes

Just in case, make sure you are not under version 1.0.100, as we handled some specific XML structures from the PANOS configs in the latest updates.

The current version is 1.0.101.

Also, check if there is a file /tmp/error that could bring us more information about what may have gone wrong.

L3 Networker

Re: Generate API Requests crashes

root@Expedition:/tmp# more error
Traceback (most recent call last):
File "/var/www/html/libs/ansible/xml-to-ansible.py", line 40, in <module>
import pan.config
ModuleNotFoundError: No module named 'pan'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
File "/var/www/html/libs/ansible/xml-to-ansible.py", line 40, in <module>
import pan.config
ModuleNotFoundError: No module named 'pan'

L3 Networker

Re: Generate API Requests crashes

Is there an Ansible back-end to Expedition? If so, I didn't know that.

L7 Applicator

Re: Generate API Requests crashes

we use some extensions who are in beta that try to convert the output xml as ansible playbook and sometimes it produces an error, and can be omited, then we use pan-python to from the output xml generate the set commands.

 

If you case seems the library has not being installed properly,

 

try to run this command from the cli

 

sudo -H pip3 install pandevice
L3 Networker

Re: Generate API Requests crashes

expedition@Expedition:~$ sudo bash
[sudo] password for expedition:
root@Expedition:/mnt/disk2/home/expedition# pip3 install pandevice
The directory '/mnt/disk2/home/expedition/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/expedition/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pandevice
Downloading https://files.pythonhosted.org/packages/b3/e5/96f72439e5e4162aa78fee6f6288f06913b56dfa2a94b1cd652d25... (126kB)
100% |████████████████████████████████| 133kB 2.5MB/s
Collecting pan-python (from pandevice)
Downloading https://files.pythonhosted.org/packages/c3/6c/fb9cb7551f37a721551753d424a4bf5fd70159ed3d5fd468d2ae3f... (120kB)
100% |████████████████████████████████| 122kB 2.8MB/s
Installing collected packages: pan-python, pandevice
Running setup.py install for pan-python ... done
Running setup.py install for pandevice ... done
Successfully installed pan-python-0.13.0 pandevice-0.6.4

 

...I will try the API generate again later this morning and let you know what happens.

L3 Networker

Re: Generate API Requests crashes

...funny enough, it still crashed, kicked me back out to the login screen, but there was nothing in the /tmp/error file at all this time.

L7 Applicator

Re: Generate API Requests crashes

can we do a quick zoom session to see the problem? If yes please send me an email to fwmigrate at paloaltonetworks dot com with the subject "Request Zoom Session now" thanks

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!