n8n-io/n8n · error · UserError

Could not find the project with the ID ${projectId}.

Error message

Could not find the project with the ID ${projectId}.

What it means

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.

Source

Thrown at packages/cli/src/commands/ldap/reset.ts:149

		await Container.get(AuthIdentityRepository).delete({ providerType: 'ldap' });
		await Container.get(UserRepository).deleteMany(ldapIdentities.map((i) => i.userId));
		await Container.get(ProjectRepository).delete({ id: In(personalProjectIds) });
		await Container.get(SettingsRepository).delete({ key: LDAP_FEATURE_NAME });
		await Container.get(SettingsRepository).insert({
			key: LDAP_FEATURE_NAME,
			value: JSON.stringify(LDAP_DEFAULT_CONFIGURATION),
			loadOnStartup: true,
		});

		this.logger.info('Successfully reset the database to default ldap state.');
	}

	async getProject(userId?: string, projectId?: string) {
		if (projectId) {
			const project = await Container.get(ProjectRepository).findOneBy({ id: projectId });

			if (project === null) {
				throw new UserError(`Could not find the project with the ID ${projectId}.`);
			}

			return project;
		}

		if (userId) {
			const project = await Container.get(ProjectRepository).getPersonalProjectForUser(userId);

			if (project === null) {
				throw new UserError(
					`Could not find the user with the ID ${userId} or their personalProject.`,
				);
			}

			return project;
		}

		throw new UserError(wrongFlagsError);

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Verify the project ID exists with `n8n list:project` or by querying the `project` table directly.
  2. Re-copy the ID from the n8n UI project settings and rerun.
  3. If the project was deleted, choose a different target or create a new one.

Example fix

// before
n8n ldap:reset --projectId=Ox8O54VQrmBrb4q
// after  (after confirming correct ID)
n8n ldap:reset --projectId=Ox8O54VQrmBrb4qL
Defensive patterns

Strategy: validation

Validate before calling

const project = await projectRepo.findOneBy({ id: projectId });
if (!project) throw new Error(`Project ${projectId} does not exist; verify the ID.`);

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/6581f5c417b88961. Report an issue: GitHub.