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
- Run `./packages/cli/bin/n8n user-management:reset` as the message instructs to recreate the owner account.
- Verify the `role` and `user` tables contain a row with `slug = 'owner'`.
- 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
- Run `n8n user-management:reset` proactively after restoring a DB from backup.
- Monitor for the presence of an owner row as part of DB health checks.
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
- You must use exactly one of `--userId`, `--projectId` or `--
- Can't migrate workflows and credentials to the user with the
- Can't migrate workflows and credentials to the project with
- Could not find the project with the ID ${projectId}.
- Could not find the user with the ID ${userId} or their perso
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/79f89a3b100652e1.
Report an issue: GitHub.