oracle / oci-python-sdk

Oracle Cloud Infrastructure SDK for Python
https://cloud.oracle.com/cloud-infrastructure
Other
393 stars 281 forks source link

Conflicting messages when SDK fails to find «~/.oci/config». #696

Open joavila opened 2 months ago

joavila commented 2 months ago

Our private DNS registering process fails with the following error message:

{
    "ansible_loop_var": "item",
    "changed": false,
    "invocation": {
        "module_args": {
            "api_user": null,
            "api_user_fingerprint": null,
            "api_user_key_file": null,
            "api_user_key_pass_phrase": null,
            "auth_purpose": null,
            "auth_type": "api_key",
            "cert_bundle": null,
            "compartment_id": null,
            "config_file_location": null,
            "config_profile_name": null,
            "if_unmodified_since": null,
            "patch_items": [
                {
                    "domain": "<instance name>.<private zone>.<customer's name>.cl",
                    "is_protected": null,
                    "operation": "ADD",
                    "rdata": "<hidden IP>",
                    "record_hash": null,
                    "rrset_version": null,
                    "rtype": "A",
                    "ttl": 30
                }
            ],
            "realm_specific_endpoint_template_enabled": null,
            "region": null,
            "scope": "PRIVATE",
            "state": "present",
            "tenancy": null,
            "update_items": null,
            "view_id": null,
            "zone_id": "ocid1.dns-zone.oc1.<hidden region>.<hidden OCID>",
            "zone_name_or_id": "ocid1.dns-zone.oc1.<hidden region>.<hidden OCID>"
        }
    },
    "item": {
        "key": "<instance name>",
        "value": {
            "ip": "<hidden IP>"
        }
    },
*   "msg": "Could not find config file at /home/opc/.oci/config, please follow the instructions in the link to setup the config file https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm",
    "oci_ansible_logs": [
        "2024-08-29,15:53:08 DEBUG oci_version_utils.py:46 Python Version: 3.6.8",
        "2024-08-29,15:53:08 DEBUG oci_version_utils.py:36 OCI-Python-Sdk version: 2.125.1",
        "2024-08-29,15:53:08 DEBUG oci_version_utils.py:55 Ansible Version: 2.9.27",
        "2024-08-29,15:53:08 DEBUG oci_version_utils.py:66 OCI-Ansible-Collections installed Version: 5.0.0",
        "2024-08-29,15:53:08 DEBUG oci_version_utils.py:86 OCI-Ansible-Collections latest version available: None",
        "2024-08-29,15:53:08 DEBUG oci_version_utils.py:100 OCI-Python-Sdk path: ['/usr/lib/python3.6/site-packages/oci']",
        "2024-08-29,15:53:08 DEBUG oci_version_utils.py:110 Ansible module python path: ['/tmp/ansible_oracle.oci.oci_dns_zone_records_payload_v9n2g6as/ansible_oracle.oci.oci_dns_zone_records_payload.zip/ansible', '/usr/lib/python3.6/site-packages/ansible']",
*       "2024-08-29,15:53:08 DEBUG config.py:213 Config file found at /home/opc/.oci/config"
    ],
    "troubleshooting_tips": "Refer to troubleshooting guide https://docs.oracle.com/en-us/iaas/tools/oci-ansible-collection/latest/guides/troubleshooting-guide.html"
}

At first sight, it seems a missing configuration file, until one notices the obviously conflicting lines marked with star at the beginning.

How should we read these messages? Search returned nothing meaningful to try to diagnose the situation.

Is there a related known bug? Is there something obviously missing with current configuration?

Thank you in advance.

Regards. Jorge.

adizohar commented 2 months ago

Hi Jorge Is this Python SDK code or Ansible ?

Looks like Ansible, therefore, please close this ticket and open ticket at the anisble repository - https://github.com/oracle/oci-ansible-collection