Detecting if the owner is already set

Is there a way to detect if an owner account is already set?

Previously (in 1.16.x I believe), we queried the endpoint /rest/login that would give us different status code depending if the owner is set or not: 200 when there’s no owner and 401 if it’s set.

Now under 1.33.1, this endpoint always return 401.
I do believe that having a 200 previously was a loophole more than a feature but now we cannot detect if a POST on /rest/owner/setup is required.

We’re using Ansible to deploy a fleet of instances on Kubernetes so the whole process from deploying to setting the owner or provisioning the app account must be done automatically.

Behavior seems to be the same on instance with or without an enterprise licence.

Is there a way to tell if an owner account must be set?

Cheers!

Information on your n8n setup

  • n8n version: 1.33.1
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker Kubernetes
  • Operating system: Docker

hello @M600
I suppose there are some misconfigurations there. The setting of the owner account required only for the first time. It shouldn’t be done multiple times. Unless you are talking about the MSP model.

Hello @barn4k ,

We’re a SaaS company that provide an integrated n8n instance as an option with custom templates, workflow, etc…

Each tenant has his own instance and everything is deployed using Ansible hence why there’s “multiple” owner. More likely owner are set for us and we create an end user account for them using postgresql directly to avoid having to send mail and get the ability to set a strong password.

With a fleet of nearly 40 instances it would be time consuming to set the owner by hand each time a new customer onboard.


I’ve solved my issue:

The call to /rest/login now make a proper POST request with user/password and if we get a 401, it mean the account is not set so we do the POST to /rest/owner/setup. If the response is 200, the login succeeded so it’s already set!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.