Snapshot for /home not working

This is Ubuntu 20.04 LTS and kopia 0.8.4 build: 940d10dfa29e771467b5d9d45412b889053c2ed1 from: kopia/kopia.

When I do

kopia snapshot create /home
 * 0 hashing, 0 hashed (0 B), 1 cached (0 B), uploaded 4.6 KB (1 errors ignored), estimating...
Created snapshot with root ka7a22d84dec191d1a9171e8afd519905 and ID 71645a9fae785e295c46416b97e95c2a in 0s

When I snapshot /home/manfred the same happens. When I snapshot /home/manfred/bin the whole directory gets snapshotted.

Any idea?

Can you add --log-level=debug and see if there are any errors that come up?

First, thanks a lot for your quick reply.

Here it is.

Connected to repository.

NOTICE: Kopia will check for updates on GitHub every 7 days, starting 24 hours after first use.
To disable this behavior, set environment variable KOPIA_CHECK_FOR_UPDATES=false
Alternatively you can remove the file "/root/.config/kopia/repository.config.update-info.json".

build version v0.8.4, available v
no updated version available
combined 5 into 1 index segments
listing manifest contents
Snapshotting root@hogwart:/home ...
found 0 policies for root@hogwart
uploading root@hogwart:/home using 0 previous manifests
Uploading root@hogwart:/home
finished reading directory . in 399.069µs
finished reading directory manfred in 664.602µs

 ! Ignored error when processing "manfred": unable to stat directory entry "pCloudDrive": lstat /home/manfred/pCloudDrive: permission denied
 | 0 hashing, 0 hashed (0 B), 0 cached (0 B), uploaded 0 B (1 errors ignored), estimating...could not find cache entry for .borg
 / 1 hashing, 0 hashed (0 B), 0 cached (0 B), uploaded 201 B (1 errors ignored), estimating...[STORAGE] PutBlob("sb1c6eba81d14b130a30e79450d8cb343-s04d83cd6d2dede52105",len=201)=<nil> took 227.82µs
listing manifest contents
  keeping 2021-07-03 08:24:56.421939847 +0200 CEST reasons: [latest-1,annual-1,monthly-1,weekly-1,daily-1,hourly-1]
[STORAGE] PutBlob("pf63872bfcc830a7254805883a3d56d7b-s04d83cd6d2dede52105",len=4282)=<nil> took 201.839µs
[STORAGE] PutBlob("q54b18fa96f5a7b86389f3ed0f49dfbd0-s04d83cd6d2dede52105",len=4319)=<nil> took 376.65µs
[STORAGE] PutBlob("n380d62166e69567cd1e80adc23a7861b-s04d83cd6d2dede52105",len=287)=<nil> took 126.411µs
[STORAGE] GetMetadata("n380d62166e69567cd1e80adc23a7861b-s04d83cd6d2dede52105")=({n380d62166e69567cd1e80adc23a7861b-s04d83cd6d2dede52105 287 2021-07-03 08:24:56.428564499 +0200 CEST}, <nil>) took 10.057µs
[STORAGE] DeleteBlob("sb1c6eba81d14b130a30e79450d8cb343-s04d83cd6d2dede52105")=<nil> took 360.587µs
 * 0 hashing, 1 hashed (0 B), 0 cached (0 B), uploaded 9.1 KB (1 errors ignored), estimating...
Created snapshot with root k048edd6039db0180d43c9b4abbd3342f and ID 7280dab3191296627ae192dd4006f4a9 in 0s
Ignored 1 error(s) while snapshotting root@hogwart:/home.
not closing shared manager, remaining = 1
listing manifest contents
[STORAGE] GetBlob("q54b18fa96f5a7b86389f3ed0f49dfbd0-s04d83cd6d2dede52105",0,-1)=({4319 bytes}, <nil>) took 111.605µs
[STORAGE] GetBlob("kopia.maintenance",0,-1)=({415 bytes}, <nil>) took 23.396µs
not due for full manintenance cycle until 2021-07-04 08:24:46.764343289 +0200 CEST
not due for quick manintenance cycle until 2021-07-03 09:24:46.764346153 +0200 CEST
not due for maintenance
not closing shared manager, remaining = 1
closing shared manager
finished sweeping metadata cache in 179.211µs and retained 25729/5242880000 bytes (0 %)
[STORAGE] Close()=<nil> took 2.793µs
in use heap 49905664 (delta 49905664 max 0) stack 1179648 (delta 1179648 max 0)

Not sure if it is relevant. But this is btrfs and /home is a btrfs subvol.

I did some more investigation. All actions above were done as root. Let the kopia repository path be named as $KOPIA_REPOSITORY

I did the following as user manfred

sudo chown -R manfred:manfred $KOPIA_REPOSITORY
kopia repository connect  filesystem --path=$KOPIA_REPOSITORY
kopia snapshot create /home/

and now backup works ok.

Any idea, what’s going wrong here when trying to snapshot using user root?

I found the cause of the problem. pCloud is mounted under user manfred at /home/manfred/pCloudDrive

When trying to snapshot /home as user root I get

ERROR: upload error: unable to stat directory entry "pCloudDrive": lstat /home/manfred/pCloudDrive: permission denied

I did not imagine that this is the problem because the global repository has

Error handling policy:
  Ignore file read errors:        true       (defined for this target)
  Ignore directory read errors:   true       (defined for this target)
  Ignore unknown types:           true       (defined for this target)

Is there a possibility that kopia continues after above error?

I should add that the policy also contains

Files policy:
  Ignore cache directories:        true       (default)
  Ignore rules:
    .pcloud/                       (defined for this target)
    pCloudDrive/                   (defined for this target)
  Read ignore rules from files:
    .kopiaignore                   (defined for this target)
  Scan one filesystem only:        true       (defined for this target)