Finally got it to work with docker compose but doesn't work anymore

Hi there,
Many thanks for what seems a great app, very exhaustive and with great performance!

I have set-up my first docker instance. Took me some time to get it working. It is set-up with Traefik and worked great… once! I have kicked it off, set up one local repository through CLI, then one Backblaze repository through UI. Did 2 successfull snapshots. Then I restarted my docker instance, and since then, impossible to start the container. It shut down immediately after boot

Error message I get is:
“Server will allow connections from users whose accounts are stored in the repository.
User accounts can be added using ‘kopia server user add’.
ERROR unable to initialize repository: unable to initialize repository: error opening repository: unable to open repository: invalid repository password”

Here’s my docker compose, both if you have ideas of what is wrong (if error linked to docker), and as well to help other with setting up a docker compose set-up with Traefik:
version: “3”
services:
kopia:
image: kopia/kopia:latest
container_name: “kopia”
hostname: kopia
expose:
- 51515
networks:
- traefik_proxy
environment:
- TZ=Europe/Paris
- UID=1000 # test au lieu de PUID
- GID=100
- memory=“3096m”
- cpus=“2.5”
- KOPIA_PASSWORD=“secret1”
- USER=josse
user: “0:0” # works w 0:0 (not with 65532)
volumes:
- config:/app/config
- cache:/app/cache
- logs:/app/logs
- ./logs/cli-logs:/app/logs/cli-logs
- ./logs/content-logs:/app/logs/content-logs
- /srv/Tech/kopia/data:/app/data
- /srv/Users:/app/Users:ro # my backup sources
- /srv/Multimedia:/app/Multimedia:ro
- /srv/Tech:/app/Tech:ro
labels:
- “traefik.enable=true”
- “traefik.http.routers.kopia.rule=Host(kopia.domainname.fr)”
- “traefik.http.routers.kopia.entrypoints=http,https”
- “traefik.http.routers.kopia.tls=true”
- “traefik.http.routers.kopia.tls.certresolver=acme”
- “diun.enable=true”
entrypoint: [“/app/kopia”, “server”, “–insecure”, “–address=0.0.0.0:51515”, “–override-username=username@kopia”, “–server-username=username@kopia”, “–server-password=secret2”, “–override-hostname=kopia-server”]

networks:
default:
traefik_proxy:
external:
name: traefik_proxy

volumes:
config:
cache:
logs:

I reply to myself. I deleted my previous docker container and associated volumes, recreated a new instance, configured this time the Backblaze B2 repository with the CLI (not the UI, and using the “create”, “validate-provider”), connected to it (“connect”), and all is working again
I added a line to further protect the web UI with another layer (using Authelia) and all is working great
- “traefik.http.routers.kopia.middlewares=authelia@docker”

So, at the end, not sure what happened, but I suspect the fact to have a repository created through the UI didn’t help

Hey,
How do you backup the volumes of other containers this way?
I really need help in this.
Also, how do you make sure that containers are stopped before snapshot?

Hi Akash, sorry, I didn’t try, with that set-up,to backup the volumes of other containers, so I can’t answer your question. The source files I backup are located in the last three lines of the “volumes” section (if my memory’s good, I haven’t got the docker compose file in front of me)

Hey buddy,
So are you running any other images too in same docker-compose projects which you haven’t mentioned?
Because as much as I know, docker containers can’t access any other file/directory except their own.
I’m quite confused

Hi there,
In the Kopia docker compose I use no other containers. However, yes, I have many docker compose running several containers at a time. Works perfectly. Advantage is that you can run at once the app containers, its database, its cache, and is web server front-end.
Containers can access files/directory: you just need to map them out in your docker compose command
Example (in ‘volumes:’ section of the docker compose):

  • /srv/Users:/app/Users:ro # my backup sources. It means: mount the local host machine path ‘/srv/Users’ to the container ‘/app/Users’ path
  • /srv/Multimedia:/app/Multimedia:ro
  • /srv/Tech:/app/Tech:ro

Is it possible to backup named volumes this way?

I never tried
I suspect it should, as you could map those named volumes (indicating their local paths) to container path, so that the container can have access to them