passbolt/passbolt_api · error
$msg
Error message
$msg
What it means
SyncCommandTrait::displayReport() formats one line of the directory-sync report: a padded [STATUS] tag plus the report message, printed via $io->err($msg). For STATUS_ERROR reports carrying a SyncError, it further inspects the underlying exception and, for ValidationException, displays the validation errors. This output is the human-readable per-item failure line during `passbolt directory_sync`.
Solutions
- Read the [ERROR] line's report message to identify the failing entity and action.
- For ValidationException cases, inspect the displayed per-field validation errors.
- Fix the source data in LDAP (e.g. malformed email) or the conflicting passbolt record.
- Re-run the sync after corrections; check the DirectorySync error reports in the admin UI for history.
- Use the ignore command to skip permanently unfixable directory entries.
Example fix
// before
$msg = str_pad('[' . $report->getStatus() . ']', $this->pad);
$msg .= $report->getMessage();
// after
$msg = str_pad('[' . $report->getStatus() . ']', $this->pad);
$msg .= $report->getMessage();
if ($report->getStatus() === Alias::STATUS_ERROR && $report->getData() instanceof SyncError) {
$msg .= ' (entity: ' . ($report->getData()->getEntity()->id ?? 'n/a') . ')';
} Defensive patterns
Strategy: validation
Validate before calling
// pre-validate directory data before sync so reports stay clean
$errors = $Users->newEntity($ldapUserData)->getErrors();
if ($errors) {
// fix LDAP-sourced fields (email, username, profile) before running sync
var_dump($errors);
} Type guard
function hasSyncableData($report): bool {
$data = $report->getData();
return !$data instanceof \Passbolt\DirectorySync\Model\Entity\SyncError
|| !($data->getException() instanceof \Cake\Datasource\Validation\ValidationException);
} Try / catch
// reports are aggregated, not thrown — handle error-status reports after sync
foreach ($reports as $report) {
if ($report->getStatus() === \Passbolt\DirectorySync\Model\Utility\SyncAction::STATUS_ERROR) {
$this->displayReport($report, $io);
}
} Prevention
- Clean LDAP data (emails, usernames) before syncing to avoid validation errors.
- Resolve conflicts between directory entries and existing passbolt users first.
- Review the sync report after every run and fix [ERROR] items promptly.
- Use the ignore command for directory entries that can never pass validation.
When it happens
Trigger: Running a directory sync that produced error-status report entries — e.g. an LDAP user/group failed to create, update, or delete in passbolt because of validation errors or save failures during DirectorySync processing.
Common situations: Syncing LDAP entries whose data violates passbolt rules (invalid email, missing username, deleted users); conflicts between LDAP directory entries and existing passbolt records; duplicate usernames/emails from the directory.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- group(s) returned by your directory are invalid and will be…
- users returned by your directory are invalid and will be…
- $exception->getMessage()
- $message
- The record model is not valid.
AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17).
Data as JSON: /api/errors/afa7c771440f1d33.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/PassboltEe/DirectorySync/src/Command/SyncCommandTrait.php:101
);
$io->out();
}
/**
* Display report
*
* @param \Passbolt\DirectorySync\Actions\Reports\ActionReport $report report
* @param \Cake\Console\ConsoleIo $io Console IO.
* @return void
*/
protected function displayReport(ActionReport $report, ConsoleIo $io): void
{
$msg = str_pad('[' . $report->getStatus() . ']', $this->pad);
$msg .= $report->getMessage();
$data = $report->getData();
switch ($report->getStatus()) {
case Alias::STATUS_ERROR:
$io->err($msg);
if ($data instanceof SyncError) {
$exception = $data->getException();
if ($exception instanceof ValidationException) {
$this->displayValidationError($exception->getErrors(), $io);
$id = $exception->getEntity()->get('id');
$model = $this->model;
} else {
$id = $data->getEntity()->get('id');
$model = 'DirectoryEntries';
}
$p = str_pad('', $this->pad);
$io->out($p . __('To ignore this error in the next sync please run'));
$io->out($p . "./bin/cake directory_sync ignore_create --id=$id --model=$model");
}
break;
case Alias::STATUS_SYNC:
case Alias::STATUS_SUCCESS:View on GitHub (pinned to 31c1bbc10f)