spersson / Kup

A backup scheduler for KDE's Plasma desktop
https://www.linux-apps.com/p/1127689/
132 stars 14 forks source link

Home folder is selected but appears not to be #101

Closed j0hannes closed 4 years ago

j0hannes commented 4 years ago

I saw the notice about Kup being available in KDE now and wanted to try it out, so I sat up a backup job for /etc.

After two hours of increased CPU load I got a message Kup did not successfully complete the bup backup job: failed to index everything. Apparently, bup was running on /home, which includes a FUSE mount point, which took ages to complete; just for bup to finally fail on /etc because of lacking read permissions for some files.

The scanning of the /home directory was completely unnecessary for what it was supposed to backup.

spersson commented 4 years ago

Where was it supposed to save the backup? Not in your home folder, I hope? :) I don't see any reason why it would access the home folder. Kup makes a log file you can look at to see the exact commands that it runs, perhaps using that you can trace down what happened? If you find that bup is doing something that you think it should not be doing, you can report it to their mailing list, https://groups.google.com/forum/#!forum/bup-list. If you find that Kup is somehow causing it or could be doing some work-around to avoid this issue, then please reopen this issue. Thanks!

j0hannes commented 4 years ago

I configured a backup of /etc, but the process got stuck scanning /home. In the log, I see the following error:

Traceback (most recent call last):
  File "/usr/lib/bup/cmd/bup-index", line 289, in <module>
    out=out)
  File "/usr/lib/bup/cmd/bup-index", line 194, in update_index
    for e in index.merge(ri, wr):
  File "/usr/lib/bup/bup/helpers.py", line 235, in merge_iter
    heap = [MergeIterItem(e, it) for e, it in heap if e]
  File "/usr/lib/bup/bup/helpers.py", line 234, in <genexpr>
    heap = ((next(it, None),it) for it in iters)
  File "/usr/lib/bup/bup/index.py", line 463, in iter
    for sub in root.iter(name=name, wantrecurse=wantrecurse):
  File "/usr/lib/bup/bup/index.py", line 401, in iter
    for e in child.iter(name=name, wantrecurse=wantrecurse):
  File "/usr/lib/bup/bup/index.py", line 401, in iter
    for e in child.iter(name=name, wantrecurse=wantrecurse):
  File "/usr/lib/bup/bup/index.py", line 401, in iter
    for e in child.iter(name=name, wantrecurse=wantrecurse):
  File "/usr/lib/bup/bup/index.py", line 393, in iter
    assert(eon > ofs)
AssertionError
Exception mmap.error: (2, 'No such file or directory') in <bound method Reader.__del__ of <bup.index.Reader instance at 0x7efc9a018c30>> ignored

which is a bup error, but I suspect Kup to be responsible for running bup on the wrong directory. The last two parameters are "/etc" "/home/johannes". Kup fails with Kup did not successfully complete the bup backup job: failed to index everything.

spersson commented 4 years ago

Aha! Excellent info, if the home folder path is given as a parameter to bup index then your home folder is indeed included in your source selection. Of course, the problem is now why is it not shown to you as being included (full or partially full checkbox next to the folder name in the "Sources" settings). My best guess here would be that it is because of your somewhat unusual file system setup. To reproduce, can you help with some more info? Which version of kup are you using? Where is your fuse mount point? You said it is somewhere under /home. Is it /home/johannes? Which filesystem type are you using? Anything else you think could be relevant? Thanks for the update!

j0hannes commented 4 years ago

It's the mount point the pCloud creates which doesn't work with bup apparently. I now included the home folder but excluded that mount directory. Now it fails after a few seconds with

Traceback (most recent call last):
  File "/usr/lib/bup/cmd/bup-save", line 314, in <module>
    log('%s %-70s\n' % (status, path_msg(ent.name)))
  File "/usr/lib/bup/bup/helpers.py", line 154, in log
    _hard_write(sys.stderr.fileno(), s if isinstance(s, bytes) else s.encode())
UnicodeEncodeError: 'ascii' codec can't encode characters in position 79-80: ordinal not in range(128)

I also suspect bup to follow symlinks that point to directories on that FUSE resource, I didn't see any option in Kup to make bup not to follow symlinks.

spersson commented 4 years ago

bup does not follow symlinks. Can you please confirm if the checkbox status of your folder selection ("Sources") matches what you expect in all cases and what is in .config/kuprc?

spersson commented 4 years ago

Closing. Without feedback I will assume that everything works as it should regarding folder selection. If bup works poorly with some specific filesystem that is most definitely a bup issue.