Encryption key

Hi everyone,

I have a problem on my n8n instance since the update to 1.0

Since then I no longer have access to any of my credentials in my various workflows.

I have this error message
Credentials could not be decrypted. The likely reason is that a different "encryptionKey" was used to encrypt the data.

I can create new ones but cannot retrieve old ones…

If anyone has an idea, I’m a taker :smiley:

Thanks in advance,

1 Like

Hi @Freddy64 - welcome to the community :tada:

That error normally means the encryption key has been replaced in the config file or it was changed in an environment variable. Are you using the default database or did you configure n8n to use Postgres / MySQL instead? Any other changes that might have affected this? :thinking:

1 Like

Hi! I’ve also just encountered the same issue while upgrading from 0.xx to 1.9. Investigating now, will post back what I found but the story so far is:

  • Postgres
  • Running on a docker compose network
  • Removed N8N_BASIC_AUTH_ACTIVE=true, N8N_BASIC_AUTH_USER, N8N_BASIC_AUTH_PASSWORD from the docker compose service environment variables
  • Never set N8N_ENCRYPTION_KEY
  • Directory where n8n is stored is subject to git branches and we switched between branches a few times

My hypothesis is that since we switched git branches, we may have inadvertently wiped some untracked temp directories which contained a generated encryption key? Riffing off Credentials could not be decrypted "EncryptionKey" - #5 by MutedJam


OK, some more sleuthing led me to remember that we configured n8n to save the autogenerated encryption key (and other stuff) elsewhere. I retrieved it the key from elsewhere in the filesystem and plugged it into N8N_ENCRYPTION_KEY and it worked.

But that begged the question: why isn’t n8n able to retrieve that file anymore? Then I remembered that part of the 1.0 version bump involved changing the docker user from root to node, so I had to make the following tweak to my docker compose n8n service environment:

-     - ${DATA_FOLDER}/.n8n:/root/.n8n
+     - ${DATA_FOLDER}/.n8n:/node/.n8n

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