{"record":{"id":"79d33a719a56c4dc","repo":"passbolt/passbolt_api","slug":"the-group-does-not-exist","errorCode":null,"errorMessage":"The group does not exist.","messagePattern":"The group does not exist\\.","errorType":"exception","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"src/Controller/Groups/GroupsUpdateController.php","lineNumber":131,"sourceCode":"\n    /**\n     * Assert the request parameter.\n     *\n     * @param \\App\\Utility\\UserAccessControl $uac The operator\n     * @param string $id group uuid\n     * @return void\n     * @throws \\Cake\\Http\\Exception\\ForbiddenException If the operator is not a group manager or an admin\n     * @throws \\Cake\\Http\\Exception\\BadRequestException if the group uuid id invalid\n     */\n    protected function assertRequestParameter(UserAccessControl $uac, string $id)\n    {\n        if (!Validation::uuid($id)) {\n            throw new BadRequestException(__('The group id is not valid.'));\n        }\n\n        $exists = $this->Groups->exists(['id' => $id]);\n        if (!$exists) {\n            throw new NotFoundException(__('The group does not exist.'));\n        }\n\n        // If the user is not manager of the group nor admin\n        $isGroupManager = $this->GroupsUsers->isManager($uac->getId(), $id);\n        $isAdmin = $uac->isAdmin();\n        if (!$isGroupManager && !$isAdmin) {\n            throw new ForbiddenException(__('You are not authorized to access that location.'));\n        }\n    }\n\n    /**\n     * Get and format the request data.\n     *\n     * @return array\n     */\n    protected function _formatRequestData()\n    {\n        $data = $this->request->getData();","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/src/Controller/Groups/GroupsUpdateController.php#L113-L149","documentation":"Passbolt throws this 404 when updating a group whose id is syntactically a valid UUID but does not match any row in the groups table. GroupsUpdateController::assertRequestParameter checks Groups->exists(['id' => $id]) before doing anything else and fails fast so no permission checks run on a non-existent group.","triggerScenarios":"Calling PUT /groups/<id> (or its dry-run variant) with an id that is a valid UUID but was never created, was already deleted, or belongs to another environment's database.","commonSituations":"Stale URLs/bookmarks after a group was deleted; copying an id from a different install or test fixture; a client caching group ids after a purge/migration; hardcoding ids from documentation examples.","solutions":["List groups via GET /groups.json and confirm the target id exists, then retry with a valid id","Check the groups table (SELECT id FROM groups WHERE id='<id>') to verify presence in the connected database","If the group was deleted, recreate it or update the calling client to use the current group id","Ensure the client is pointed at the intended environment (the id may exist elsewhere)"],"exampleFix":"// before\nawait fetch(`/groups/${staleGroupId}.json`, {method: 'PUT', ...});\n// after\nconst groups = await fetch('/groups.json').then(r => r.json());\nconst group = groups.body.find(g => g.name === 'Marketing');\nawait fetch(`/groups/${group.id}.json`, {method: 'PUT', ...});","handlingStrategy":"validation","validationCode":"const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nif (!UUID_RE.test(groupId)) throw new Error('invalid group id');\nconst exists = (await fetch('/groups.json').then(r=>r.json())).body.some(g=>g.id===groupId);\nif (!exists) throw new Error(`group ${groupId} not found on this instance`);","typeGuard":"const isUuid = (v) => typeof v === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(v);","tryCatchPattern":"try {\n  await passbolt.group.update(groupId, payload);\n} catch (e) {\n  if (e.status === 404 && /group does not exist/i.test(e.message)) {\n    // refresh id from /groups.json and retry once\n  } else throw e;\n}","preventionTips":["Resolve ids from the groups index endpoint instead of caching them long-term","Treat 404 on group mutations as 're-sync id list' signal","Never hardcode group UUIDs from docs or other environments"],"tags":["http-404","rest-api","groups","uuid"],"backgroundTag":"entity-not-found","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}