rommapp / romm

A beautiful, powerful, self-hosted rom manager
https://romm.app
GNU Affero General Public License v3.0
2.37k stars 96 forks source link

[Bug] Romm not writing files to mounted volumes #1280

Closed DurandalJoyeuse closed 6 days ago

DurandalJoyeuse commented 2 weeks ago

RomM version Latest

Describe the bug When deploying Romm, it will spin up and run, however it wont actually create its data within the mounted volumes, thus the data is lost entirely on any redeployment of the stack (such as updating romm or the db it depends on). Looking at the logs I can see a SQL error:

ERROR: [init][2024-11-07 16:52:39] Something went horribly wrong with our database

An important note - I wasn't able to get Romm to deploy with mariadb:latest - I had to use linuxserver/mariadb:latest to get the stack to deploy.

Also, I have tried deploying with the default example as written (adding in unique variables where applicable) and it produced the same results. So I've cloned over the configs that work in my Bookstack and Komga configurations and neither of those work either.

To Reproduce Using Portainer to deploy the docker compose stack, the container is generated and the folders are created, but no files are generated in them. The compose file being deployed:

version: "3"

volumes:
  romm_resources:
  romm_redis_data:

services:
  romm:
    image: rommapp/romm:latest
    container_name: romm
    restart: unless-stopped
    labels:
      - docker-volume-backup.stop-during-backup=true
    environment:
      - PUID=1000
      - PGID=1000
      - DB_HOST=romm-db
      - DB_NAME=romm # Should match MYSQL_DATABASE in mariadb
      - DB_USER=***
      - DB_PASSWD=*** # Should match MYSQL_PASSWORD in mariadb
      - ROMM_AUTH_SECRET_KEY=***
      - IGDB_CLIENT_ID=*** # Generate an ID and SECRET in IGDB
      - IGDB_CLIENT_SECRET=*** # https://api-docs.igdb.com/#account-creation
      - MOBYGAMES_API_KEY=*** # https://www.mobygames.com/info/api/
      - STEAMGRIDDB_API_KEY=***
    volumes:
      - romm_resources:/romm/resources # Resources fetched from IGDB (covers, screenshots, etc.)
      - romm_redis_data:/redis-data # Cached data for background tasks
      - /home/dockeradmin/software/Emulation:/romm/library
      - /home/dockeradmin/software/containers/romm/assets:/romm/assets # Uploaded saves, states, etc.
      - /home/dockeradmin/software/containers/romm/config:/romm/config.yml # [Optional] Path where config is stored
    ports:
      - 4780:8080
    depends_on:
      - romm-db

  romm-db:
    image: linuxserver/mariadb:latest # if you experience issues, try: linuxserver/mariadb:latest
    container_name: romm-db
    restart: unless-stopped
    labels:
      - docker-volume-backup.stop-during-backup=true
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
      - MYSQL_ROOT_PASSWORD=*** # Use a unique, secure password
      - MYSQL_DATABASE=romm
      - MYSQL_USER=***
      - MYSQL_PASSWORD=***
    volumes:
      - /home/dockeradmin/software/containers/romm/mysql_data:/var/lib/mysql

  backup:
    image: offen/docker-volume-backup:latest
    restart: unless-stopped
    volumes:
      - /home/dockeradmin/software/containers/romm:/backup:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /home/dockeradmin/data/backups/romm:/archive # location where to put the backup
    environment:
      - BACKUP_CRON_EXPRESSION=0 7 * * *
      - BACKUP_COMPRESSION=zst
      - BACKUP_FILENAME=bookstack-backup-%Y-%m-%dT%H-%M-%S.{{
        .Extension }}
      - BACKUP_LATEST_SYMLINK=backup.latest.tar.zst
      - BACKUP_PRUNING_LEEWAY=3m

Expected behavior Files to be generated in mounted volumes

Screenshots Screenshot_20241107_131609

Desktop (please complete the following information):

Additional context Attached are two sets of logs - one right after the container stack is deployed, the other when left running for a bit.

_romm_logs.txt _romm_logs(1).txt

adamantike commented 6 days ago

An important note - I wasn't able to get Romm to deploy with mariadb:latest - I had to use linuxserver/mariadb:latest to get the stack to deploy.

This is the main issue, and the reason we're removing the recommendation of using linuxserver/mariadb:latest in #1278, unless the user is aware of which other changes must be applied to the Docker Compose.

Creating a volume for /var/lib/mysql is correct, but only when the image is the official mariadb. LinuxServer's MariaDB image requires a volume for /config instead (related docs).

DurandalJoyeuse commented 6 days ago

That did indeed fix it, appreciate!