# Problem loading credential

**URL:** <https://community.n8n.io/t/problem-loading-credential/29641>\
**Category:** Questions\
**Tags:** credentials, v1\
**Created:** [August 22, 2023, 5:23pm UTC](https://community.n8n.io/t/problem-loading-credential/29641 "2023-08-22T17:23:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seif](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@Seif](https://community.n8n.io/u/Seif)\
**Post date:** [August 22, 2023, 5:23pm UTC](https://community.n8n.io/t/problem-loading-credential/29641/1 "2023-08-22T17:23:41Z")

</div>

## 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

```auto
(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:**

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [August 23, 2023, 8:58am UTC](https://community.n8n.io/t/problem-loading-credential/29641/2 "2023-08-23T08:58:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Seif](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@Seif](https://community.n8n.io/u/Seif)\
**Post date:** [August 23, 2023, 9:38am UTC](https://community.n8n.io/t/problem-loading-credential/29641/3 "2023-08-23T09:38:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [August 23, 2023, 11:05am UTC](https://community.n8n.io/t/problem-loading-credential/29641/4 "2023-08-23T11:05:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mauro\_G](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mauro_g/32/14701_2.png) [@Mauro\_G](https://community.n8n.io/u/Mauro_G)\
**Post date:** [August 25, 2023, 8:48am UTC](https://community.n8n.io/t/problem-loading-credential/29641/5 "2023-08-25T08:48:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mauro\_G](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mauro_g/32/14701_2.png) [@Mauro\_G](https://community.n8n.io/u/Mauro_G)\
**Post date:** [August 25, 2023, 10:13am UTC](https://community.n8n.io/t/problem-loading-credential/29641/6 "2023-08-25T10:13:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [September 1, 2023, 3:40pm UTC](https://community.n8n.io/t/problem-loading-credential/29641/7 "2023-09-01T15:40:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mauro\_G](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mauro_g/32/14701_2.png) [@Mauro\_G](https://community.n8n.io/u/Mauro_G)\
**Post date:** [September 4, 2023, 8:12am UTC](https://community.n8n.io/t/problem-loading-credential/29641/8 "2023-09-04T08:12:17Z")

</div>

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

 ![caprover-n8n](https://europe1.discourse-cdn.com/n8n/original/3X/3/e/3efde79d644015cb6c3e73088fa7ccb1f6b10022.png)  
I should change /root/.n8n with ~/.n8n?

Thanks for your patience

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [September 4, 2023, 8:14am UTC](https://community.n8n.io/t/problem-loading-credential/29641/9 "2023-09-04T08:14:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mauro\_G](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mauro_g/32/14701_2.png) [@Mauro\_G](https://community.n8n.io/u/Mauro_G)\
**Post date:** [September 4, 2023, 10:02am UTC](https://community.n8n.io/t/problem-loading-credential/29641/10 "2023-09-04T10:02:16Z")

</div>

> [@Jon](#):
>
> /home/node/.n8n

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

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [December 3, 2023, 10:03am UTC](https://community.n8n.io/t/problem-loading-credential/29641/11 "2023-12-03T10:03:09Z")

</div>

Closed on December 3, 2023, 10:03am UTC

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