Self Hosted AI Starter Kit [ERROR: message: Mismatching encryption keys]

Hi there,

I’m following this YT tutorial https://www.youtube.com/watch?v=V_0dNE-H2gw
It recommend adding passwords for the 2 last lines of the .env file.

When I’m running docker compose --profile cpu up (I have an AMD basic graphic card)
I get this error:

n8n                | (node:7) Warning: Error
n8n                | module: @oclif/[email protected]
n8n                | task: findCommand (audit)
n8n                | plugin: n8n
n8n                | root: /usr/local/lib/node_modules/n8n
n8n                | message: Mismatching encryption keys. The encryption key in the settings file /home/node/.n8n/config does not match the N8N_ENCRYPTION_KEY env var. Please make sure both keys match. More information: https://docs.n8n.io/hosting/environment-variables/configuration-methods/#encryption-key
n8n                | See more details with DEBUG=*
n8n                | (Use `node --trace-warnings ...` to show where the warning was created)
n8n                | message: Mismatching encryption keys. The encryption key in the settings file /home/node/.n8n/config does not match the N8N_ENCRYPTION_KEY env var. Please make sure both keys match. More information: https://docs.n8n.io/hosting/environment-variables/configuration-methods/#encryption-key
n8n                | See more details with DEBUG=*
n8n                | (node:7) Warning: Error
n8n                | module: @oclif/[email protected]
n8n                | task: findCommand (user-management:reset)
n8n                | plugin: n8n
  • n8n version:
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 24.04

Does someone has an idea of the problem?
Thanks!

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:

Hi @headset907

usually this error means that you had initiated n8n before without an encryption key set in the env and in that case it created a random default one. This one has been used for your n8n database initialization.

There is no real need to set the encryption key yourself unless you are working with multiple n8n instances while keeping the same database.

So in your case you should be fine without them.

However, if you want to keep them in your env settings, you will need to delete your database and start over and then it will use your own encryption key on setup.

1 Like

oh I see @ria, thanks a lot for that explanation!

Right now when I do docker ps I don’t have any postgres container running…

Doing docker ps -a gives me this:

I then remove the container with docker rm [container#]
re-run docker compose --profile cpu up

I get the same error:

n8n                | (node:7) Warning: Error
n8n                | module: @oclif/[email protected]
n8n                | task: findCommand (audit)
n8n                | plugin: n8n
n8n                | root: /usr/local/lib/node_modules/n8n
n8n                | message: Mismatching encryption keys. The encryption key in the settings file /home/node/.n8n/config does not match the N8N_ENCRYPTION_KEY env var. Please make sure both keys match. More information: https://docs.n8n.io/hosting/environment-variables/configuration-methods/#encryption-key
n8n                | See more details with DEBUG=*
n8n                | (Use `node --trace-warnings ...` to show where the warning was created)

Could you please explain to me how I should go about it?
Thanks a lot!

1 Like

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