{"record":{"id":"2d0560c4f54cfd68","repo":"passbolt/passbolt_api","slug":"the-user-with-username-s-does-not-exist-is-not-active-or-is","errorCode":null,"errorMessage":"The user with username `%s`does not exist, is not active or is disabled.","messagePattern":"The user with username `(.+?)`does not exist, is not active or is disabled\\.","errorType":"console","errorClass":"StopException","httpStatus":null,"severity":"error","filePath":"src/Service/Command/GetUserCommandService.php","lineNumber":50,"sourceCode":"    /**\n     * Get user from given username argument option.\n     *\n     * @throws \\Cake\\Console\\Exception\\StopException If user doesn't exist.\n     */\n    public function getUser(Arguments $args): User\n    {\n        $username = $args->getOption('username');\n        /** @var \\App\\Model\\Table\\UsersTable $usersTable */\n        $usersTable = $this->fetchTable('Users');\n\n        /** @var \\App\\Model\\Entity\\User|null $user */\n        $user = $usersTable\n            ->findByUsername($username)\n            ->find('activeNotDeleted')\n            ->find('notDisabled')\n            ->first();\n        if ($user === null) {\n            throw new StopException(\n                sprintf('The user with username `%s`does not exist, is not active or is disabled.', $username)\n            );\n        }\n\n        return $user;\n    }\n}\n","sourceCodeStart":32,"sourceCodeEnd":58,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/src/Service/Command/GetUserCommandService.php#L32-L58","documentation":"Thrown by GetUserCommandService::getUser() when looking up a CLI-passed username fails to match an existing user that is both active and not disabled. The query chains findByUsername with the 'activeNotDeleted' and 'notDisabled' finders, so any of: missing user, soft-deleted user, inactive (not activated) user, or disabled user results in null and this error. It is a StopException, so it terminates the CLI command.","triggerScenarios":"Running a passbolt CLI command (e.g. user management/ownership transfer commands) with --username pointing to a username that was never registered, was deleted, was never activated (activation token not completed), or has is_active=false / is_disabled=true.","commonSituations":"Typo in the username or wrong case; referencing a user deleted via the UI; users imported but whose activation email was never completed; disabled accounts after security incidents; staging databases where the target user does not exist.","solutions":["Verify the username with a DB query or `passbolt users list` and correct any typo/case mismatch.","If the user exists but is inactive, complete activation (resend invite or set active via admin) before running the command.","If the user is disabled, re-enable the account (is_disabled=false) or choose another user.","If the user was deleted, pick a different existing active user for the command."],"exampleFix":"// before\nbin/cake command --username jdoe@example.com\n// after\nbin/cake passbolt users list   # confirm exact username of an active, non-disabled user\nbin/cake command --username john.doe@example.com","handlingStrategy":"validation","validationCode":"if (!filter_var($username, FILTER_VALIDATE_EMAIL)) { throw new InvalidArgumentException('username must be an email'); }\n// then confirm the user exists/active: SELECT id FROM users WHERE username = ? AND active = 1 AND deleted = 0 AND disabled = 0","typeGuard":null,"tryCatchPattern":"// StopException terminates the command; wrap the whole command run\ntry {\n    $user = $service->getUser($username);\n} catch (StopException $e) {\n    $this->error($e->getMessage());\n    $this->abort(1);\n}","preventionTips":["List users and copy the exact username instead of typing it","Check the user is active and not disabled before running admin commands","Complete account activation workflows before automation targets that user"],"tags":["cli","user-management","validation"],"backgroundTag":"user-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"}