Localhost n8n instance - ECONNREFUSED error w/ n8n node

Describe the problem/error/question

I have a self-hosted n8n instance that I am trying to set up via a podman pod to properly use workers and postgresql on a Fedora 42 system with SELinux enforcement. I have gotten nearly all of my issues resolved thus far, and oh boy were the SELinux aspects fun to figure out, but cannot seem to get a workflow to work that backs up my workflows. The troublesome node is the “Get many workflows” node which I have tried the base api url, 127.0.0.1, 0.0.0.0, and localhost for in the credentials.

I have thoroughly trolled through both the n8n community and reddit to no avail as yet for this. While this seems to be the only holdup on the instance, so far, it makes me nervous to proceed with rebuilding workflows I recently lost due to failure on my part to execute timely backups.

What is the error message (if any)?

{“errorMessage”: “The service refused the connection - perhaps it is offline”,“errorDetails”: {“rawErrorMessage”: [“connect ECONNREFUSED ::1:5678”,“connect ECONNREFUSED ::1:5678”],“httpCode”: “ECONNREFUSED”},“n8nDetails”: {“nodeName”: “Get many workflows”,“nodeType”: “n8n-nodes-base.n8n”,“nodeVersion”: 1,“resource”: “workflow”,“operation”: “getAll”,“itemIndex”: 0,“runIndex”: 0,“time”: “9/12/2025, 10:48:52 AM”,“n8nVersion”: “1.110.1 (Self Hosted)”,“binaryDataMode”: “default”,“stackTrace”: [“NodeApiError: The service refused the connection - perhaps it is offline”,"    at ExecuteSingleContext.httpRequestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_5aee33ef851c7de341eb325c6a25e0ff/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts:1365:9)“,"    at processTicksAndRejections (node:internal/process/task_queues:105:5)”,"    at ExecuteSingleContext.httpRequestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_5aee33ef851c7de341eb325c6a25e0ff/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts:1737:11)“,"    at RoutingNode.rawRoutingRequest (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_5aee33ef851c7de341eb325c6a25e0ff/node_modules/n8n-core/src/execution-engine/routing-node.ts:531:20)”,"    at ExecuteSingleContext.makeRoutingRequest (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_5aee33ef851c7de341eb325c6a25e0ff/node_modules/n8n-core/src/execution-engine/routing-node.ts:564:11)“,"    at ExecuteSingleContext.cursorPagination (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/N8n/GenericFunctions.ts:117:19)”,"    at RoutingNode.makeRequest (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_5aee33ef851c7de341eb325c6a25e0ff/node_modules/n8n-core/src/execution-engine/routing-node.ts:591:20)“,"    at async Promise.allSettled (index 0)”,"    at RoutingNode.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_5aee33ef851c7de341eb325c6a25e0ff/node_modules/n8n-core/src/execution-engine/routing-node.ts:234:29)“,"    at ExecuteContext.versionedNodeType.execute (/usr/local/lib/node_modules/n8n/src/node-types.ts:60:18)”]}}```

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.110.1
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): THIS IS DEPRICATED ACCORDING TO STARTUP LOGS
  • Running n8n via (Docker, npm, n8n cloud, desktop app): podman-compose
  • Operating system: Fedora 42 Workstation

Here is the podman compose file for reference:

# A compose file for a scalable n8n, PostgreSQL, Redis, and Ollama stack.
# Optimized for use with podman-compose on a Fedora 42 system.
version: '3.8'

networks:
  # A dedicated network for the stack improves security and isolation.
  n8n-stack:
    driver: bridge

services:
  # The PostgreSQL database service for n8n data persistence.
  postgres:
    image: docker.io/postgres:16
    container_name: n8n-postgres
    hostname: postgres
    networks:
      - n8n-stack
    environment:
      # Load sensitive values from a .env file for better security.
      - POSTGRES_USER=${POSTGRES_USER:-n8n}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?err} # Use .env file. The :?err makes this variable required.
      - POSTGRES_DB=${POSTGRES_DB:-n8n}
      - POSTGRES_MAX_CONNECTIONS=150
    volumes:
      # The ':z' is crucial for SELinux on Fedora to allow container access.
      - n8n-postgres-data:/var/lib/postgresql/data:z
    restart: unless-stopped
    healthcheck:
      # $$ is used to escape the $ for variable expansion within the container.
      test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-n8n} -d $${POSTGRES_DB:-n8n}"]
      interval: 10s
      timeout: 5s
      retries: 5

  # Redis service for managing the workflow execution queue and caching.
  redis:
    image: docker.io/redis:7-alpine
    container_name: n8n-redis
    hostname: redis
    networks:
      - n8n-stack
    # IMPORTANT: Apply the custom SELinux policy generated by udica.
    # security_opt:
      # - label=type:n8n-redis.process
    volumes:
      - n8n-redis-data:/data:z # SELinux fix
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

  # The main n8n service: handles UI, API, and queues jobs.
  n8n-main:
    image: docker.io/n8nio/n8n:latest # Pinning to a latest for bug fixes and security
    container_name: n8n-main
    hostname: n8n-main
    networks:
      - n8n-stack
    user: "1000:1000"
    ports:
      # Binds the port only to the host's loopback interface for security.
      - "127.0.0.1:5678:5678"
    environment:
      - N8N_HOST=127.0.0.1
      - N8N_AUTH_EXCLUDE_ENDPOINTS=api
      - EXECUTIONS_MODE=queue
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD:?err} # Use .env file
      - DB_POSTGRESDB_DATABASE=${POSTGRES_DB:-n8n}
      - DB_POSTGRESDB_USER=${POSTGRES_USER:-n8n}
      - QUEUE_BULL_REDIS_HOST=redis
      - CACHE_ENABLE=true
      - CACHE_TYPE=redis
      - CACHE_REDIS_HOST=redis
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE:-America/Denver}
      - WEBHOOK_URL=https://127.0.0.1:5678}
      - N8N_LOG_LEVEL=info
      - N8N_METRICS_ENABLED=true
      - N8N_ENCRYPTION_KEY=${N8N_E_KEY:?err}
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
      - N8N_RUNNERS_ENABLED=true
      - OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true
      - EXECUTIONS_DATA_PRUNE=true
      - EXECUTIONS_DATA_MAX_AGE=14
      - N8N_DIAGNOSTICS_ENABLED=false
      - N8N_HIDE_USAGE_PAGE=true
      - N8N_LOG_FORMAT=text
      - N8N_SECURITY_AUDIT_DAYS_ABANDONED_WORKFLOW=365
      - N8N_HIRING_BANNER_ENABLED=false
      - N8N_METRICS_INCLUDE_WORKFLOW_ID_LABEL=true
      - GENERIC_TIMEZONE=America/Denver
      - WORKFLOWS_DEFAULT_NAME=ausOz
      - EXECUTIONS_TIMEOUT=3600
      - N8N_WORKFLOW_CALLER_POLICY_DEFAULT_OPTION=any
      - N8N_REINSTALL_MISSING_PACKAGES=true
      - N8N_ONBOARDING_FLOW_DISABLED=true
      - CODE_ENABLE_STDOUT=true
      - N8N_UNVERIFIED_PACKAGES_ENABLED=true
    volumes:
      - n8n-data:/home/node/.n8n:z # SELinux fix
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy

  # n8n worker service: executes the workflows.
  n8n-worker:
    image: docker.io/n8nio/n8n:latest # Match the main service version
    command: worker
    networks:
      - n8n-stack
    user: "1000:1000"
    # REMOVED: container_name and hostname are incompatible with scaling.
    environment:
      - N8N_HOST=n8n-main
      - N8N_AUTH_EXCLUDE_ENDPOINTS=api
      - EXECUTIONS_MODE=queue
      - EXECUTIONS_PROCESS=worker
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD:?err} # Use .env file
      - DB_POSTGRESDB_DATABASE=${POSTGRES_DB:-n8n}
      - DB_POSTGRESDB_USER=${POSTGRES_USER:-n8n}
      - QUEUE_BULL_REDIS_HOST=redis
      - CACHE_ENABLE=true
      - CACHE_TYPE=redis
      - CACHE_REDIS_HOST=redis
      - CONCURRENCY=${CONCURRENCY:-5}
      - WEBHOOK_URL=https://n8n-main:5678
      - N8N_ENCRYPTION_KEY=${N8N_E_KEY:?err}
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
      - N8N_RUNNERS_ENABLED=true
      - OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true
      - EXECUTIONS_DATA_PRUNE=true
      - EXECUTIONS_DATA_MAX_AGE=14
      - N8N_DIAGNOSTICS_ENABLED=false
      - N8N_HIDE_USAGE_PAGE=true
      - N8N_LOG_FORMAT=text
      - N8N_SECURITY_AUDIT_DAYS_ABANDONED_WORKFLOW=365
      - N8N_HIRING_BANNER_ENABLED=false
      - N8N_METRICS_INCLUDE_WORKFLOW_ID_LABEL=true
      - GENERIC_TIMEZONE=America/Denver
      - WORKFLOWS_DEFAULT_NAME=ausOz
      - EXECUTIONS_TIMEOUT=3600
      - N8N_WORKFLOW_CALLER_POLICY_DEFAULT_OPTION=any
      - N8N_REINSTALL_MISSING_PACKAGES=true
      - N8N_ONBOARDING_FLOW_DISABLED=true
      - CODE_ENABLE_STDOUT=true
      - N8N_UNVERIFIED_PACKAGES_ENABLED=true
    volumes:
      - n8n-data:/home/node/.n8n:z # SELinux fix
    restart: unless-stopped
    depends_on:
      n8n-main:
        condition: service_started
    # Use 'podman-compose up --scale n8n-worker=3' on the command line to scale.

  # The Ollama service for running local Language Models.
  ollama:
    image: docker.io/ollama/ollama:latest
    container_name: ollama-service
    hostname: ollama
    networks:
      - n8n-stack
    # IMPORTANT: Apply the custom SELinux policy generated by udica.
    # security_opt:
      # - label=type:n8n-ollama.process
    ports:
      - "127.0.0.1:11434:11434" # Bind to 127.0.0.1
    volumes:
      - ollama-data:/root/.ollama:z # SELinux fix
    # To enable GPU access with podman, the most reliable method is often the
    # '--gpus all' flag on the 'podman run' command. For podman-compose, you
    # can try passing devices, but command-line flags often take precedence.
    # devices:
    #   - /dev/kfd
    #   - /dev/dri
    restart: unless-stopped

# Top-level 'volumes' declaration for all persistent data.
volumes:
  n8n-data:
  n8n-postgres-data:
  n8n-redis-data:
  ollama-data:

I use the same host as what I use to access n8n (so, a N8N_HOST value) with /api/v1 appended at the end

https://my-n8n-domain.com/api/v1

That was a part of the combination of things I just stumbled across to resolve this THANK YOU! I have been breaking my skull over this for a couple weeks now.

I ran ifconfig on the n8n-main container, used the the eth0 IPv4 address as the host for the worker containers and for the n8n api credential in the troubled node, restarted the pod and BAM! Only using this address in just the credentials or just the N8N_HOSTenvironment variable did not work: the main instance IP address had to be used in both places.

I updated the N8N_HOST for the main n8n container to N8N_HOST=https://127.0.0.1:5678/api/v1
I updated the N8N_HOST for the worker container(s) to N8N_HOST=https://{{IPv4 OF N8N MAIN CONTAINER}}:5678/api/v1