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
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.
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)
If you’re on the self-hosted starter kit (or any docker compose setup), there is
no ~/.n8n on the host — that’s why you can’t find it. It lives inside the
container, on a named volume, and the CLI isn’t on your host either. Both are
reachable through compose:
That file contains the encryptionKey n8n generated on first start. Save it
somewhere safe now, before you need it.
To stop depending on that file, set the key explicitly in your .env:
N8N_ENCRYPTION_KEY=
Important: set it to the value already in that config file, not a new random
string. A new key won’t decrypt credentials that were encrypted with the old one
— that’s exactly the error in this thread.
And for the export command, it also runs through compose:
(service name may differ from “n8n” depending on your compose file)
One thing worth knowing: backing up the database is not enough on its own. The
credentials in it are encrypted, so a dump without the key restores workflows
that can’t authenticate anywhere. Keep both, and keep them apart.