{"record":{"id":"8d8717cb52c54c20","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-file-id-but-recei-8d8717","errorCode":null,"errorMessage":"Expected a non-empty value for `file_id` but received {file_id!r}","messagePattern":"Expected a non-empty value for `file_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/containers/files/files.py","lineNumber":147,"sourceCode":"        extra_body: Body | None = None,\n        timeout: float | httpx2.Timeout | None | NotGiven = not_given,\n    ) -> FileRetrieveResponse:\n        \"\"\"\n        Retrieve Container File\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        if not file_id:\n            raise ValueError(f\"Expected a non-empty value for `file_id` but received {file_id!r}\")\n        return self._get(\n            path_template(\"/containers/{container_id}/files/{file_id}\", container_id=container_id, file_id=file_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=FileRetrieveResponse,\n        )\n\n    def list(\n        self,\n        container_id: str,\n        *,\n        after: str | Omit = omit,\n        limit: int | Omit = omit,","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/containers/files/files.py#L129-L165","documentation":"The SDK refuses empty path segments: files.retrieve raises ValueError when `file_id` is falsy. wait_for_file_processing calls retrieve internally, so an empty file id surfaces at this line during polling.","triggerScenarios":"Calling files.retrieve or wait_for_file_processing with file_id=None/''; passing the whole File object or a filename instead of the id; the upload response missing an id field.","commonSituations":"Polling immediately after an upload where the response was not parsed; accessing file['id'] on a dict lacking that key via .get().","solutions":["Pass the file id string returned by files.create","Validate file_id before retrieve/polling","Inspect the upload response object to confirm the id attribute name"],"exampleFix":"// before\nclient.containers.files.wait_for_file_processing(container_id, file_id=None)\n// after\nif not file_id:\n    raise ValueError(\"file_id is required\")\nclient.containers.files.wait_for_file_processing(container_id, file_id)","handlingStrategy":"validation","validationCode":"if not file_id:\n    raise ValueError('file_id required; use the id from the upload response')","typeGuard":"def valid_file_id(v: str | None) -> bool:\n    return bool(v and v.strip())","tryCatchPattern":"try:\n    client.containers.files.wait_for_file_processing(container_id, file_id)\nexcept ValueError as e:\n    if 'file_id' in str(e):\n        skip_and_log(e)\n    else:\n        raise","preventionTips":["Keep upload responses until polling completes","Add schema validation for stored upload records","Test polling paths with empty ids in CI"],"tags":["openai","python","validation","containers","polling"],"backgroundTag":"missing-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}