Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Listing resource failed with exception: Invalid pagination token", #285

Open
eugsim1 opened this issue Jun 24, 2024 · 0 comments
Open

"Listing resource failed with exception: Invalid pagination token", #285

eugsim1 opened this issue Jun 24, 2024 · 0 comments

Comments

@eugsim1
Copy link
Member

eugsim1 commented Jun 24, 2024

Issue Report

Describe the issue

a call to oci_database_pluggable_database_facts_module.html fails with "Listing resource failed with exception: Invalid pagination token",

Expected behavior

should return a list of pluggable databases

fatal: [localhost]: FAILED! => {"changed": false, "error_code": "InvalidParameter", "http_response_status": "400", "module_documentation": "Refer to this link https://docs.oracle.com/en-us/iaas/tools/oci-ansible-collection/latest/collections/oracle/oci/oci_database_pluggable_database_facts_module.html", "msg": "Listing resource failed with exception: Invalid pagination token", "oci_ansible_logs": ["2024-06-24,17:41:54 DEBUG oci_version_utils.py:46 Python Version: 3.9.19", "2024-06-24,17:41:54 DEBUG oci_version_utils.py:36 OCI-Python-Sdk version: 2.126.4", "2024-06-24,17:41:54 DEBUG oci_version_utils.py:55 Ansible Version: 2.15.9", "2024-06-24,17:41:54 DEBUG oci_version_utils.py:64 OCI-Ansible-Collections installed Version: 5.1.0", "2024-06-24,17:41:54 DEBUG oci_version_utils.py:85 OCI-Ansible-Collections latest version available: 5.1.0", "2024-06-24,17:41:54 DEBUG oci_version_utils.py:100 OCI-Python-Sdk path: ['/home/oracle/.local/lib/python3.9/site-packages/oci']", "2024-06-24,17:41:54 DEBUG oci_version_utils.py:110 Ansible module python path: ['/tmp/ansible_oracle.oci.oci_database_pluggable_database_facts_payload_yjvbe6l8/ansible_oracle.oci.oci_database_pluggable_database_facts_payload.zip/ansible', '/home/oracle/.local/lib/python3.9/site-packages/ansible']", "2024-06-24,17:41:54 DEBUG config.py:195 Config file found at /home/oracle/.oci/config_exa", "2024-06-24,17:41:54 DEBUG base_client.py:357 Endpoint: https://database.eu-frankfurt-1.oraclecloud.com/20160918", "2024-06-24,17:41:54 INFO oci_resource_utils.py:206 Listing resource", "2024-06-24,17:41:54 INFO base_client.py:655 2024-06-24 17:41:54.549552: Request: GET https://database.eu-frankfurt-1.oraclecloud.com/20160918/pluggableDatabases", "2024-06-24,17:41:54 DEBUG connectionpool.py:1006 Starting new HTTPS connection (1): database.eu-frankfurt-1.oraclecloud.com:443", "2024-06-24,17:41:54 DEBUG oci_log_utils.py:84 send: b'GET /20160918/pluggableDatabases?databaseId=ocid1.database.oc1.eu-frankfurt-1.antheljrvwun52iah6v5bc5yffr7fmi57ekrjy6ozjvfk54vk5sb2ee25m5q&sortBy=TIMECREATED&sortOrder=ASC&lifecycleState=AVAILABLE HTTP/1.1\\r\\nuser-agent: Oracle-PythonSDK/2.126.4 (python 3.9.19; x86_64-Linux) Oracle-Ansible/5.1.0\\r\\naccept-encoding: gzip, deflate\\r\\naccept: application/json\\r\\nconnection: keep-alive\\r\\ncontent-type: application/json\\r\\nopc-client-info: Oracle-PythonSDK/2.126.4\\r\\nopc-request-id: CBCD258DC6AC405EA7A1DB1C4D12D22B\\r\\ndate: Mon, 24 Jun 2024 17:41:54 GMT\\r\\nhost: database.eu-frankfurt-1.oraclecloud.com\\r\\nauthorization: Signature algorithm=\"rsa-sha256\",headers=\"date (request-target) host\",keyId=\"ocid1.tenancy.oc1..aaaaaaaackzmrar3qqpw6iwxhi7qizidayleptq54o6f4jenz5veuhrj5xlq/ocid1.user.oc1..aaaaaaaaxupbagt7yamod4xpuky6os5smlzibpc36beujc6smzh7bwq7mnaq/67:72:b2:c8:62:5a:aa:69:12:ad:16:88:50:75:7b:77\",signature=\"bMpsxtqmkw5TU126CdhFUZyi10yUsWfxRrpk4UxLBcPY3Fpy2hsJyvZItgNiRm4i2TcJ+BlfSLgjvwMfVApKe5cVQpyj08ZJa+fGSoapHFke2bblfctUG+GQyk/EP9EKoe7nqc+EA8q+THs9yRJ/XYrtFKOPhHB6PSIxtbCiQKd8YB5g+EwXtgHHRVmT2wCNd45IZooieFwOXMZC6hpeoDDXVa2Ruw32u3XuAMFax20f+RYV7tup0ozw1y6Y63cFWJndn3p+6fOskQSOhpbxGbYHSTQ6mfagg351srFAzGtzO1er+LPAUmBQ6JWS/9ppbecH0JX9ujQ97kUhveBoHA==\",version=\"1\"\\r\\n\\r\\n'", "2024-06-24,17:41:55 DEBUG oci_log_utils.py:84 reply: 'HTTP/1.1 400 Bad Request\\r\\n'", "2024-06-24,17:41:55 DEBUG oci_log_utils.py:84 header: Date: Mon, 24 Jun 2024 17:41:54 GMT", "2024-06-24,17:41:55 DEBUG oci_log_utils.py:84 header: opc-request-id: CBCD258DC6AC405EA7A1DB1C4D12D22B/2906ED8D7ED9A9B08E2C525F1888FA40/00771A237ACB1182BF3F0A42CDDFA23E", "2024-06-24,17:41:55 DEBUG oci_log_utils.py:84 header: Content-Type: application/json", "2024-06-24,17:41:55 DEBUG oci_log_utils.py:84 header: X-Content-Type-Options: nosniff", "2024-06-24,17:41:55 DEBUG oci_log_utils.py:84 header: Strict-Transport-Security: max-age=31536000; includeSubDomains;", "2024-06-24,17:41:55 DEBUG oci_log_utils.py:84 header: Content-Length: 75", "2024-06-24,17:41:55 DEBUG connectionpool.py:461 https://database.eu-frankfurt-1.oraclecloud.com:443 \"GET /20160918/pluggableDatabases?databaseId=ocid1.database.oc1.eu-frankfurt-1.antheljrvwun52iah6v5bc5yffr7fmi57ekrjy6ozjvfk54vk5sb2ee25m5q&sortBy=TIMECREATED&sortOrder=ASC&lifecycleState=AVAILABLE HTTP/1.1\" 400 75", "2024-06-24,17:41:55 DEBUG base_client.py:688 2024-06-24 17:41:55.035675: time elapsed for request CBCD258DC6AC405EA7A1DB1C4D12D22B: 0.4860766096971929", "2024-06-24,17:41:55 DEBUG base_client.py:703 2024-06-24 17:41:55.035748: Response status: 400", "2024-06-24,17:41:55 DEBUG base_client.py:975 2024-06-24 17:41:55.035843: python SDK time elapsed for deserializing: 5.3998082876205444e-06", "2024-06-24,17:41:55 DEBUG circuit_breaker.py:73 Is transient error status code:400 error code:InvalidParameter", "2024-06-24,17:41:55 DEBUG circuit_breaker.py:79 status code:400 not in failure_statuses_and_codes:{409: ['IncorrectState'], 429: [], 500: [], 502: [], 503: [], 504: []}"], "opc_request_id": "CBCD258DC6AC405EA7A1DB1C4D12D22B/2906ED8D7ED9A9B08E2C525F1888FA40/00771A237ACB1182BF3F0A42CDDFA23E", "operation_name": "list_pluggable_databases", "request_endpoint": "GET https://database.eu-frankfurt-1.oraclecloud.com/20160918/pluggableDatabases", "service_name": "database", "time": "2024-06-24T17:41:55.035777+00:00", "troubleshooting_tips": "Refer to troubleshooting guide https://docs.oracle.com/en-us/iaas/tools/oci-ansible-collection/latest/guides/troubleshooting-guide.html"}

