{"record":{"id":"837c97a959c3545e","repo":"Significant-Gravitas/AutoGPT","slug":"slug-data-slug-is-already-in-use-as-an-alias","errorCode":null,"errorMessage":"Slug '{data.slug}' is already in use as an alias","messagePattern":"Slug '(.+?)' is already in use as an alias","errorType":"http","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/orgs/db.py","lineNumber":355,"sourceCode":"    if data.name is not None:\n        update_dict[\"name\"] = data.name\n    if data.description is not None:\n        update_dict[\"description\"] = data.description\n    if data.avatar_url is not None:\n        update_dict[\"avatarUrl\"] = data.avatar_url\n\n    if data.slug is not None:\n        existing = await prisma.organization.find_unique(where={\"slug\": data.slug})\n        if existing and existing.id != org_id:\n            raise ValueError(f\"Slug '{data.slug}' is already in use\")\n        existing_alias = await prisma.organizationalias.find_unique(\n            where={\"aliasSlug\": data.slug}\n        )\n        # Only a DIFFERENT org's alias blocks the slug — after a rename the\n        # previous slug is stored as this org's own RENAME alias, and\n        # renaming back must promote it, not fail with \"already in use\".\n        if existing_alias and existing_alias.organizationId != org_id:\n            raise ValueError(f\"Slug '{data.slug}' is already in use as an alias\")\n\n        old_org = await prisma.organization.find_unique(where={\"id\": org_id})\n        if old_org and old_org.slug != data.slug:\n            if existing_alias:\n                # Re-claiming our own alias as the primary slug.\n                await prisma.organizationalias.delete(where={\"aliasSlug\": data.slug})\n            await prisma.organizationalias.create(\n                data={\n                    \"organizationId\": org_id,\n                    \"aliasSlug\": old_org.slug,\n                    \"aliasType\": \"RENAME\",\n                }\n            )\n        update_dict[\"slug\"] = data.slug\n\n    if not update_dict:\n        return await get_org(org_id)\n","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/orgs/db.py#L337-L373","documentation":"Error \"Slug '{data.slug}' is already in use as an alias\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/orgs/db.py:355 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a different slug; it is reserved as an alias of another organization.","Remove the conflicting alias first if you own that organization."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}