eveseat / seat

🌀✳️ SeAT: A Simple, EVE Online API Tool and Corporation Manager
https://eveseat.github.io/docs/
GNU General Public License v2.0
425 stars 143 forks source link

Failure on fresh setup to migrate one step #814

Closed saward closed 3 years ago

saward commented 3 years ago

When starting up using docker-compose, the web service fails to run a migration. I can't find this file in the repo migrations list. This is pulled today using the '4' tag from Docker:

seat-web_1     | Migrating: 2020_05_31_110243_add_id_column_to_mail_recipients_table
seat-web_1     | 
seat-web_1     | In Connection.php line 669:
seat-web_1     |                                                                                
seat-web_1     |   SQLSTATE[42S22]: Column not found: 1054 Unknown column '`seat`.`a`.`labels`  
seat-web_1     |   ' in 'CHECK' (SQL: alter table `mail_recipients` add `id` bigint unsigned n  
seat-web_1     |   ot null auto_increment primary key first)                                    
seat-web_1     |                                                                                
seat-web_1     | 
seat-web_1     | In Exception.php line 18:
seat-web_1     |                                                                                
seat-web_1     |   SQLSTATE[42S22]: Column not found: 1054 Unknown column '`seat`.`a`.`labels`  
seat-web_1     |   ' in 'CHECK'                                                                 
seat-web_1     |                                                                                
seat-web_1     | 
seat-web_1     | In PDOStatement.php line 112:
seat-web_1     |                                                                                
seat-web_1     |   SQLSTATE[42S22]: Column not found: 1054 Unknown column '`seat`.`a`.`labels`  
seat-web_1     |   ' in 'CHECK'                                                                 
seat-web_1     |                                                                                
seat-web_1     |

Migrations to pass and the website to start working.

Using docker version via docker-compose, with some of my own modifications (mostly changing network and removing traefik stuff):

version: "3.2"

services:

  mariadb:
    image: mariadb:10
    restart: always
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: "yes"
      MYSQL_USER: ${DB_USERNAME}
      MYSQL_PASSWORD: ${DB_PASSWORD}
      MYSQL_DATABASE: ${DB_DATABASE}
    volumes:
      - "mariadb-data:/home/mark/programs/seat/mysql"
    networks:
      - web
    logging:
      driver: "json-file"
      options:
        max-size: "10Mb"
        max-file: "5"

  redis:
    image: redis:5-alpine
    restart: always
    networks:
      - web
    logging:
      driver: "json-file"
      options:
        max-size: "10Mb"
        max-file: "5"

  seat-web:
    image: eveseat/seat:4
    restart: always
    command: web
    ports:
      - "8050:80"
    env_file:
      - .env
    depends_on:
      - mariadb
      - redis
    networks:
      - web
    logging:
      driver: "json-file"
      options:
        max-size: "10Mb"
        max-file: "5"

  seat-worker:
    image: eveseat/seat:4
    restart: always
    command: worker
    env_file:
      - .env
    depends_on:
      - seat-web # so that we can get db migrations done
      - mariadb
      - redis
    networks:
      - web
    logging:
      driver: "json-file"
      options:
        max-size: "10Mb"
        max-file: "5"

  seat-cron:
    image: eveseat/seat:4
    restart: always
    command: cron
    env_file:
      - .env
    depends_on:
      - seat-web # so that we can get db migrations done
      - mariadb
      - redis
    networks:
      - web
    logging:
      driver: "json-file"
      options:
        max-size: "10Mb"
        max-file: "5"

volumes:
    mariadb-data:

networks:
  web:
    external: true
warlof commented 3 years ago

Hi, this is caused by Mariadb 10.5 fresh release - I didn't identify yet the change they introduce which cause this, but it's tied to json fields.

You can fix this state using this docker-compose instead

version: "3.2"

services:

  mariadb:
    image: mariadb:10.4
    restart: always
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: "yes"
      MYSQL_USER: ${DB_USERNAME}
      MYSQL_PASSWORD: ${DB_PASSWORD}
      MYSQL_DATABASE: ${DB_DATABASE}
    volumes:
      - "mariadb-data:/home/mark/programs/seat/mysql"
    networks:
      - web
    logging:
      driver: "json-file"
      options:
        max-size: "10Mb"
        max-file: "5"

  redis:
    image: redis:5-alpine
    restart: always
    networks:
      - web
    logging:
      driver: "json-file"
      options:
        max-size: "10Mb"
        max-file: "5"

  seat-web:
    image: eveseat/seat:4
    restart: always
    command: web
    ports:
      - "8050:80"
    env_file:
      - .env
    depends_on:
      - mariadb
      - redis
    networks:
      - web
    logging:
      driver: "json-file"
      options:
        max-size: "10Mb"
        max-file: "5"

  seat-worker:
    image: eveseat/seat:4
    restart: always
    command: worker
    env_file:
      - .env
    depends_on:
      - seat-web # so that we can get db migrations done
      - mariadb
      - redis
    networks:
      - web
    logging:
      driver: "json-file"
      options:
        max-size: "10Mb"
        max-file: "5"

  seat-cron:
    image: eveseat/seat:4
    restart: always
    command: cron
    env_file:
      - .env
    depends_on:
      - seat-web # so that we can get db migrations done
      - mariadb
      - redis
    networks:
      - web
    logging:
      driver: "json-file"
      options:
        max-size: "10Mb"
        max-file: "5"

volumes:
    mariadb-data:

networks:
  web:
    external: true
saward commented 3 years ago

That's done the trick! Not sure if you'd like me to close this now or leave open?

warlof commented 3 years ago

let's keep it open - we had to address it since it's the new stable version of Maria DB and most people will start to get this issue :)