{"record":{"id":"422b73a1aebacf24","repo":"n8n-io/n8n","slug":"could-not-find-the-user-with-the-id-userid-or-t","errorCode":null,"errorMessage":"Could not find the user with the ID ${userId} or their personalProject.","messagePattern":"Could not find the user with the ID (.+?) or their personalProject\\.","errorType":"exception","errorClass":"UserError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/ldap/reset.ts","lineNumber":159,"sourceCode":"\t\tthis.logger.info('Successfully reset the database to default ldap state.');\n\t}\n\n\tasync getProject(userId?: string, projectId?: string) {\n\t\tif (projectId) {\n\t\t\tconst project = await Container.get(ProjectRepository).findOneBy({ id: projectId });\n\n\t\t\tif (project === null) {\n\t\t\t\tthrow new UserError(`Could not find the project with the ID ${projectId}.`);\n\t\t\t}\n\n\t\t\treturn project;\n\t\t}\n\n\t\tif (userId) {\n\t\t\tconst project = await Container.get(ProjectRepository).getPersonalProjectForUser(userId);\n\n\t\t\tif (project === null) {\n\t\t\t\tthrow new UserError(\n\t\t\t\t\t`Could not find the user with the ID ${userId} or their personalProject.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn project;\n\t\t}\n\n\t\tthrow new UserError(wrongFlagsError);\n\t}\n\n\tasync catch(error: Error): Promise<void> {\n\t\tthis.logger.error('Error resetting database. See log messages for details.');\n\t\tthis.logger.error(error.message);\n\t}\n\n\tprivate async getOwner() {\n\t\tconst owner = await Container.get(UserRepository).findOne({\n\t\t\twhere: { role: { slug: GLOBAL_OWNER_ROLE.slug } },","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/cli/src/commands/ldap/reset.ts#L141-L177","documentation":"Thrown inside `Reset.getProject()` when `--userId` is supplied but `ProjectRepository.getPersonalProjectForUser(userId)` returns null. This means either the user ID does not exist or the user has no personal project row, so there is nowhere to transfer the LDAP users' resources.","triggerScenarios":"Passing a non-existent user ID; passing an ID of a user whose personal project was never created (e.g. an incomplete provisioning); passing an ID of a user that was already deleted.","commonSituations":"User was deactivated/cleaned up before the LDAP reset; typo in the user ID; targeting a service account that has no personal project.","solutions":["Confirm the user exists via `n8n user-management:list` or the `user` table.","Ensure the target user has logged in at least once so their personal project is initialized.","Switch to `--projectId` of a shared project if the target user is not appropriate."],"exampleFix":"// before\nn8n ldap:reset --userId=<missing-or-deleted-id>\n// after\nn8n ldap:reset --userId=<active-local-user-id>","handlingStrategy":"validation","validationCode":"const project = await projectRepo.getPersonalProjectForUser(userId);\nif (!project) throw new Error(`User ${userId} does not exist or has no personal project.`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm the target user exists and has logged in at least once (so the personal project is initialized).","Prefer targeting a shared project via --projectId if the user's personal project state is uncertain."],"tags":["cli","ldap","not-found","user-error"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}