{"record":{"id":"2a20e65b8d45dbe2","repo":"passbolt/passbolt_api","slug":"the-group-does-not-exist-or-has-been-already-deleted","errorCode":null,"errorMessage":"The group does not exist or has been already deleted.","messagePattern":"The group does not exist or has been already deleted\\.","errorType":"exception","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"src/Controller/Groups/GroupsDeleteController.php","lineNumber":156,"sourceCode":"     * @throws \\Cake\\Http\\Exception\\NotFoundException if the group does not exist or is already deleted\n     * @return \\App\\Model\\Entity\\Group $group entity\n     */\n    protected function _validateRequestData(string $id)\n    {\n        // Admin can delete all groups\n        if ($this->User->role() !== Role::ADMIN) {\n            if (!$this->GroupsUsers->isManager($this->User->id(), $id)) {\n                throw new ForbiddenException(__('You are not authorized to access that location.'));\n            }\n        }\n        if (!Validation::uuid($id)) {\n            throw new BadRequestException(__('The group identifier should be a valid UUID.'));\n        }\n\n        /** @var \\App\\Model\\Entity\\Group $group */\n        $group = $this->Groups->findView($id, ['contain' => ['groups_users' => true]])->first();\n        if (empty($group)) {\n            throw new NotFoundException(__('The group does not exist or has been already deleted.'));\n        }\n\n        return $group;\n    }\n\n    /**\n     * Validate the delete operation\n     *\n     * @param \\App\\Model\\Entity\\Group $group The target group\n     * @throws \\App\\Error\\Exception\\CustomValidationException if the group is sole owner of a shared resource\n     * @return void\n     */\n    protected function _validateDelete(Group $group)\n    {\n        // Check business rules\n        // Returning the validation error is not meaningful enough so we need to\n        // build the proper answer with list of incriminated resources that needs transfer\n        // of ownership if any","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/src/Controller/Groups/GroupsDeleteController.php#L138-L174","documentation":"Existence validation in GroupsDeleteController::_validateRequestData() (used by both dryRun and delete): the group id must resolve to an existing, non-deleted group before deletion can proceed. Fires when the id is well-formed but no live group matches (never existed or already deleted), returning HTTP 404; a malformed id raises a BadRequestException and insufficient rights a ForbiddenException earlier in the same method.","triggerScenarios":"Thrown at src/Controller/Groups/GroupsDeleteController.php:156 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the group exists and is not deleted","Handle 404 as already deleted in the client"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}