Setting up New n8n Instance with Postgres, Redis & Workers Issue

Hi guys, hope you are well

Been trying to move from SQlite to Postgres so that I can take advantage of the scaling and workers. Managed to install n8n, installed redis, setup workers, installed postgres, setup a database and that was my whole weekend. When I run docker ps all services are up and running.

However when I tried to process a request via a webhook, all my requests just showing queued, and stuck there. No movement. No idea why this is the case but any assistance will be greatly appreciated. Been going through my YML document, .env document…Maybe I missed something, I just dont know…But any insights will be appreciated

Information on your n8n setup

  • **n8n version:1.59.4
  • **Database (default: SQLite):Postgres
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):main
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):Docker Self Hosted
  • **Operating system:Linux Ubuntu

Hard to tell without seeing your deployment settings. If it helps to debug:

Set N8N_LOG_LEVEL=debug to view logs in detail. On main you should see the execution being enqueued:

2024-09-24T15:15:30.026Z | info     | [ScalingService] Added job 278 (execution 17091) "{ file: 'scaling.service.js', function: 'addJob' }"

On the worker you should see it being picked up and processed:

2024-09-24T15:15:30.037Z | info     | [JobProcessor] Starting job 278 (execution 17091) "{ file: 'job-processor.js', function: 'processJob' }"
2024-09-24T15:15:30.046Z | debug    | Workflow execution started "{\n  workflowId: 'LLRzyiCFeC9vmDki',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-09-24T15:15:30.047Z | debug    | Start processing node "Schedule Trigger" "{\n  node: 'Schedule Trigger',\n  workflowId: 'LLRzyiCFeC9vmDki',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-09-24T15:15:30.047Z | debug    | Running node "Schedule Trigger" started "{\n  node: 'Schedule Trigger',\n  workflowId: 'LLRzyiCFeC9vmDki',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-09-24T15:15:30.047Z | debug    | Running node "Schedule Trigger" finished successfully "{\n  node: 'Schedule Trigger',\n  workflowId: 'LLRzyiCFeC9vmDki',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-09-24T15:15:30.047Z | debug    | Start processing node "Wait" "{\n  node: 'Wait',\n  workflowId: 'LLRzyiCFeC9vmDki',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-09-24T15:15:30.048Z | debug    | Running node "Wait" started "{\n  node: 'Wait',\n  workflowId: 'LLRzyiCFeC9vmDki',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-09-24T15:15:30.057Z | debug    | Running node "Wait" finished successfully "{\n  node: 'Wait',\n  workflowId: 'LLRzyiCFeC9vmDki',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-09-24T15:15:30.057Z | debug    | Workflow execution finished successfully "{\n  workflowId: 'LLRzyiCFeC9vmDki',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-09-24T15:15:30.058Z | debug    | Executing hook (hookFunctionsSaveWorker) "{\n  executionId: '17089',\n  workflowId: 'LLRzyiCFeC9vmDki',\n  file: 'workflow-execute-additional-data.js',\n  function: 'workflowExecuteAfter'\n}"
2024-09-24T15:15:30.058Z | debug    | Save execution data to database for execution ID 17089 "{\n  executionId: '17089',\n  workflowId: 'LLRzyiCFeC9vmDki',\n  finished: true,\n  stoppedAt: 2024-09-24T15:15:30.057Z,\n  file: 'shared-hook-functions.js',\n  function: 'updateExistingExecution'\n}"
2024-09-24T15:15:30.071Z | debug    | [JobProcessor] Job finished running "{\n  jobId: '276',\n  executionId: '17089',\n  file: 'job-processor.js',\n  function: 'processJob'\n}"

If the executions are being enqueued but not picked up, you can check Redis with docker exec -it your-redis-container redis-cli and query for jobs in various states, e.g. LRANGE bull:jobs:waiting 0 -1 or LRANGE bull:jobs:active 0 -1. If the Redis queue has no jobs, check your main’s connection to Redis. If the Redis queue has only waiting but no active jobs, check your worker’s connection to Redis.