Credentials error

I got this error after I restart my machine, and I also cannot open my credentials in stored credentials…

The following error occurred on workflow activation:
Credentials could not be decrypted. The reason is that probably a different "encryptionKey" got used to encrypt the data than now to decrypt it.

All credentials are encrypted for security reasons before they are saved to the database. That encryption key gets saved in the subfolder “.n8n” in the user folder.

If you delete that folder or you start n8n with docker without mounting it to persist it, you will not be able to decrypt the data like the error message mentions.

I am using Heroku Free tier, which means that the whole system will be reseted after 30minutes. Is there any solution to backup the .n8n folder?

I had followed the tutorial to setup a remote MongoDB database.

Sorry sadly not. That seems like something where a solution would have to be found in Heroku. You have to find a way there to persist that folder. Never used Heroku so can sadly not be of any help there. But it sounds like something that should be possible.

Ok so now finally home in front of my computer and could so finally check the code. I was not sure if I did add the possibility to also set the encryption key via an environment variable. And good news, I did. So if you can set an environment variable on Heroku you can fix your problem like that.

Set the variable N8N_ENCRYPTION_KEY to a random string and then recreate (so delete and create again) all the credentials you had. Then you should be good to go.

1 Like