{"record":{"id":"7aee4fe327794b37","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-container-id-but","errorCode":null,"errorMessage":"Expected a non-empty value for `container_id` but received {container_id!r}","messagePattern":"Expected a non-empty value for `container_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/containers/containers.py","lineNumber":145,"sourceCode":"        extra_headers: Headers | None = None,\n        extra_query: Query | None = None,\n        extra_body: Body | None = None,\n        timeout: float | httpx2.Timeout | None | NotGiven = not_given,\n    ) -> ContainerRetrieveResponse:\n        \"\"\"\n        Retrieve Container\n\n        Args:\n          extra_headers: Send extra headers\n\n          extra_query: Add additional query parameters to the request\n\n          extra_body: Add additional JSON properties to the request\n\n          timeout: Override the client-level default timeout for this request, in seconds\n        \"\"\"\n        if not container_id:\n            raise ValueError(f\"Expected a non-empty value for `container_id` but received {container_id!r}\")\n        return self._get(\n            path_template(\"/containers/{container_id}\", container_id=container_id),\n            options=make_request_options(\n                extra_headers=extra_headers,\n                extra_query=extra_query,\n                extra_body=extra_body,\n                timeout=timeout,\n                security={\"bearer_auth\": True},\n            ),\n            cast_to=ContainerRetrieveResponse,\n        )\n\n    def list(\n        self,\n        *,\n        after: str | Omit = omit,\n        limit: int | Omit = omit,\n        name: str | Omit = omit,","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/containers/containers.py#L127-L163","documentation":"Containers.retrieve (sync) requires a truthy container_id for GET /containers/{container_id}. Client-side validation of required path parameters; ValueError is raised for None/empty values without any HTTP request.","triggerScenarios":"`client.containers.retrieve(\"\")` or passing a None container id from a create response that wasn't captured or a config lookup miss.","commonSituations":"Using the Codex/containers API with ids stored in env or DB where the field is absent; passing the container object instead of `.id`.","solutions":["Capture the id from `container = client.containers.create(...)` and pass `container.id`.","Validate env/DB-sourced ids are non-empty strings before use.","Check the keyword argument spelling."],"exampleFix":"# before\nclient.containers.retrieve(container_id=os.getenv(\"CONTAINER_ID\"))\n# after\ncid = os.getenv(\"CONTAINER_ID\")\nif not cid:\n    raise RuntimeError(\"CONTAINER_ID not set\")\nclient.containers.retrieve(container_id=cid)","handlingStrategy":"validation","validationCode":"if not container_id:\n    raise ValueError(\"container_id must be non-empty\")\nclient.containers.retrieve(container_id)","typeGuard":"def is_valid_id(value: object) -> bool:\n    return isinstance(value, str) and bool(value.strip())","tryCatchPattern":null,"preventionTips":["Capture container.id from the create response.","Fail fast on missing env-sourced ids at startup."],"tags":["python","openai","validation","path-parameter","containers-api"],"backgroundTag":"missing-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}