<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic issues with concurrent api call in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/issues-with-concurrent-api-call/m-p/549052#M3400</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have had a problem with concurrent API call for a long time and it gets worse as we have more equipment.&lt;BR /&gt;Sometimes if we have too much API call in the same time, we have errors: timeout, error 5xx or others strange erros.&lt;BR /&gt;The too much API call is realy really low, if we have 2 or 3 on the same time we have an issue&lt;/P&gt;&lt;P&gt;For example, in the traces below we have Session timed out and Invalid Credential when it is the same username for all the playbook tasks without any problems&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Context:&lt;/STRONG&gt;&lt;BR /&gt;- Modification of policy, NAT, users, migration of equipment or audit are done are performed automatically via API, particularly Ansible&lt;BR /&gt;- Panorama 10.2.4-h2&lt;BR /&gt;- 50 devices groups on this panorama and many ongoing migrations&lt;BR /&gt;- 250 commits per week so thousands or API call per weeks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The questions I have asked to Palo without responses:&lt;/STRONG&gt;&lt;BR /&gt;- Are there any possibilities to speed up API call?&lt;BR /&gt;for example in Cisco ACI, we had change the auth from basic auth to cert and it's way better&lt;BR /&gt;- Is there some limits to the number of concurent API call?&lt;BR /&gt;- Is there a way to improve that?&lt;BR /&gt;- Is there some logs to analyse in more detail?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is having a major impact because we have chosen PaloAlto as our main firewall supplier, but the automation is not keeping up and this is putting a question mark over future migrations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I opened a ticket with TAC, who didn't see any error in the tech support and who disclaims all responsibility because it's Ansible...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Is anyone having limitation problems with the API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Invocation&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# Ansible Info&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[root@f9cc47c8570d ~]# ansible --version&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ansible [core 2.14.7]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;config file = None&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ansible python module location = /usr/local/lib/python3.9/site-packages/ansible&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;executable location = /usr/local/bin/ansible&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;python version = 3.9.16 (main, May 31 2023, 12:21:58) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] (/usr/bin/python3.9)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;jinja version = 3.1.2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;libyaml = True&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;# Module collection&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[root@f9cc47c8570d ~]# ansible-galaxy collection list | grep palo&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;paloaltonetworks.panos 2.13.3&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;# Python modules&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[root@f9cc47c8570d ~]# python3.9 -m pip list | grep pan&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;pan-os-python 1.8.1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;pan-python 0.22.0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;pandevice 0.14.0&lt;/FONT&gt;&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Traces&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Examples of 2 concurent requests:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;The full traceback is: File "/tmp/ansible_paloaltonetworks.panos.panos_address_object_payload_1ot7y5qi/ansible_paloaltonetworks.panos.panos_address_object_payload.zip/ansible_collections/paloaltonetworks/panos/plugins/module_utils/panos.py", line 250, in get_pandevice_parent&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;self.device = PanDevice.create_from_device(*pan_device_auth)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 3748, in create_from_device&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system_info = device.refresh_system_info()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 4215, in refresh_system_info&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system_info = self.show_system_info()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 4171, in show_system_info&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;root = self.xapi.op(cmd="show system info", cmd_xml=True)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 4000, in xapi&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;self._xapi_private = self.generate_xapi()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 4072, in generate_xapi&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"api_key": self.api_key,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 3994, in api_key&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;self._api_key = self._retrieve_api_key()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 4159, in _retrieve_api_key&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;xapi.keygen(retry_on_peer=False)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 3897, in method&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;raise the_exception&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;failed: [oppano22s.intcs.meshcore.net] (item=bpfftc16s) =&amp;gt; {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"ansible_loop_var": "item",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"changed": false,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"invocation": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"module_args": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"address_type": "ip-netmask",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"api_key": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"commit": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"description": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"device_group": "shared",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"gathered_filter": "name == bpfftc16s",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"ip_address": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"name": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"password": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"port": 443,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"provider": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"api_key": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"ip_address": "oppano22s.intcs.meshcore.net",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"port": 443,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"serial_number": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"username": "w120611"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"state": "gathered",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"tag": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"username": "admin",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"value": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"vsys": "vsys1"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"item": "bpfftc16s",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"msg": "Failed connection: URLError: code: 403 reason: Invalid Credential"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;```&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;```&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;The full traceback is: &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/tmp/ansible_paloaltonetworks.panos.panos_address_group_payload_71kgaaia/ansible_paloaltonetworks.panos.panos_address_group_payload.zip/ansible_collections/paloaltonetworks/panos/plugins/module_utils/panos.py", line 619, in apply_state&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;listing = obj.__class__.refreshall(obj.parent, add=False)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 1326, in refreshall&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;raise e&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 1321, in refreshall&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;root = api_action(xpath, retry_on_peer=cls.HA_SYNC)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 3897, in method&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;raise the_exception&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;failed: [oppano22s.intcs.meshcore.net] (item=bqfftc12s) =&amp;gt; {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"ansible_loop_var": "item",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"changed": false,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"invocation": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"module_args": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"api_key": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"commit": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"description": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"device_group": "shared",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"dynamic_value": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"gathered_filter": "name == bqfftc12s",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"ip_address": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"name": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"password": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"port": 443,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"provider": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"api_key": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"ip_address": "oppano22s.intcs.meshcore.net",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"port": 443,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"serial_number": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"username": "w120611"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"state": "gathered",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"static_value": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"tag": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"username": "admin",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"vsys": "vsys1"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"item": "bqfftc12s",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"msg": "Failed gathered_filter refresh: Session timed out"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Antoine,&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2023 09:28:17 GMT</pubDate>
    <dc:creator>antoinek</dc:creator>
    <dc:date>2023-07-17T09:28:17Z</dc:date>
    <item>
      <title>issues with concurrent api call</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/issues-with-concurrent-api-call/m-p/549052#M3400</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have had a problem with concurrent API call for a long time and it gets worse as we have more equipment.&lt;BR /&gt;Sometimes if we have too much API call in the same time, we have errors: timeout, error 5xx or others strange erros.&lt;BR /&gt;The too much API call is realy really low, if we have 2 or 3 on the same time we have an issue&lt;/P&gt;&lt;P&gt;For example, in the traces below we have Session timed out and Invalid Credential when it is the same username for all the playbook tasks without any problems&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Context:&lt;/STRONG&gt;&lt;BR /&gt;- Modification of policy, NAT, users, migration of equipment or audit are done are performed automatically via API, particularly Ansible&lt;BR /&gt;- Panorama 10.2.4-h2&lt;BR /&gt;- 50 devices groups on this panorama and many ongoing migrations&lt;BR /&gt;- 250 commits per week so thousands or API call per weeks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The questions I have asked to Palo without responses:&lt;/STRONG&gt;&lt;BR /&gt;- Are there any possibilities to speed up API call?&lt;BR /&gt;for example in Cisco ACI, we had change the auth from basic auth to cert and it's way better&lt;BR /&gt;- Is there some limits to the number of concurent API call?&lt;BR /&gt;- Is there a way to improve that?&lt;BR /&gt;- Is there some logs to analyse in more detail?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is having a major impact because we have chosen PaloAlto as our main firewall supplier, but the automation is not keeping up and this is putting a question mark over future migrations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I opened a ticket with TAC, who didn't see any error in the tech support and who disclaims all responsibility because it's Ansible...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Is anyone having limitation problems with the API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Invocation&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# Ansible Info&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[root@f9cc47c8570d ~]# ansible --version&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ansible [core 2.14.7]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;config file = None&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ansible python module location = /usr/local/lib/python3.9/site-packages/ansible&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;executable location = /usr/local/bin/ansible&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;python version = 3.9.16 (main, May 31 2023, 12:21:58) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] (/usr/bin/python3.9)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;jinja version = 3.1.2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;libyaml = True&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;# Module collection&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[root@f9cc47c8570d ~]# ansible-galaxy collection list | grep palo&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;paloaltonetworks.panos 2.13.3&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;# Python modules&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[root@f9cc47c8570d ~]# python3.9 -m pip list | grep pan&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;pan-os-python 1.8.1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;pan-python 0.22.0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;pandevice 0.14.0&lt;/FONT&gt;&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Traces&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Examples of 2 concurent requests:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;The full traceback is: File "/tmp/ansible_paloaltonetworks.panos.panos_address_object_payload_1ot7y5qi/ansible_paloaltonetworks.panos.panos_address_object_payload.zip/ansible_collections/paloaltonetworks/panos/plugins/module_utils/panos.py", line 250, in get_pandevice_parent&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;self.device = PanDevice.create_from_device(*pan_device_auth)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 3748, in create_from_device&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system_info = device.refresh_system_info()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 4215, in refresh_system_info&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;system_info = self.show_system_info()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 4171, in show_system_info&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;root = self.xapi.op(cmd="show system info", cmd_xml=True)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 4000, in xapi&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;self._xapi_private = self.generate_xapi()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 4072, in generate_xapi&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"api_key": self.api_key,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 3994, in api_key&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;self._api_key = self._retrieve_api_key()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 4159, in _retrieve_api_key&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;xapi.keygen(retry_on_peer=False)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 3897, in method&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;raise the_exception&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;failed: [oppano22s.intcs.meshcore.net] (item=bpfftc16s) =&amp;gt; {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"ansible_loop_var": "item",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"changed": false,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"invocation": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"module_args": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"address_type": "ip-netmask",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"api_key": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"commit": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"description": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"device_group": "shared",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"gathered_filter": "name == bpfftc16s",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"ip_address": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"name": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"password": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"port": 443,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"provider": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"api_key": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"ip_address": "oppano22s.intcs.meshcore.net",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"port": 443,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"serial_number": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"username": "w120611"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"state": "gathered",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"tag": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"username": "admin",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"value": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"vsys": "vsys1"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"item": "bpfftc16s",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"msg": "Failed connection: URLError: code: 403 reason: Invalid Credential"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;```&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;```&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;The full traceback is: &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/tmp/ansible_paloaltonetworks.panos.panos_address_group_payload_71kgaaia/ansible_paloaltonetworks.panos.panos_address_group_payload.zip/ansible_collections/paloaltonetworks/panos/plugins/module_utils/panos.py", line 619, in apply_state&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;listing = obj.__class__.refreshall(obj.parent, add=False)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 1326, in refreshall&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;raise e&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 1321, in refreshall&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;root = api_action(xpath, retry_on_peer=cls.HA_SYNC)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;File "/usr/local/lib/python3.9/site-packages/panos/base.py", line 3897, in method&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;raise the_exception&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;failed: [oppano22s.intcs.meshcore.net] (item=bqfftc12s) =&amp;gt; {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"ansible_loop_var": "item",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"changed": false,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"invocation": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"module_args": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"api_key": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"commit": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"description": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"device_group": "shared",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"dynamic_value": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"gathered_filter": "name == bqfftc12s",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"ip_address": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"name": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"password": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"port": 443,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"provider": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"api_key": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"ip_address": "oppano22s.intcs.meshcore.net",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"port": 443,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"serial_number": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"username": "w120611"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"state": "gathered",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"static_value": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"tag": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"username": "admin",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"vsys": "vsys1"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"item": "bqfftc12s",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"msg": "Failed gathered_filter refresh: Session timed out"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Antoine,&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 09:28:17 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/issues-with-concurrent-api-call/m-p/549052#M3400</guid>
      <dc:creator>antoinek</dc:creator>
      <dc:date>2023-07-17T09:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: issues with concurrent api call</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/issues-with-concurrent-api-call/m-p/551996#M3407</link>
      <description>&lt;P&gt;So after many exchanges with support, many tries and debugging, here is what I learned about the concurent API call:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;They is something on the documentation (&lt;A href="https://docs.paloaltonetworks.com/content/dam/techdocs/en_US/pdf/pan-os/10-1/pan-os-panorama-api/pan-os-panorama-api.pdf" target="_blank" rel="noopener"&gt;https://docs.paloaltonetworks.com/content/dam/techdocs/en_US/pdf/pan-os/10-1/pan-os-panorama-api/pan-os-panorama-api.pdf&lt;/A&gt;) and the limitation is concurent request to five when login:&lt;BR /&gt;"&lt;BR /&gt;When multiple login or logout events are generated at the same time, make sure to&lt;BR /&gt;follow these guidelines to ensure optimal firewall performance:&lt;BR /&gt;• Design your application to queue events and perform batch API updates instead of&lt;BR /&gt;sending single event or mapping updates.&lt;BR /&gt;• Limit the number of concurrent API calls to five. This limit ensures that there is no&lt;BR /&gt;performance impact to the firewall web interface as the management plane web&lt;BR /&gt;server handles requests from both the API and the web interface.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"&lt;BR /&gt;This is not a guidelines but an hard limit where "there no option to exceed the limits".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also this limit is not only for login "- Is this limit only for login? NO"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;It's not 5 per seconds but 5 concurent (I prefer to clarify because it was the TAC that was giving us 5 per second).&lt;BR /&gt;I managed to go to more than 5 API request per second without any problems.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Our solution was to generate the API key once and us it for authentication every time instead of the user's username and password, as this generated a lot of requests and load on the panorama.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For the moment this solves our problem or we were waiting for the limit, to be followed in the future.&lt;BR /&gt;But we hope that such a low hardcoded limit can be modified.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;It's a bit annoying that the documentation isn't clearer on this point, and it didn't seem very clear to the TACs either.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Antoine&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 07:53:31 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/issues-with-concurrent-api-call/m-p/551996#M3407</guid>
      <dc:creator>antoinek</dc:creator>
      <dc:date>2023-08-01T07:53:31Z</dc:date>
    </item>
  </channel>
</rss>

