Steps
Find which key n8n is using
Every self-hosted n8n encrypts saved credentials with one key. On first start it creates it and writes it to
~/.n8n/configas"encryptionKey"(in the official Docker image that folder is/home/node/.n8n). You can also set it yourself with theN8N_ENCRYPTION_KEYenvironment variable. Before you change anything, copy that config file somewhere safe: without the old key, the old credentials can't be read.Fix “Mismatching encryption keys”
n8n refuses to start when the key in the config file and
N8N_ENCRYPTION_KEYare different. In our test it stopped at once withMismatching encryption keys. The encryption key in the settings file /…/.n8n/config does not match the N8N_ENCRYPTION_KEY env var.Nothing is broken yet. Put the same value in both places, using the key your credentials were saved with (usually the one in the config file), or remove the env var.Fix “Credentials could not be decrypted”
This one means the key changed after the credentials were saved. We reproduced the classic Docker case: we kept the database but lost the config file, as happens when only the database is on a volume or the container is recreated. n8n started fine, printed
No encryption key found - Auto-generating and saving to: …/config, and every workflow using a credential then failed withCredentials could not be decrypted. The likely reason is that a different "encryptionKey" was used to encrypt the data.The fix is to bring the old key back: we removed the new config file and started n8n withN8N_ENCRYPTION_KEYset to the old key, and the same workflow ran again and n8n wrote that key into a new config file. If the old key is really gone, the saved secrets can't be recovered; create the credentials again.Move credentials to a new server the right way
n8n export:credentials --all --output=creds.jsonexports credentials still encrypted with the old key. Imported into a new n8n with its own key, they failed with the same “could not be decrypted” error. Two ways worked: give the new n8n the sameN8N_ENCRYPTION_KEYbefore importing, or export with--decryptedand import that file withn8n import:credentials --input=creds.json. The decrypted file holds your API keys and passwords in plain text, so delete it as soon as the import is done. In Docker, run the same commands inside the container.Tell key problems apart from a wrong or missing credential
If n8n can read the credential but the service says no, you get a different message. In our tests a wrong API key (HTTP 403) gave
Forbidden - perhaps check your credentials?, and no key at all (HTTP 401) gaveAuthorization failed - please check your credentials. n8n picks these words from the status code alone, so check the key's value, header name and expiry, not the encryption key. A node set to use a credential type with none selected failed withCredentials not found.
What we tested, and what happened
On 19 October 2026 we ran 13 tests on self-hosted n8n 2.43.7 with the n8n command line (import, export and execute), each in its own n8n folder. The workflows used an HTTP Request node (version 4.2) with a Header Auth credential, calling a small local API that answers 200 for the right key, 403 for a wrong key and 401 when the key is missing.
| Setup | What happened |
|---|---|
| Right API key | Success, the API answered. |
| Wrong API key (403) | Forbidden - perhaps check your credentials? |
| No credential, no auth (401) | Authorization failed - please check your credentials |
| Auth type chosen, no credential selected | Credentials not found |
| Workflow pointing to a credential that doesn't exist | Imported without any warning. Running it from the command line failed before starting with only No active execution found. |
| Workflow JSON with the credential name but no id | On import, n8n linked it to the existing credential with that name; it ran fine. |
| Workflow imported on a new n8n without its credential | Imported without any warning, failed when run (No active execution found from the command line). |
N8N_ENCRYPTION_KEY different from the config file | n8n would not start: Mismatching encryption keys. |
| Database kept, config file lost | New key generated without asking, then Credentials could not be decrypted. |
Same, old key given back with N8N_ENCRYPTION_KEY | Worked again; n8n saved the key into the new config file. |
| Default export, imported on n8n with another key | Credentials could not be decrypted. |
--decrypted export, imported on n8n with another key | Worked. |
| Default export, imported on n8n with the same key | Worked. |
Keep your credentials safe on Docker
- Put the whole
/home/node/.n8nfolder on a volume, not just the database, or setN8N_ENCRYPTION_KEYin your compose file or.envso a new container uses the same key. - Back up that key with your database backups. A database backup without the key restores workflows, but every credential in it will fail.
- For workflow backups and an alert when one fails, see n8n error alerts and backups.
Quick checklist
- n8n won't start, “Mismatching encryption keys”? Make the config file key and
N8N_ENCRYPTION_KEYthe same. - “Credentials could not be decrypted” after an update or a move? Find the old key (an old config file, an old compose file, a backup) and start n8n with it.
- Moving servers? Use the same key on the new server, or export with
--decryptedand delete the file afterwards. - 401 or 403? The key itself is wrong, missing or expired; the encryption key is fine.
- “Credentials not found”? Select a credential in the node.
Good to know
- Google Sheets node failing with
Bad request,invalid_grantor a private key error: n8n Google Sheets node not working. - Lost the owner login instead? n8n forgot password: reset the owner account.
- Publishing fails with "Missing required credential" after an import? See n8n workflow could not be activated.
- Webhook Basic, Header or JWT credentials rejected (401, 403,
jwt expired)? See n8n Webhook authentication not working. - JWT Auth credentials: a trailing space in the secret gives
The JWT token can't be verified, see n8n JWT node not working. - Other HTTP errors (404, 500, ECONNREFUSED, SSL, invalid JSON) are in n8n HTTP Request node errors, and 429 rate limits in the 429 guide.
- A workflow that stops running after a move may also have lost its schedule: see Schedule Trigger not working.
What we didn't test
- Docker itself (we reproduced the lost-config case by copying the database without its config file), OAuth2 credentials and expired tokens, n8n Cloud, the editor's screens, and external secrets managers.
Start from a working agent
FAQ
Why does n8n say credentials could not be decrypted?
The encryption key n8n is using now is not the one the credentials were saved with. It usually happens after a Docker container is recreated without the .n8n folder on a volume, after a server move, or after importing a default credentials export into another n8n. Start n8n with the old key in N8N_ENCRYPTION_KEY to fix it.
How do I fix Mismatching encryption keys in n8n?
Make the encryptionKey in ~/.n8n/config (in Docker /home/node/.n8n/config) and the N8N_ENCRYPTION_KEY environment variable the same value, using the key your credentials were saved with, or remove the environment variable.
Can I recover n8n credentials without the old encryption key?
No. Without the old key the saved secrets can't be read. Look for an old config file, compose file or backup that has it; otherwise create the credentials again.
How do I move n8n credentials to a new server?
Either set the same N8N_ENCRYPTION_KEY on the new server and import the normal export, or run n8n export:credentials --all --decrypted, import the file on the new server with n8n import:credentials, then delete it because it holds your secrets in plain text.
What does Authorization failed - please check your credentials mean in n8n?
The service answered 401: the request had no valid key or token. n8n read your credential fine, so check the value, the header name and whether the key expired. A wrong key that the service rejects with 403 shows Forbidden - perhaps check your credentials?
Related guides
- n8n Supabase node errors: credentials, RLS and filter fixes, 41 runs
- n8n OpenAI node not working? 18 tests, every error decoded
- n8n HTTP Request node errors: 401, 404, ECONNREFUSED, SSL and 12 more, fixed
- n8n Telegram node not working? 20 tests, every error decoded
- n8n queue mode not working? Redis and worker errors, 12 tests
New guides
- GitHub release notifications in Slack (any public repo, stable releases only)
- Send RSS feeds to Slack with a keyword filter (free, incoming webhook)
- Forward emails to a Slack channel (Gmail, Outlook, any IMAP), free with an incoming webhook
- n8n Google Sheets Trigger not working: not firing, activation errors and fixes