{"record":{"id":"7e5dbc251384ce64","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-permission-id-but","errorCode":null,"errorMessage":"Expected a non-empty value for `permission_id` but received {permission_id!r}","messagePattern":"Expected a non-empty value for `permission_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/fine_tuning/checkpoints/permissions.py","lineNumber":270,"sourceCode":"\n        Organization owners can use this endpoint to delete a permission for a\n        fine-tuned model checkpoint.\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 fine_tuned_model_checkpoint:\n            raise ValueError(\n                f\"Expected a non-empty value for `fine_tuned_model_checkpoint` but received {fine_tuned_model_checkpoint!r}\"\n            )\n        if not permission_id:\n            raise ValueError(f\"Expected a non-empty value for `permission_id` but received {permission_id!r}\")\n        return self._delete(\n            path_template(\n                \"/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}\",\n                fine_tuned_model_checkpoint=fine_tuned_model_checkpoint,\n                permission_id=permission_id,\n            ),\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=PermissionDeleteResponse,\n        )\n\n\nclass AsyncPermissions(AsyncAPIResource):","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/fine_tuning/checkpoints/permissions.py#L252-L288","documentation":"The fine-tuning checkpoint permissions delete method requires a non-empty `permission_id` path parameter. After validating the checkpoint id, the SDK also checks `permission_id` before the DELETE to `/fine_tuning/checkpoints/{checkpoint}/permissions/{permission_id}` and raises ValueError if it is None or empty. This is the id returned when the permission was created/listed.","triggerScenarios":"Calling `client.fine_tuning.checkpoints.permissions.delete(checkpoint, permission_id=\"\")` or `permission_id=None`, e.g. when only the checkpoint is known and the permission id was never recorded.","commonSituations":"Granting access without persisting the returned permission id; hardcoding placeholder ids; deleting from spreadsheets where the permission-id column is blank.","solutions":["Capture the permission id from the create/list response and pass it unchanged","If lost, call permissions.list for the checkpoint to find the id before deleting","Validate both ids are non-empty before calling delete"],"exampleFix":"# before\nclient.fine_tuning.checkpoints.permissions.delete(ckpt, \"\")\n# after\nperms = client.fine_tuning.checkpoints.permissions.list(ckpt)\nperm_id = next(p.id for p in perms if p.project_ids)\nclient.fine_tuning.checkpoints.permissions.delete(ckpt, perm_id)","handlingStrategy":"validation","validationCode":"if not permission_id:\n    perms = client.fine_tuning.checkpoints.permissions.list(ckpt)\n    permission_id = perms[0].id\nclient.fine_tuning.checkpoints.permissions.delete(ckpt, permission_id)","typeGuard":"def is_non_empty_id(value: object) -> bool:\n    return isinstance(value, str) and bool(value.strip())","tryCatchPattern":"try:\n    client.fine_tuning.checkpoints.permissions.delete(ckpt, permission_id)\nexcept ValueError as e:\n    if \"permission_id\" in str(e):\n        perms = client.fine_tuning.checkpoints.permissions.list(ckpt)\n        permission_id = perms[0].id\n        client.fine_tuning.checkpoints.permissions.delete(ckpt, permission_id)\n    else:\n        raise","preventionTips":["Persist permission ids returned by create/list","Recover lost permission ids by listing permissions for the checkpoint"],"tags":["python","openai","fine-tuning","permissions","delete","path-parameter","valueerror"],"backgroundTag":"missing-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}