passbolt/passbolt_api · info · NotFoundException
The record is currently not ignored as part of directory…
Error message
The record is currently not ignored as part of directory synchronization.
What it means
This NotFoundException (HTTP 404) is thrown in view() when DirectoryIgnore->get($foreignKey) finds no ignore record for the given id, meaning that user/group/directory-entry is currently NOT ignored by directory synchronization. The endpoint only succeeds when an ignore entry exists, so absence of an entry is reported as not-found.
Solutions
- Treat 404 here as the success state 'not ignored' rather than a hard failure
- Confirm the correct foreignKey uuid (list users/groups/directory entries first)
- Re-check after running a directory sync if you expected an auto-created ignore entry
- Create the ignore entry via POST /directoryignore/{model}/{uuid} before querying it
Example fix
// client-side handling
try { $status = $api->getIgnoreStatus($model, $id); }
catch (NotFoundException $e) { $status = false; // record is not ignored
} Defensive patterns
Strategy: try-catch
Validate before calling
$ignored = array_filter($api->get('/directoryignore.json')['ignoredRecords'] ?? [],
fn($r) => $r['foreign_key'] === $id); Try / catch
try {
$api->get("/directoryignore/{$model}/{$id}.json");
// record IS ignored
} catch (NotFoundException $e) {
// 404 means: record is NOT ignored (expected state, not failure)
} Prevention
- Model the ignore check as a boolean lookup, not a hard fetch
- Treat 404 on this endpoint as a valid 'not ignored' answer
- Refresh cached ignore lists before status checks
When it happens
Trigger: GET /directoryignore/users/{uuid} where no row exists in the directory_ignore table for that uuid (record was never ignored, or its ignore entry was already deleted).
Common situations: Polling ignore status for a record after another admin already un-ignored it; checking a newly created user/group never marked as ignored; stale id lists cached by an integration.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- The record does not exist.
- AssociatedRecordExists
- The record could not be found.
- group(s) returned by your directory are invalid and will be…
- users returned by your directory are invalid and will be…
AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17).
Data as JSON: /api/errors/0c979ad31eafb0c5.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/PassboltEe/DirectorySync/src/Controller/DirectoryIgnoreController.php:104
* @throws \Cake\Http\Exception\ForbiddenException if the current user is not an admin
* @return void
*/
public function view(string $foreignModel, string $foreignKey): void
{
if ($this->User->role() !== Role::ADMIN) {
throw new ForbiddenException(__('You are not authorized to access that location.'));
}
$this->assertDirectoryEnabled();
$foreignModel = $this->normalizeForeignModel($foreignModel);
if (!Validation::inList($foreignModel, ['Groups', 'Users', 'DirectoryEntries'])) {
throw new BadRequestException(__('The record model is not valid.'));
}
try {
$ignored = $this->DirectoryIgnore->get($foreignKey);
} catch (RecordNotFoundException $exception) {
$msg = __('The record is currently not ignored as part of directory synchronization.');
throw new NotFoundException($msg);
}
$this->success(__('The record is currently ignored as part of directory synchronization.'), $ignored);
}
/**
* Mark a record as ignored.
*
* @param string $foreignModel foreign model
* @param string $foreignKey foreign key
* @throws \App\Error\Exception\ValidationException If the model name or id is not valid
* @throws \Cake\Http\Exception\ForbiddenException if the current user is not an admin
* @return void
*/
public function add(string $foreignModel, string $foreignKey): void
{
if ($this->User->role() !== Role::ADMIN) {
throw new ForbiddenException(__('You are not authorized to access that location.'));
}View on GitHub (pinned to 31c1bbc10f)