Help with very first snapshot

This is a fresh install of Kopia on a Raspberry Pi 5 running latest Bookworm. Kopia runs in a docker container. This installation is just temporary just to get the feel of it; a later one will be more secure. Here is the compose file:

services:
  kopia:
      image: kopia/kopia:latest
      container_name: kopia
      hostname: kopia
      #user: "0:0"
      restart: unless-stopped
      privileged: true
      cap_add:
        - SYS_ADMIN
      security_opt:
        - apparmor:unconfined
      devices:
        - /dev/fuse:/dev/fuse:rwm
      command:
        - server
        - start
        - --disable-csrf-token-checks
        #- --tls-cert-file=/data/home/XXX/ssl-certs/fullchain.pem
        #- --tls-key-file=/data/home/XXX/ssl-certs/privkey.pem
        - --insecure
        - --address=0.0.0.0:51515
        - --server-username=kopia # just for testing
        - --server-password=kopia # just for testing
      environment:
        USER: xxxxxxxxxxx
        KOPIA_PASSWORD: xxxxxxxxxxx
        TZ: Europe/London
      ports:
        #  int:ext
        - 51515:51515
      networks:
        - pi_net
      volumes:
        #      /path/on/host:/path/in/container
        - ../../volumes/kopia/tmp:/tmp:shared
        - ../../volumes/kopia/config:/app/config
        - ../../volumes/kopia/cache:/app/cache
        - ../../volumes/kopia/logs:/app/logs
        - ../../volumes/kopia/data:/data:ro
        # originalas for reference
        #- /mnt/kopia:/tmp:shared
        #- /home/XXX/docker/Kopia-Ubuntu/config:/app/config
        #- /home/XXX/docker/Kopia-Ubuntu/cache:/app/cache
        #- /home/XXX/docker/Kopia-Ubuntu/logs:/app/logs
        #- /:/data:ro

networks:
  pi_net:
    external: true

Here’s the log after installing:

Server will allow connections from users whose accounts are stored in the repository.

User accounts can be added using 'kopia server user add'.

Repository not configured.

SERVER ADDRESS: http://[::]:51515

Open the address above in a web browser to use the UI.

Curiously, there is no <hostname>.local specified.

After logging in I get to the “storage Type” screen where I can select WebDav (this is for a Synology NAS on the same subnet). This points to the NAS filesystem:

http://<ipv4_address>:5005/raspberrypi/kopia
UserName: etc...
Password: etc...

After configuring the storage (aka Repository, if that’s correct?), I can move on to next screens, configuring the repository:

Connect as: root@kopia
Repository password: kopia (from compose.yaml, above)
Description: My Respository

Click: [Connect to Repository]

Next step is to configure a Policy. Next tab. There is one (global?) policy already there:

Username/Host/Path all asterisked and all options set in “defined”

For testing I want to backup everything in my directory (/home/<username>), so I enter /home/<username> to define a new policy (as a “Local path policy”) and click [Set Policy]

The next screen shows Directory: root@kopia:/home/<username>

Below that are various config options. For testing I choose every 10 mins for Snapshot Frequency and leave everything else at the defaults. Finally click [Save Policy].

In the tasks tab I get “Failed after 0.0s

The log shows this:

upload triggered via API: root@kopia:/home

snapshot error: snapshot task: unable to create local filesystem: unable to determine entry type: lstat /home/<username>: no such file or directory

Yet this directory DOES exist (as shown by the contents of ls -la /home/username)

So I’m thinking this is probably a permissions issue?

…because the log now shows:

snapshot error: snapshot task: unable to create local filesystem: unable to determine entry type: lstat /home/<username>: no such file or directory

I’ve tried different users (1000:1000 and 0:0) with various errors logged.

Suggestions for next steps?

Thanks, Ric

I am not a docker expert but is it possible that from your kopia perspective running inside docker it is correct? /home/<username> is not accessible/does not exist. Isn’t it the whole docker purpose to create isolated “containers” without access (unless explicitly defined) to anything outside?

If I was you I would forget all docker thing as except increasing complexity of your setup it does not bring any real benefits IMO. Your issue I think is purely docker related and has not much to do with kopia itself:) Run it in an environment where it can access directory you are after and all will rock and roll:)

I understand your position, but I am running some 10-20 containers in docker quite successfully. The purpose of the volumes directives is to create persistent storage that maps the internal (container) filesystem to the external filesystem. The benefit of containers is that they are independent of the main filesystem to the extent they can be destroyed without leaving bits of themselves all over the place.

For the moment I’d rather follow Kopia’s own installation guide regarding containers.

Docker things aside. As you use kopia server I think you should run another kopia client instance. In docker or not - does not matter. This is where you connect to your kopia server and run backup itself.