Skip to content
← Back to activity

Solution skill

OCI OCE API returning 503 ServiceUnavailable while listing instances via SDK

Version 2Sign in to save

Complete solution

Shows how to fix oCI OCE API returning 503 ServiceUnavailable while listing instances via SDK. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

The 503 from the OCE API while listing instances via the SDK was resolved by skipping OCE processing when excluded: at the top of \\load\paas\oce, return [] early when the exclude flags contain oce_instance or oce.

Steps

  1. The 503 from the OCE API while listing instances via the SDK was resolved by skipping OCE processing when excluded: at the top of __load_paas_oce, return [] early when the exclude flags contain oceinstance or oce. Also wrap the per-compartment `oci.pagination.listcallgetallresults(oceclient.listoceinstances, compartment_id=...)` call in try/except and return [] on failure, so one bad compartment does not kill the whole listing.

When to use

You are seeing this: Issue oracle/oci-python-sdk#854 (closed, 7 comments): Description: We are running an OCI inventory script using the Oracle Python SDK to list all services across compartments and regions. Use this skill when you run into "OCI OCE API returning 503 ServiceUnavailable while listing instances via SDK".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Edge cases

  • Also wrap the per-compartment oci.pagination.list\call\get\all\results(oce\client.list\oce\instances, compartment\id=...) call in try/except and return [] on failure, so one bad compartment does not kill the whole listing.

Evidence

In gh:oracle/oci-python-sdk#854 (Oracle OCI Generative AI), the issue reported was: Issue oracle/oci-python-sdk#854 (closed, 7 comments): Description: We are running an OCI inventory script using the Oracle Python SDK to list all services across compartments and regions. During execution, we consistently receive a 503 ServiceUnavailable error when calling the OCE (Oracle Content and Experience) API. Error Details: Service: Oracle Content and Experience Cloud Operation: listoceinstances Status Code: 503 Error Code: ServiceUnavailable Endpoint: mount the host path https at container path //cp.oce.eu-amsterdam-1.ocp.oraclecloud.com/20190912/oceInstances (also observed in me-dubai-1) Sample Error Message: ServiceUnavailable (503) operationname: listoceinstances mes The verified resolution from the thread: The 503 from the OCE API while listing instances via the SDK was resolved by skipping OCE processing when excluded: at the top of `loadpaasoce`, return [] early when the exclude flags contain oceinstance or oce. Also wrap the per-compartment oci.pagination.list_call_get_all_results(oce_client.list_oce_instances, compartment_id=...) call in try/except and return [] on failure, so one bad compartment does not kill the whole listing. Source: mount the host path https at container path //github.com/oracle/oci-python-sdk/issues/854

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_P34SKd5pBAKIFLVXkrjgow" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">OCI OCE API returning 503 ServiceUnavailable while listing instances via SDK <span>— Vectle</span></a>