{"record":{"id":"8167aee402a72604","repo":"cocoindex-io/cocoindex","slug":"oci-is-required-to-use-the-oracle-cloud-infrastruc","errorCode":null,"errorMessage":"oci is required to use the Oracle Cloud Infrastructure Object Storage source connector. Please install cocoindex[oci].","messagePattern":"oci is required to use the Oracle Cloud Infrastructure Object Storage source connector\\. Please install cocoindex\\[oci\\]\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"python/cocoindex/connectors/oci_object_storage/_source.py","lineNumber":38,"sourceCode":"    \"OCIWalker\",\n    \"get_object\",\n    \"list_objects\",\n    \"read\",\n]\n\nimport asyncio\nimport contextlib\nimport json\nimport logging\nfrom collections.abc import AsyncIterable, AsyncIterator\nfrom datetime import datetime, timedelta, timezone\nfrom pathlib import PurePath\nfrom typing import Any, Iterator, cast\n\ntry:\n    from oci.exceptions import ServiceError  # type: ignore[import-not-found]\nexcept ImportError as e:\n    raise ImportError(\n        \"oci is required to use the Oracle Cloud Infrastructure Object \"\n        \"Storage source connector. Please install cocoindex[oci].\"\n    ) from e\n\nfrom cocoindex._internal.live_component import (\n    _IMMEDIATE_READY,\n    LiveMapSubscriber,\n    LiveStream,\n    ReadyAwaitable,\n)\nfrom cocoindex.connectorkits import SingleWatcherGuard\nfrom cocoindex.resources import file\n\n_logger = logging.getLogger(__name__)\n\n_OBJECT_EVENT_PREFIX = \"com.oraclecloud.objectstorage.\"\n\n# Wall-clock tolerance for the event-time cutoff. Events with eventTime older","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/cocoindex-io/cocoindex/blob/e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b/python/cocoindex/connectors/oci_object_storage/_source.py#L20-L56","documentation":"The Oracle Cloud Infrastructure Object Storage source connector optionally depends on the `oci` package. The import is wrapped in try/except at module load, and if `oci` is missing the module raises ImportError with instructions to install the cocoindex[oci] extra.","triggerScenarios":"Importing python/cocoindex/connectors/oci_object_storage/_source.py (directly or via `from cocoindex.connectors import oci_object_storage`) in an environment where the `oci` package is not installed.","commonSituations":"Installing cocoindex without extras (pip install cocoindex) then using the OCI connector; deploying to a container where optional dependencies were pruned.","solutions":["Install the extra: pip install \"cocoindex[oci]\" (or uv add \"cocoindex[oci]\").","Install the oci package directly: pip install oci.","If OCI is not needed, remove the oci_object_storage import/usage from the pipeline."],"exampleFix":"// before\npip install cocoindex\n// after\npip install \"cocoindex[oci]\"","handlingStrategy":"fallback","validationCode":"import importlib.util\nif importlib.util.find_spec(\"oci\") is None:\n    raise SystemExit(\"Install the OCI extra: pip install 'cocoindex[oci]'\")","typeGuard":null,"tryCatchPattern":"try:\n    from cocoindex.connectors import oci_object_storage\nexcept ImportError as e:\n    raise SystemExit(f\"OCI connector unavailable: {e}\") from e","preventionTips":["Install optional extras for every connector you use: pip install \"cocoindex[oci]\".","Pin the extras in pyproject.toml/requirements so CI and prod get them.","Smoke-test imports of all connectors in CI before deployment."],"tags":["python","import-error","optional-dependency","oci"],"backgroundTag":"missing-optional-dependency","analyzedSha":"e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b","analyzedAt":"2026-09-08T15:59:19.997Z","contentChangedAt":"2026-09-08T15:59:19.997Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}