MongoDB credential error

Describe the problem/error/question

When the workflow is running automatically, the mongoDB node does not recognize the credentials. When i run manually, the workflow runs normally and the mongoDB node recognizes the credentials.

What is the error message (if any)?

{
  "errorMessage": "Credential with ID \"hSrLSDLybCHkV2W9\" does not exist for type \"mongoDb\".",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "1.37.3 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "Error: Credential with ID \"hSrLSDLybCHkV2W9\" does not exist for type \"mongoDb\".",
      "    at CredentialsHelper.getCredentials (/usr/local/lib/node_modules/n8n/dist/CredentialsHelper.js:151:19)",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "    at CredentialsHelper.getDecrypted (/usr/local/lib/node_modules/n8n/dist/CredentialsHelper.js:185:29)",
      "    at getCredentials (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1370:33)",
      "    at Object.getCredentials (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2148:56)",
      "    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/MongoDb/MongoDb.node.js:69:29)",
      "    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:724:19)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:660:53",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1062:20"
    ]
  }
}

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.37.3 (Self Hosted)
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): k8s
  • Operating system:

Hey @Joao_Paulo_Campos

That’s weird behaviour, can you try restart n8n and create new credential set with same credentials?

This approach has already been tried and the error continues to appear when it runs automatically.

Sorry. The problem was on my side and has already been resolved. Apparently the problem was a version difference between the main instance (1.37.3) and the workers (1.36.2) in queue mode. I left them all on the same version (1.37.3) and it worked again

2 Likes

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