{"record":{"id":"14adfe2d5bda410e","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-project-id-but-re-14adfe","errorCode":null,"errorMessage":"Expected a non-empty value for `project_id` but received {project_id!r}","messagePattern":"Expected a non-empty value for `project_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/admin/organization/projects/groups/groups.py","lineNumber":86,"sourceCode":"    ) -> ProjectGroup:\n        \"\"\"\n        Grants a group access to a project.\n\n        Args:\n          group_id: Identifier of the group to add to the project.\n\n          role: Identifier of the project role to grant to the group.\n\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 project_id:\n            raise ValueError(f\"Expected a non-empty value for `project_id` but received {project_id!r}\")\n        return self._post(\n            path_template(\"/organization/projects/{project_id}/groups\", project_id=project_id),\n            body=maybe_transform(\n                {\n                    \"group_id\": group_id,\n                    \"role\": role,\n                },\n                group_create_params.GroupCreateParams,\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={\"admin_api_key_auth\": True},\n            ),\n            cast_to=ProjectGroup,\n        )","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/admin/organization/projects/groups/groups.py#L68-L104","documentation":"The sync project Groups `create` method validates `project_id` before POSTing `/organization/projects/{project_id}/groups` with group_id and role. A falsy value would corrupt the URL, so the SDK raises this ValueError client-side with no network activity.","triggerScenarios":"Calling groups.create(project_id=..., group_id=..., role=...) with an empty project id; config or env lookups returning None.","commonSituations":"Onboarding automation missing required env config; empty project field in tenant data; placeholder never replaced.","solutions":["Pass the real project id from the dashboard or projects.list","Validate required identifiers at startup in provisioning scripts","Log the full argument set before create operations"],"exampleFix":"# before\nclient.admin.organization.projects.groups.create(project_id=\"\", group_id=\"grp_123\", role=\"member\")\n\n# after\nclient.admin.organization.projects.groups.create(project_id=\"proj_abc123\", group_id=\"grp_123\", role=\"member\")","handlingStrategy":"validation","validationCode":"if not project_id:\n    raise ValueError(\"project_id required to add group\")\nclient.admin.organization.projects.groups.create(project_id=project_id, group_id=group_id, role=role)","typeGuard":"def is_valid_project_id(v: str | None) -> bool:\n    return isinstance(v, str) and bool(v.strip())","tryCatchPattern":"try:\n    client.admin.organization.projects.groups.create(project_id=pid, group_id=gid, role=role)\nexcept ValueError as e:\n    logger.error(\"group create rejected: %s\", e)\n    raise","preventionTips":["Validate identifiers in provisioning scripts","Fail fast on missing env config","Log argument sets before create operations"],"tags":["openai","python","validation","path-parameter","groups","admin-api"],"backgroundTag":"missing-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}