Problem with installation on docker

Hi Guys,

i try to install n8n with docker-compose. This is my docker-compose.yml:

n8n:
        image: n8nio/n8n
        ports:
            - 5678:5678
        depends_on:
            - mariadb
        environment:
            - DB_TYPE=mysqldb
            - DB_MYSQLDB_DATABASE=${N8N_DATABASE}
            - DB_MYSQLDB_HOST=${DB_HOST}
            - DB_MYSQLDB_PORT=3306
            - DB_MYSQLDB_USER=${DB_USERNAME}
            - DB_MYSQLDB_PASSWORD=${DB_PASSWORD}
            - N8N_BASIC_AUTH_ACTIVE=true
            - N8N_BASIC_AUTH_USER=${N8N_USER}
            - N8N_BASIC_AUTH_PASSWORD=${N8N_PASSWORD}
        command: "n8n start --tunnel"
        networks:
            - sail
        restart: always
        volumes:
            - ./n8n/data:/home/node/.n8n

The problem is, that the container can’t start. I got this error:

Initializing n8n process
There was an error initializing DB: "Duplicate column name 'webhookId'"
Stopping n8n...

When i look on the database, i see this field in the Table. When i drop this field, it will create again, but than another error with an existing field, or an index throws. I rebuild the container, drop the database and so on. Everytime the same errors.

What do i wrong?

Cheers
Ralf

Welcome to the community @kerstel!

Sorry can sadly not explain what is going on there. Looks correct to me. I just tested locally and for me, everything is working perfectly.

Created the most basic Docker commands for you to test locally. Maybe it helps you to figure out the problem:

Docker command for MariaDB:

docker run -it --rm \
  --name mariadb \
  -p 3306:3306 \
  -e MARIADB_ROOT_PASSWORD=asdf1234 \
  -e MARIADB_DATABASE=n8n \
  mariadb:10.6

Docker command for n8n with MariaDB:

docker run -it --rm \
  --name n8n \
  -e DB_TYPE=mysqldb \
  --network=host \
  -e DB_MYSQLDB_USER=root \
  -e DB_MYSQLDB_PASSWORD=asdf1234 \
  -e DB_MYSQLDB_DATABASE=n8n \
  n8nio/n8n:0.121.0
1 Like

Hi Jan,

MariaDB is working correctly. I can login on the DB Host, see the n8n Database and so on.

It seems, it is an problem with the migration?

Cheers
Ralf

Hey Jan,

some ideas? I’m finished with my ideas, google and so on :frowning:

Cheers
Ralf

Hey @kerstel,

May I know which version you’re using? If you’re using the latest version, can you try using [email protected]?

Hm, i see in Docker the Version “latest” :smiley: But Version 0.121.0 works. How can i use the latest?

Thanks @harshil1712 :slight_smile:

We have fixed issues with version 0.122.2 and it is the latest version. Can you try that? Not sure which latest version you were using earlier, but it should now be fixed :slight_smile:

Hey @kerstel!

Did your issue get fixed? If yes, can you share the solution so that others can benefit from it as well :slight_smile: