Error Recoving (Resetting) Admin Access

Hi,

We tried to reset our user access, but receive the error copied below. Does anyone recognize what may cause this, and if there’s a command or DB query that could help fix it?

Thanks!

~ $ n8n user-management:reset
User settings loaded from: /home/node/.n8n/config
2024-03-21T14:50:34.046Z | debug | Lazy Loading credentials and nodes from n8n-nodes-base “{\n credentials: 352,\n nodes: 444,\n file: ‘LoggerProxy.js’,\n function: ‘exports.debug’\n}”
2024-03-21T14:50:34.062Z | debug | Lazy Loading credentials and nodes from @n8n/n8n-nodes-langchain “{\n credentials: 14,\n nodes: 70,\n file: ‘LoggerProxy.js’,\n function: ‘exports.debug’\n}”
2024-03-21T14:50:34.169Z | error | Error resetting database. See log messages for details. “{ file: ‘reset.js’, function: ‘catch’ }”
2024-03-21T14:50:34.169Z | error | update or delete on table “user” violates foreign key constraint “auth_identity_userId_fkey” on table “auth_identity” “{ file: ‘reset.js’, function: ‘catch’ }”

Version: 1.32.2, AWS Linux 2 on AWS EKS

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hey @jzrts,

I will need to test this as it looks like it could be a bug. Are you using the default SQLite database or Postgres?

Postgres.

And some additional info in case it helps: it occurred while our Identity Administration Team attempted to configure SAML but hadn’t yet completed a the fully functioning SAML setup. They either logged out or lost access and couldn’t get back in and neither could I as owner so we wanted to reset all access control.

Manually truncating the table auth_identity first allowed the user-management:reset command to complete successfully and everything has been working fine now, including retrying and now completing the SAML setup.

Thanks!

1 Like