ERROR:Credentials could not be decrypted. The likely reason is that a different "encryptionKey" was used to encrypt the data

i am running self hosted n8n on unraid and suddenly today,

some of my existing workflow is facing this error. It happens on nextcloud node, google sheet node and seatable node. I tried renewing my seatable api , and it is showing the same error

and i am running the following version.

The error message actually describes exactly what the problem is. The “encryptionKey” must have changed. To be more exact, did you either not persist the ~/.n8n folder or the file ~/.n8n/config (in which the key is stored) got deleted.

In case you did set the encryptionKey via the environment variable N8N_ENCRYPTION_KEY, then the value of that variable must have changed.

There is sadly no way of getting the data back without the original key (after all, is exactly that the reason for having it). What you have to do, is to make sure that in the future the encryptionKey does get persistent and does not change again. Then delete all existing credentials and recreate them again.

Sorry, there is sadly nothing else that can be done.

Not sure how you run n8n but I advice you follow our Server Setup Guide to make sure that n8n is setup correctly.

Hello @jan thank you for guiding on how to solve the problem. I will take a look at what happens to my setup… :grinning:

Great to hear that it was helpful!

Good luck with finding what went wrong in your setup.

Hey there,

Can someone guide be how the configuration needs to be adjusted, so the credentials are preserved, even after server restarts?

That depends on how you run n8n. Can you please provide some information about that. Thanks!

Hi, I have the same problem with credentials / encryption. I am running the self-hosted-starter-kit - I would like to set persistence but do not know how - I also cannot run ‘n8n’ from the CLI so I can not do the command suggested to backup. And I do not have a ~/.n8n folder/file.
Linux Mint Wilma Stable. cloned the GIT self-host today (Jan 19th)

Si estás usando el kit de inicio autohospedado (o cualquier configuración de docker compose), no hay ~/.n8n en el host — por eso no puedes encontrarlo. Vive dentro del contenedor, en un volumen nombrado, y la CLI tampoco está en tu host. Ambos son accesibles a través de compose:

docker compose exec n8n cat /home/node/.n8n/config

Ese archivo contiene la encryptionKey que n8n generó al iniciar por primera vez. Guárdala en algún lugar seguro ahora, antes de que la necesites.

Para dejar de depender de ese archivo, establece la clave explícitamente en tu .env:

N8N_ENCRYPTION_KEY=

Importante: configúrala al valor que ya está en ese archivo de configuración, no una nueva cadena aleatoria. Una clave nueva no descifrará las credenciales que fueron encriptadas con la anterior — ese es exactamente el error en este hilo.

Y para el comando de exportación, también se ejecuta a través de compose:

docker compose exec n8n n8n export:credentials --all --decrypted --output=/home/node/.n8n/creds.json

(el nombre del servicio puede diferir de “n8n” dependiendo de tu archivo compose)

Algo que vale la pena saber: hacer una copia de seguridad de la base de datos no es suficiente por sí sola. Las credenciales en ella están encriptadas, por lo que un volcado sin la clave restaura flujos de trabajo que no pueden autenticarse en ningún lugar. Guarda ambos, y mantenlos separados.