After setting up kopia via docker compose: invalid repository password

After setting up kopia with this docker-compose:

services:
  kopia:
    image: kopia/kopia:latest
    container_name: kopia
    user: 0:0
    restart: unless-stopped
    privileged: true
    ports:
      - 51515:51515
    cap_add:
      - SYS_ADMIN
    security_opt:
      - apparmor:unconfined
    devices:
      - /dev/fuse:/dev/fuse:rwm
    command:
      - server
      - start
      - --disable-csrf-token-checks
      - --address=0.0.0.0:51515
      - --server-username=XXX
      - --server-password=XXX
      - --insecure
    volumes:
      - /mnt/kopia:/tmp:shared
      - ./config:/app/config
      - ./cache:/app/cache
      - ./logs:/app/logs
      - /XXX/XXX:/data:ro
    environment:
      KOPIA_PASSWORD: XXX
      TZ: Europe/Berlin
      USER: XXX
networks: {}

Everything works but as soon as I restart I get this error:

kopia  | ERROR failed to open repository: unable to create format manager: invalid repository password
kopia  | ERROR unable to initialize repository: unable to initialize repository: error opening repository: unable to open repository: unable to create format manager: invalid repository password

And the server crashes.

I tried this compose first same issue:

services:
  kopia:
    image: kopia/kopia:latest
    hostname: Kopia
    container_name: Kopia
    restart: unless-stopped
    ports:
      - 51515:51515
    # Setup the server that provides the web gui
    command:
      - server
      - start
      - --disable-csrf-token-checks
      - --insecure
      - --address=0.0.0.0:51515
      - --server-username=XXX
      - --server-password=XXX
    environment:
      # Set repository password
      KOPIA_PASSWORD: XXX
      USER: XXX
    volumes:
      # Mount local folders needed by kopia
      - ./config/dir:/app/config
      - /tmp/cache/dir:/app/cache
      - ./logs/dir:/app/logs
      # Mount local folders to snapshot
      - /XXX/XXX:/data:ro
networks: {}

Are there any rules maybe my password is too long 128 chars?

Thanks a lot in advance!

Maybe this is also related to me choosing root@kopia as the user and machine for some reason.