passbolt/passbolt_api · error · NotFoundException

The user does not exist.

Error message

The user does not exist.

What it means

Thrown by the AuditLog EE plugin's UserLogsController when the userId is a valid UUID but no user with that id exists in the users table. This is a 404 NotFoundException raised after the UUID format check and before rendering the logs.

Solutions

  1. Verify the user id against GET /users.json and use an existing user's id
  2. Check whether the user was deleted (soft-deleted users may still be filtered); restore or pick a valid user
  3. Confirm you are querying the correct passbolt instance/environment
  4. Handle 404 in client code by refreshing the user list rather than retrying the same id

Example fix

// before
const userId = 'aa3bdc52-1af5-4b0e-ae4f-7d0b0bb15f31'; // stale hardcoded id
// after
const user = (await getUsers()).find(u => u.username === email);
await get(`/users/${user.id}/logs.json`);
Defensive patterns

Strategy: try-catch

Validate before calling

const user = (await getUsers()).find(u => u.id === userId);
if (!user) throw new Error('User does not exist on this instance');

Try / catch

try {
  const logs = await getUserLogs(userId);
} catch (e) {
  if (e.code === 404 && /does not exist/.test(e.message)) {
    await refreshUserList(); // user was deleted or id is from another env
  } else { throw e; }
}

Prevention

When it happens

Trigger: GET /users/<userId>/logs.json with a syntactically valid UUID that does not match any user row — deleted user, hard-deleted after GDPR purge, or an id from another instance/environment.

Common situations: Referencing users removed by the admin or by user deletion during recovery; copying ids from a staging database into production calls; script caches a user list that has since changed.

Understand the failure class

Background: "User not found", "Invalid user", and "does not exist": what missing-user lookup errors mean across Rocket.Chat, LiteLLM, Phabricator, rustfs, and pnpm — this error's family across 10 libraries.

Related errors


AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17). Data as JSON: /api/errors/6ad426d3fe0a622c. Report an issue: GitHub.

Appendix: source

Thrown at plugins/PassboltEe/AuditLog/src/Controller/UserLogsController.php:54

    /**
     * View action logs for a given user.
     *
     * @param string|null $userId user id
     * @return void
     * @throws \Cake\Http\Exception\BadRequestException if the user id has the wrong format
     * @throws \Cake\Http\Exception\ForbiddenException if the UAC is not admin
     * @throws \Cake\Http\Exception\NotFoundException if the user does not exist
     */
    public function view(?string $userId = null)
    {
        $this->User->assertIsAdmin(__('Only administrators can view user logs.'));

        // Check request sanity
        if (!Validation::uuid($userId)) {
            throw new BadRequestException(__('The user identifier should be a valid UUID.'));
        }
        if (!TableRegistry::getTableLocator()->get('Users')->exists(['id' => $userId])) {
            throw new NotFoundException(__('The user does not exist.'));
        }

        $this->viewByEntity(new UserActionLogsFinder(), $userId);
    }
}

View on GitHub (pinned to 31c1bbc10f)