{"record":{"id":"ee03c50e78916baf","repo":"passbolt/passbolt_api","slug":"the-group-does-not-exist-groupsviewcontroller","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/GroupsViewController.php","lineNumber":69,"sourceCode":"            'contain' => [\n                'modifier', 'modifier.profile', 'my_group_user',\n                'users', 'groups_users', 'groups_users.user',\n                'groups_users.user.profile', 'groups_users.user.gpgkey',\n                // Deprecated contains, use plural form instead\n                // @deprecated remove when v2 support is dropped\n                'user', 'group_user', 'group_user.user', 'group_user.user.profile',\n                'group_user.user.gpgkey',\n            ],\n        ];\n        $options = $this->QueryString->get($whitelist);\n        if (isset($options['contain']['my_group_user'])) {\n            $options['my_user_id'] = $this->User->id();\n        }\n\n        // Retrieve the group.\n        $group = $groupsTable->findView($id, $options)->first();\n        if (empty($group)) {\n            throw new NotFoundException(__('The group does not exist.'));\n        }\n\n        $this->success(__('The operation was successful.'), $group);\n    }\n}\n","sourceCodeStart":51,"sourceCodeEnd":75,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/src/Controller/Groups/GroupsViewController.php#L51-L75","documentation":"Existence check in GroupsViewController::view(): after validating the id and building the query with the whitelisted 'contain' associations (modifier/profile, users, groups_users, gpgkeys, plus deprecated singular contains), the controller throws when the group lookup returns nothing. Fires when the requested group id matches no existing group, returning HTTP 404.","triggerScenarios":"GET /groups/<uuid>.json where the group was deleted, the UUID is from another instance, or the group is filtered out by query options (e.g. has-users filter matching nothing).","commonSituations":"Stale UI open after an admin deleted the group; syncing ids across staging/production databases; copy-paste of a similar-looking UUID; passing a resource or user UUID to the groups endpoint by mistake.","solutions":["Refresh the group list (GET /groups.json) and confirm the id still exists","Verify the id type: check it isn't a user/resource UUID pasted into the groups endpoint","Confirm the client targets the correct environment/database","If the group was deleted, recreate it and update references"],"exampleFix":"// before\nconst g = await fetch(`/groups/${id}.json`).then(r => r.json()); // may 404\n// after\nconst res = await fetch(`/groups/${id}.json`);\nif (res.status === 404) {\n  const list = await fetch('/groups.json').then(r => r.json());\n  id = list.body.find(g => g.name === name)?.id;\n}\nconst g = await fetch(`/groups/${id}.json`).then(r => r.json());","handlingStrategy":"try-catch","validationCode":"const groups = await fetch('/groups.json').then(r=>r.json());\nconst current = groups.body.find(g=>g.id===groupId);\nif (!current) throw new Error(`group ${groupId} no longer exists`);","typeGuard":"null","tryCatchPattern":"try {\n  return await fetchGroup(groupId);\n} catch (e) {\n  if (e.status === 404) return refreshAndLookupByName(groupName);\n  throw e;\n}","preventionTips":["Re-fetch group lists periodically; groups can be deleted by admins","Never assume a UUID seen once remains valid","Check you're not passing a user/resource UUID to the groups endpoint"],"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"}