N8N ECS Exit code 1

Describe the problem/error/question

ECS tasks exiting(CODE 1) with very little information

What is the error message (if any)?

log only shows this line in the cloudwatch logs

UserSettings were generated and saved to: /home/node/.n8n/config

Please share your workflow

{
    "taskDefinitionArn": "arn:aws:ecs:ap-southeast-2::task-definition/n8n:2",
    "containerDefinitions": [
        {
            "name": "n8n",
            "image": ".dkr.ecr.ap-southeast-2.amazonaws.com/n8n:latest",
            "cpu": 0,
            "portMappings": [
                {
                    "containerPort": 5678,
                    "hostPort": 5678,
                    "protocol": "tcp"
                }
            ],
            "essential": true,
            "command": [],
            "environment": [
                {
                    "name": "QUEUE_BULL_REDIS_DB",
                    "value": "0"
                },
                {
                    "name": "QUEUE_BULL_REDIS_TIMEOUT_THRESHOLD",
                    "value": "1000"
                },
                {
                    "name": "QUEUE_RECOVERY_INTERVAL",
                    "value": "60"
                },
                {
                    "name": "DB_MYSQLDB_HOST",
                    "value": ""
                },
                {
                    "name": "DB_TYPE",
                    "value": "mysqldb"
                },
                {
                    "name": "QUEUE_BULL_REDIS_PORT",
                    "value": ""
                },
                {
                    "name": "DB_MYSQLDB_PASSWORD",
                    "value": ""
                },
                {
                    "name": "DB_MYSQLDB_DATABASE",
                    "value": "n8n"
                },
                {
                    "name": "QUEUE_BULL_REDIS_HOST",
                    "value": ""
                },
                {
                    "name": "DB_MYSQLDB_USER",
                    "value": ""
                },
                {
                    "name": "QUEUE_BULL_PREFIX",
                    "value": "n8n"
                },
                {
                    "name": "DB_MYSQLDB_PORT",
                    "value": "3306"
                },
                {
                    "name": "N8N_ENCRYPTION_KEY",
                    "value": "xxxxx"
                }
            ],
            "mountPoints": [],
            "volumesFrom": [],
            "logConfiguration": {
                "logDriver": "awslogs",
                "options": {
                    "awslogs-group": "n8n",
                    "awslogs-region": "ap-southeast-2",
                    "awslogs-stream-prefix": "container"
                }
            }
        }
    ],
    "family": "n8n",
    "taskRoleArn": "arn:aws:iam:::role/n8n-task-role",
    "executionRoleArn": "arn:aws:iam:::role/n8n-task-execution-role",
    "networkMode": "awsvpc",
    "revision": 2,
    "volumes": [],
    "status": "ACTIVE",
    "requiresAttributes": [
        {
            "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
        },
        {
            "name": "ecs.capability.execution-role-awslogs"
        },
        {
            "name": "com.amazonaws.ecs.capability.ecr-auth"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
        },
        {
            "name": "com.amazonaws.ecs.capability.task-iam-role"
        },
        {
            "name": "ecs.capability.execution-role-ecr-pull"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
        },
        {
            "name": "ecs.capability.task-eni"
        }
    ],
    "placementConstraints": [],
    "compatibilities": [
        "EC2",
        "FARGATE"
    ],
    "requiresCompatibilities": [
        "FARGATE"
    ],
    "cpu": "1024",
    "memory": "4096",
    "registeredAt": "2023-04-19T08:26:49.257Z",
    "registeredBy": "arn:aws:sts:::assumed-role/InfraRemoteAssumeRole/mysale-test",
    "tags": [
        {
            "key": "Revision",
            "value": "test"
        },
        {
            "key": "maintainer_software",
            "value": "Terraform"
        },
        {
            "key": "service_name",
            "value": "n8n"
        },
        {
            "key": "Environment",
            "value": "test"
        },
        {
            "key": "project",
            "value": ""
        },
        {
            "key": "team",
            "value": "Cloud Engineering Team"
        },
        {
            "key": "Name",
            "value": "n8n"
        }
    ]
}
FROM node:16

ARG N8N_VERSION=0.222.3
# RUN if [ -z "$N8N_VERSION" ] ; then echo "The N8N_VERSION argument is missing!" ; exit 1; fi

RUN \
	apt-get update && \
	apt-get -y install graphicsmagick gosu git

USER root

RUN npm_config_user=root npm install -g full-icu n8n@${N8N_VERSION}

ENV NODE_ICU_DATA /usr/local/lib/node_modules/full-icu

WORKDIR /data

COPY .docker/n8n/docker-entrypoint.sh /
RUN chmod 755 /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 5678/tcp

Share the output returned by the last node

Information on your n8n setup

  • **n8n version: 0.222.3
  • **Database (default: SQLite): mysqld
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): self hosted docker
  • Operating system:

Hey @rcclemente,

Welcome to the community :cake\

Assuming the database fields are empty to hide them my initial thought on this one is n8n is not able to connect to the database and rather than showing an error it is just exiting for some reason.

As a quick test can you remove the queue mode options for now and try a single instance pointing to the database and see if that works, if that also fails it would be a good indication that the issue is with those database settings.

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