{"record":{"id":"6581f5c417b88961","repo":"n8n-io/n8n","slug":"could-not-find-the-project-with-the-id-projectid","errorCode":null,"errorMessage":"Could not find the project with the ID ${projectId}.","messagePattern":"Could not find the project with the ID (.+?)\\.","errorType":"exception","errorClass":"UserError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/ldap/reset.ts","lineNumber":149,"sourceCode":"\t\tawait Container.get(AuthIdentityRepository).delete({ providerType: 'ldap' });\n\t\tawait Container.get(UserRepository).deleteMany(ldapIdentities.map((i) => i.userId));\n\t\tawait Container.get(ProjectRepository).delete({ id: In(personalProjectIds) });\n\t\tawait Container.get(SettingsRepository).delete({ key: LDAP_FEATURE_NAME });\n\t\tawait Container.get(SettingsRepository).insert({\n\t\t\tkey: LDAP_FEATURE_NAME,\n\t\t\tvalue: JSON.stringify(LDAP_DEFAULT_CONFIGURATION),\n\t\t\tloadOnStartup: true,\n\t\t});\n\n\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);","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/cli/src/commands/ldap/reset.ts#L131-L167","documentation":"Thrown inside `Reset.getProject()` when `--projectId` is supplied but no project row matches that ID in the project table (`ProjectRepository.findOneBy({ id: projectId })` returns null). This is a guard before `OwnershipTransferService.transferAllResources` is called with a non-existent destination.","triggerScenarios":"Passing a typo'd or stale project ID; referencing a project from a different n8n instance; passing an ID with extra whitespace or wrong casing.","commonSituations":"Copy-paste errors; cross-environment ID confusion (dev vs prod); the project was deleted between the time the operator looked it up and ran the command.","solutions":["Verify the project ID exists with `n8n list:project` or by querying the `project` table directly.","Re-copy the ID from the n8n UI project settings and rerun.","If the project was deleted, choose a different target or create a new one."],"exampleFix":"// before\nn8n ldap:reset --projectId=Ox8O54VQrmBrb4q\n// after  (after confirming correct ID)\nn8n ldap:reset --projectId=Ox8O54VQrmBrb4qL","handlingStrategy":"validation","validationCode":"const project = await projectRepo.findOneBy({ id: projectId });\nif (!project) throw new Error(`Project ${projectId} does not exist; verify the ID.`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Look up project IDs via the UI or `project` table immediately before running the command.","Avoid copy-typing IDs across environments."],"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"}