Problem loading credential

Describe the problem/error/question

when i create new image of n8n i have problem with credentials to connect to database with error message:
Credentials could not be decrypted. The likely reason is that a different “encryptionKey” was used to encrypt the data.
How can I fix this problem to keep credentials?

What is the error message (if any)?

Problem loading credential

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

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.2.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Seif,

That error normally means the encryption key has been replaced in the config file or it was changed in an environment variable, Normally though if the key has been replaced the database would be lost as well. Are you using the default database or did you configure n8n to use Postgres / MySQL instead?

Hi @Jon
Postgres is what I use, but I have confirmed that the encryption key is identical and has not been modified.

Hey @Seif,

How did you confirm the key is identical? I suspect what has happened is the volume with the original key was not set but if you have the key handy you can set the encryption key environment variable and that should solve the issue.

1 Like

Hi @Jon
I have the same problem.
I upgrade n8n and now is 1.3.1 version.

Information on your n8n setup

  • n8n version: 1.3.1
  • Database (default: SQLite): PostGres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): CapRover (Docker)
  • Operating system: Linux

I don’t see an environment variable with encryption key (which is the name of encrypt key?)

I tried to set new credential but It seems to not keep the information.

After the update I also have other problems (e.g. corrupted n8n webhook url) but I try to find the solution in other topics or open new topics

I think my problem is the permission change reported in the migration guide, in the docker section.
But the present command:
docker run --rm -it --user root -v ~/.n8n:/home/node/.n8n --entrypoint chown n8nio/base:16 -R node:node /home/node/.n8n

doesn’t seem to have effect because the location of the container is different since I’m using caprover. Could this be the problem?

Hey @Mauro_G,

You would need to change the path so the ~/.n8n: would need to be changed to match whatever your environment is using.In theory though it shouldn’t remove anything but it will show a permission error and will fail to start.

You may also need to make sure Caprover is using /home/node/ as the working directory instead of /root or /data

Hi, @Jon and thanks for your answer.
To make sure I understand, I’m attaching a picture


I should change /root/.n8n with ~/.n8n?

Thanks for your patience

Hey @Mauro_G,

That path should be /home/node/.n8n if you are using v1 or later, If you change that it will sort out what n8n is using internally.

I am not sure what the local path would be on your machine though so you would still need to find that.

1 Like

Ok, thanks.
I changed and everything is ok. Thanks for the support.

1 Like

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