LycheeOrg / Lychee-Docker

Docker image for Lychee
https://lycheeorg.github.io/
167 stars 55 forks source link

DB error since update #174

Closed tiritibambix closed 9 months ago

tiritibambix commented 9 months ago

Hello. My instance seems to fail since a couple updates back.

2024-01-05 18:12:01 11 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 9 to have type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'), found type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB').

2024-01-05 18:12:01 11 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255).

I tried upgrading to mariadb:11 but I got the same error.

I use openmediavault + docker + portainer and here is my docker-compose:

version: '3'

services:
  lychee_db:
    container_name: lychee_db
    image: mariadb:11
    environment:
      - MYSQL_ROOT_PASSWORD=******
      - MYSQL_DATABASE=lychee
      - MYSQL_USER=lychee
      - MYSQL_PASSWORD=******
    expose: 
      - 3306
    volumes:
      - /srv/.../Files/Lychee/mysql:/var/lib/mysql
    networks:
      - lychee
    restart: unless-stopped

  lychee:
    image: lycheeorg/lychee
    container_name: lychee
    ports:
      - 6996:80
    volumes:
      - /srv/.../Files/Lychee/lychee/conf:/conf
      - /srv/.../Files/Lychee/lychee/uploads:/uploads
      - /srv/.../Files/Lychee/lychee/sym:/sym
    networks:
      - lychee
    environment:
      - PUID=998
      - PGID=100
      - PHP_TZ=Europe/Paris
      - PHP_TZ=UTC
      - TIMEZONE=UTC
      - DB_CONNECTION=mysql
      - DB_HOST=lychee_db
      - DB_PORT=3306
      - DB_DATABASE=lychee
      - DB_USERNAME=lychee
      - DB_PASSWORD=******
      - STARTUP_DELAY=30
    restart: unless-stopped
    depends_on:
      - lychee_db

networks:
  lychee:

volumes:
  mysql:

Any idea what's going on ? Thanks for your help.

EDIT: adding APP_URL=http://machineip:6996 fixed the problem when accessing locally but not trough domain. adding APP_URL=https://mylycheedomain.tld doesn't fix the problem. I'm using Nginx Proxy Manager.

Edit2: tried https://github.com/LycheeOrg/Lychee/issues/2106#issuecomment-1869798430, read #171 and the workarounds don't work. What is the correct fix for non tech people ?

tiritibambix commented 9 months ago

Ok, so I added TRUSTED_PROXIES=* to my .env file I also added fastcgi_param HTTPS on; to my Nginx config like in the picture here: npmlychee.jpg

I can access lychee properly but images are not displayed. What's is the proper fix ?

tiritibambix commented 9 months ago

Ok, so I switched back to APP_URL=https://mylycheedomain.tld and with previous tinkers it works, but feels like a dirty temporary fix

ildyria commented 9 months ago

With the latest builds this should be fixed. :)

tiritibambix commented 9 months ago

With the latest builds this should be fixed. :)

That's great news :)

Is there something I should correct back for future updates like removing TRUSTED_PROXIES=* from my .env file ans astcgi_param HTTPS on; from my Nginx config ?

ildyria commented 9 months ago

Nah that should stay. but APP_URL should in theory be a bit more permissive now.