passbolt/passbolt_api · error · Cake\Http\Exception\NotFoundException
The user does not exist.
Error message
The user does not exist.
What it means
After building the user query (including MFA decoration), the controller wraps `$query->first()` in a try/catch: any exception from the database layer (e.g. malformed UUID reaching the query, SQL error from the MFA decoration query) is swallowed and re-thrown as a 404 NotFoundException 'The user does not exist.' to avoid leaking storage errors.
Solutions
- Run migrations for the MFA plugin (`passbolt migrate` / `bin/cake passbolt migrate`) so IsMfaEnabledQueryService finds its tables.
- Check database connectivity and server logs (logs/error.log) for the underlying exception the 404 masks.
- Confirm the requested id is a valid, existing user UUID.
- If the user genuinely does not exist, this is expected — list users via GET /users.json to get valid ids.
Defensive patterns
Strategy: try-catch
Try / catch
try {
const res = await api.get(`/users/${uuid}.json`);
} catch (e) {
if (e.response?.status === 404) {
// Masked query failure (MFA decoration/DB issue) or missing user:
// check server logs and run migrations before assuming the user is absent.
console.warn('User lookup failed; verify user exists and MFA migrations are applied.');
return null;
}
throw e;
} Prevention
- Keep MFA plugin migrations current (`passbolt migrate`) so the decoration query never fails.
- Treat 404 from this endpoint as ambiguous: check server logs for the underlying exception.
- Confirm DB connectivity before diagnosing 'missing user' errors.
- Test lookups across drivers (Postgres/MySQL) when upgrading.
When it happens
Trigger: GET /users/{id}.json where executing the decorated query throws — most commonly when the MFA decoration query (IsMfaEnabledQueryService::decorateForView) fails, or the id passed to the query is malformed/unusable by the driver.
Common situations: MFA plugin tables missing/mis-migrated so the decoration query errors; database connectivity issues; a non-UUID id slipping through to the query layer; DB driver differences (Postgres vs MySQL) causing the MFA subquery to fail.
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
- The user does not exist.
- API v1 support is deprecated in this version.
- Could not validate resource data.
- Could not validate the password policies settings.
- Entity not found.
AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17).
Data as JSON: /api/errors/af58ec076029e01f.
Report an issue: GitHub.
Appendix: source
Thrown at src/Controller/Users/UsersViewController.php:79
// Trigger an event to filter data, decorate results, add contain, etc.
$event = TableFindIndexBefore::create(
$query,
FindIndexOptions::createFromArray(['query' => $query]),
$usersTable
);
/** @var \App\Model\Event\TableFindIndexBefore $event */
$this->getEventManager()->dispatch($event);
$query = $event->getQuery();
if ($this->isFeaturePluginEnabled('MultiFactorAuthentication')) {
(new IsMfaEnabledQueryService())->decorateForView($query, $this->User->getAccessControl(), $id);
}
try {
$user = $query->first();
} catch (Exception $exception) {
throw new NotFoundException(__('The user does not exist.'));
}
if (empty($user)) {
throw new NotFoundException(__('The user does not exist.'));
}
$this->success(__('The operation was successful.'), $user);
}
}
View on GitHub (pinned to 31c1bbc10f)