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… 
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)
如果你使用的是自托管入門套件(或任何 docker compose 設置),主機上沒有 ~/.n8n — 這就是你找不到它的原因。它存在於容器內的命名卷中,CLI 也不在你的主機上。兩者都可以通過 compose 訪問:
docker compose exec n8n cat /home/node/.n8n/config
該文件包含 n8n 在首次啟動時生成的 encryptionKey。立即將其保存在安全的地方,以便日後需要時使用。
要停止依賴該文件,請在 .env 中明確設置該密鑰:
N8N_ENCRYPTION_KEY=
重要:將其設置為已在該配置文件中的值,而不是新的隨機字符串。新密鑰無法解密用舊密鑰加密的憑證 — 這正是此線程中的錯誤。
對於導出命令,它也通過 compose 運行:
docker compose exec n8n n8n export:credentials --all --decrypted --output=/home/node/.n8n/creds.json
(服務名稱可能因你的 compose 文件而異,不一定是 “n8n”)
有一點值得了解:單獨備份數據庫還不夠。其中的憑證是加密的,所以沒有密鑰的轉儲恢復的工作流程將無法在任何地方進行身份驗證。兩者都要保留,並將其分開保管。