I’m having an intermittent issue where if the workflow execution is pickup up by the main n8n instance(in this case n8n-mapper), it will got stuck with “running” status forever.
I’m running on queue mode and if I understand correctly, the main instance does not execute the workflow itself, but pass the job to redis for workers to pick up.
There is no error message but if it pickup up by the main instance, it will console log “Started with job ID: … (Execution ID: …)”.
When it was picked up by the worker (in this case n8n-worker), I can see from the log in working as expected…
but somehow that specific execution does not listed in the UI (latest one was the failed Id 104).
Please take note that both execution was done just a few minutes from each other by publishing the data to rabbitmq queue manually, and run with the same development instance without rerun the “skaffold dev” again.
Please advice.
Here is my setup for your info.
n8n-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: n8n-configmap
namespace: crm
labels:
app: n8n-mapper
component: configmap
data:
NODE_ENV: ‘production’
GENERIC_TIMEZONE: ‘Europe/Oslo’
WEBHOOK_TUNNEL_URL: ‘http://localhost:8888’
DB_TYPE: ‘postgresdb’
DB_POSTGRESDB_USER: ‘postgres’
DB_POSTGRESDB_DATABASE: ‘postgres’
DB_POSTGRESDB_HOST: ‘postgresql-master’
DB_POSTGRESDB_PORT: ‘5432’
N8N_METRICS: ‘true’
NODE_OPTIONS: ‘–max-old-space-size=1024’
EXECUTIONS_MODE: ‘queue’
QUEUE_BULL_REDIS_HOST: ‘redis’
N8N_DISABLE_PRODUCTION_MAIN_PROCESS: ‘false’
N8N_LOG_LEVEL: debug
EXECUTIONS_DATA_SAVE_ON_SUCCESS: ‘none’
EXECUTIONS_DATA_PRUNE: ‘false’
n8n-secrets.yaml
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: n8n-secrets
namespace: crm
labels:
app: n8n-mapper
component: secrets
stringData:
Database password
DB_POSTGRESDB_PASSWORD: “”
Encryption key to hash all data
N8N_ENCRYPTION_KEY: “”
Credentials for redis database
QUEUE_BULL_REDIS_PASSWORD: “”
n8n-worker-config.yaml
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: n8n-worker-config
labels:
app: n8n-mapper
component: secrets
namespace: crm
stringData:
NODE_ENV: ‘production’
GENERIC_TIMEZONE: ‘Europe/Oslo’
WEBHOOK_TUNNEL_URL: ‘http://localhost:8888’
DB_TYPE: ‘postgresdb’
DB_POSTGRESDB_USER: ‘postgres’
DB_POSTGRESDB_DATABASE: ‘postgres’
DB_POSTGRESDB_HOST: ‘postgresql-master’
DB_POSTGRESDB_PORT: ‘5432’
N8N_METRICS: ‘true’
NODE_OPTIONS: ‘–max-old-space-size=1024’
N8N_DISABLE_PRODUCTION_MAIN_PROCESS: ‘false’
EXECUTIONS_MODE: ‘regular’
N8N_LOG_LEVEL: debug
EXECUTIONS_DATA_SAVE_ON_SUCCESS: ‘none’
EXECUTIONS_DATA_PRUNE: ‘false’
n8n.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: n8n-mapper
component: main-deployment
name: n8n-mapper
namespace: crm
spec:
replicas: 1
selector:
matchLabels:
app: n8n-mapper
template:
metadata:
labels:
app: n8n-mapper
spec:
containers:
- name: n8n-mapper
image: n8n-mapper
ports:
- containerPort: 5678
envFrom:
- configMapRef:
name: n8n-configmap
- secretRef:
name: n8n-secrets
livenessProbe:
httpGet:
path: /healthz
port: 5678
readinessProbe:
httpGet:
path: /healthz
port: 5678
resources:
limits:
cpu: “2.0”
memory: “2048Mi”
requests:
cpu: “0.5”
memory: “512Mi”
apiVersion: apps/v1
kind: Deployment
metadata:
name: n8n-worker
labels: &labels
app: n8n-mapper
component: worker
namespace: crm
spec:
replicas: 3
selector:
matchLabels:
app: n8n-mapper
template:
metadata:
labels:
app: n8n-mapper
spec:
containers:
- name: n8n-worker
image: n8n-mapper
imagePullPolicy: Never
args: [“n8n”, “worker”]
ports:
- name: http-metrics
containerPort: 5678
envFrom:
- secretRef:
name: n8n-secrets
- secretRef:
name: n8n-worker-config
resources:
limits:
cpu: “2.0”
memory: “2048Mi”
requests:
cpu: “0.5”
memory: “512Mi”
apiVersion: v1
kind: Service
metadata:
labels:
app: n8n-mapper
name: n8n-mapper
namespace: crm
spec:
selector:
app: n8n-mapper
ports:
- protocol: TCP
port: 5678
targetPort: 5678
type: LoadBalancer
dockerfile
FROM node:18.8.0-alpine
WORKDIR /app
RUN npm install -g [email protected]
EXPOSE 5678
ENV N8N_DATA_DIR=/data
RUN mkdir -p $N8N_DATA_DIR
WORKDIR $N8N_DATA_DIR
COPY ./workflows/ /data/workflows/
ENTRYPOINT [“/bin/sh”, “-c”, “n8n import:workflow --separate --input=/data/workflows && sleep 5; n8n start”]
Information on your n8n setup
- n8n version: v1.26.0, previously use v1.15.2 and have same issue
- Database (default: SQLite): Postgress
- n8n EXECUTIONS_PROCESS setting (default: own, main): main
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker container with installed npm n8n
- Operating system: Windows running Rancher Desktop and Skaffold