I’ve added the n8n workflow template, which back ups the workflows to github. When ran manually it executes without any problems, however the 12 hour cron is giving me a decryption error.
What is the error message (if any)?
Error: error:1C800064:Provider routines::bad decrypt
at Decipheriv.final (node:internal/crypto/cipher:199:29)
at Cipher.decrypt (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/Cipher.js:36:67)
at Credentials.getData (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/Credentials.js:30:43)
at CredentialsHelper.getDecrypted (/usr/local/lib/node_modules/n8n/dist/CredentialsHelper.js:203:51)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at getCredentials (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1261:33)
at RoutingNode.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/RoutingNode.js:60:32)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:707:23)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:652:53
It sounds like one of your workers might not be configured correctly, Can you share how you have n8n deployed? I suspect the worker might not be using the same encryption key as the main instance or something.
postgres:
image: postgres:latest
restart: always
environment:
- POSTGRES_DB=n8n_db
- POSTGRES_USER=redacted
- POSTGRES_PASSWORD=redacted
volumes:
- postgres_data:/var/lib/postgresql/data # This line is for data persistence
That looks like it should work, can you try updating all of your n8n instances and see if that changes anything? Did you always have the encryption key environment variable set for your worker as well?
We are facing the exact same issue. After upgrading up to 1.20 all of our credentials cannot be decrypted with error: Error: error:1C800064:Provider routines::bad decrypt
We use docker compose. Nothing change since the update. Only one server no workers and the encryption key is still the same.
we are seeing this as well, after upgrading to 1.21 from 1.8 and seeing Error: error:1C800064:Provider routines::bad decrypt
we already have N8N_ENCRYPTION_KEY configured and didn’t change it for a long time. We do use custom docker file and have the “USER node” appended at the end as suggested, but still no luck.
And even we revert back to 1.8 we still got this Error: error:1C800064:Provider routines::bad decrypt, it seems the changes was persisted to database somehow.
Chiming in here. I found that the encryptionkey in my volume drive was not updated with the encryptionkey I created when upgrading to queue mode. I would check your config in the volume if the key matches. Found mine was using an old key. Recreated credential to be sure before testing also now no longer get decryption errors. May be worth checking for some.