n8n-io/n8n · critical · UserError

Failed to find owner. ${UM_FIX_INSTRUCTION}

Error message

Failed to find owner. ${UM_FIX_INSTRUCTION}

What it means

Thrown by `Reset.getOwner()` when no user with the `GLOBAL_OWNER_ROLE` slug exists in the database. The command needs an owner to perform deletions on behalf of (workflows, credentials). The message appends `UM_FIX_INSTRUCTION`, which tells the operator to run `n8n user-management:reset` to recreate the owner.

Source

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

			return project;
		}

		throw new UserError(wrongFlagsError);
	}

	async catch(error: Error): Promise<void> {
		this.logger.error('Error resetting database. See log messages for details.');
		this.logger.error(error.message);
	}

	private async getOwner() {
		const owner = await Container.get(UserRepository).findOne({
			where: { role: { slug: GLOBAL_OWNER_ROLE.slug } },
			relations: ['role'],
		});
		if (!owner) {
			throw new UserError(`Failed to find owner. ${UM_FIX_INSTRUCTION}`);
		}

		return owner;
	}
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Run `./packages/cli/bin/n8n user-management:reset` as the message instructs to recreate the owner account.
  2. Verify the `role` and `user` tables contain a row with `slug = 'owner'`.
  3. Re-run `ldap:reset` once an owner exists.
Defensive patterns

Strategy: try-catch

Validate before calling

const owner = await userRepo.findOne({ where: { role: { slug: GLOBAL_OWNER_ROLE.slug } }, relations: ['role'] });
if (!owner) {
  console.error('No owner user found. Run: n8n user-management:reset');
  process.exit(1);
}

Try / catch

try { await reset.run(); } catch (e) { if (/Failed to find owner/.test(e.message)) { await runUserManagementReset(); } else throw e; }

Prevention

When it happens

Trigger: The instance's owner user was deleted, the role seeding migration did not run, or the DB was partially restored. Any `ldap:reset` invocation will hit this before doing any work.

Common situations: Restoring a DB dump that predates role seeding; manual DB surgery that removed the owner row; fresh DB where owner setup was skipped.

Related errors


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