ansible --version
ansible [core 2.15.9]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/oracle/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/oracle/.local/lib/python3.9/site-packages/ansible
ansible collection location = /home/oracle/.ansible/collections:/usr/share/ansible/collections
executable location = /home/oracle/.local/bin/ansible
python version = 3.9.19 (main, May 30 2024, 06:55:59) [GCC 8.5.0 20210514 (Red Hat 8.5.0-22.0.1)] (/usr/bin/python3)
jinja version = 3.1.3
libyaml = True

/usr/share/ansible/collections/ansible_collections

Collection Version


oracle.oci 5.1.0
python3 -c "import oci;print(oci.version)"
2.126.4

ansible-playbook /home/oracle/oci4cca-managment/services/database/pdb/01-database_pluggable_database_facts.yaml
--tags "Dump-vars"
--tags "List_pluggable_databases"
--tags "dbg-fetch-DB-details"
--extra-vars="region=eu-frankfurt-1"
--extra-vars="database_id=$DATABASE_ID"

  • name : Fetches_details_about_one_or_multiple_Database_resources_in_Oracle_Cloud_Infrastructure
    collections:
    • oracle.oci
      connection: local
      hosts: localhost
      vars_files:

    • default_database.yaml
      tasks:

         - name: Prevent run without tags
           fail: msg="You must run this playbook with tags!"
      
         - name: dump variables DB creation
           debug:
             msg: '{{ region }} | {{ compartment_id | default(omit)}} | {{ pluggable_database_id  | default(omit)}}  | {{ database_id  | default(omit)}} '
           tags:
            - Dump-vars
      
         - name: Get a specific pluggable_database
           oracle.oci.oci_database_pluggable_database_facts:
             region: "{{ region }}"
             compartment_id: "{{ compartment_id  }}"
             # required
             pluggable_database_id: "{{ pluggable_database_id }}"
           register: result
           tags:
            - Get_a_specific_pluggable_database
      
         - name: List pluggable_databases
           oracle.oci.oci_database_pluggable_database_facts:
             region: "{{ region }}"
      
             # optional
             compartment_id: "{{ compartment_id | default(omit) }}"
             database_id: "{{ database_id  | default(omit)}}"
             sort_by: TIMECREATED
             sort_order: ASC
             lifecycle_state: AVAILABLE
      

    pdb_name: pdb_name_example

            register: result
            tags:
             - List_pluggable_databases
    
          - name: Dump result from List_databases
            debug:
              msg: '{{ result }}'
            tags:
             - dbg-fetch-DB-details   
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant