{"record":{"id":"17c2a95b9097707b","repo":"passbolt/passbolt_api","slug":"0-users-returned-by-your-directory-are-invalid-and-will-be","errorCode":null,"errorMessage":"{0} users returned by your directory are invalid and will be ignored during synchronization","messagePattern":"(.+?) users returned by your directory are invalid and will be ignored during synchronization","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugins/PassboltEe/DirectorySync/src/Command/TestCommand.php","lineNumber":190,"sourceCode":"        }\n\n        $io->info(__('The following groups and users have been found'));\n        $io->out($io->nl(1));\n        $io->helper('Table')->output($output);\n    }\n\n    /**\n     * Display invalid objects.\n     *\n     * @param array $data data\n     * @param \\Cake\\Console\\ConsoleIo $io Console IO.\n     * @return void\n     */\n    protected function displayInvalidEntries(array $data, ConsoleIo $io): void\n    {\n        if (count($data['users'])) {\n            $io->hr();\n            $io->err(\n                __(\n                    '{0} users returned by your directory are invalid and will be ignored during synchronization',\n                    count($data['users'])\n                )\n            );\n            $io->err(__('bin/cake directory_sync test --verbose for more details'));\n            $io->hr();\n            foreach ($data['users'] as $user) {\n                $io->verbose(__('Error: ') . $user->getErrorsAsString());\n                $io->verbose(json_encode($user->toArray(), JSON_PRETTY_PRINT));\n            }\n        }\n\n        if (count($data['groups'])) {\n            $io->hr();\n            $io->err(\n                __(\n                    '{0} group(s) returned by your directory are invalid and will be ignored during synchronization',","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/DirectorySync/src/Command/TestCommand.php#L172-L208","documentation":"TestCommand::displayInvalidEntries warns that N users returned by the directory failed entity validation and will be skipped during synchronization. This is an expected informational diagnostic: the directory data was fetched, but entries don't satisfy passbolt user entity rules. The count is interpolated via the {0} placeholder.","triggerScenarios":"`bin/cake passbolt directory_sync test` where $directoryResults->getUsers() contains entities that failed validation (e.g. missing email, invalid DN mapping, missing first/last name rules).","commonSituations":"Directory entries without mail attribute, entries mapped from wrong OUs, attribute mapping misconfigured so required user fields are empty, or entries failing unique-email checks against existing users.","solutions":["Re-run with --verbose to see per-user getErrorsAsString() details printed after this message.","Fix the offending directory entries (add/repair mail attribute, correct OU scope).","Review attribute mapping configuration so required user fields are populated.","Exclude invalid OUs/entries from the directory sync search scope."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$invalid = array_filter($users, fn($u) => (bool)$u->getErrors());\nif ($invalid) { echo count($invalid) . \" invalid users will be skipped\\n\"; }","typeGuard":"foreach ($data['users'] as $user) {\n    if (!($user instanceof \\App\\Model\\Entity\\User)) { continue; }\n    if ($user->getErrors()) { /* handle */ }\n}","tryCatchPattern":null,"preventionTips":["Run directory_sync test --verbose before real syncs","Ensure mail/first-name/last-name attributes are mapped and populated","Limit LDAP search scope to valid user OUs","Deduplicate emails against existing passbolt users"],"tags":["cli","ldap","directory-sync","validation"],"backgroundTag":"schema-validation-failed","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"}