Bug 426139 (UnicodeDecodeError) - No Backup due to UnicodeDecodeError in error callback
Summary: No Backup due to UnicodeDecodeError in error callback
Status: RESOLVED UPSTREAM
Alias: UnicodeDecodeError
Product: kup
Classification: Applications
Component: general (show other bugs)
Version: 0.8.0
Platform: Manjaro Linux
: NOR critical
Target Milestone: ---
Assignee: Simon Persson
URL:
Keywords:
: 426421 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-03 11:38 UTC by KDE-BT
Modified: 2020-10-14 10:31 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description KDE-BT 2020-09-03 11:38:55 UTC
SUMMARY
Since update to 0.8.0-2 no successfull backup is possible. The backup job which works just fine since returns the following error message in the logfile:

{init, fsck & index:  exit code: 0}
bup "-d" "{path}" "save" "-n" "kup" "-vv" "/{path}" "/{path}"
Traceback (most recent call last):
  File "/usr/lib/bup/cmd/bup-save", line 324, in <module>
    log('%s %-70s\n' % (status, path_msg(ent.name)))
  File "/usr/lib/bup/cmd/../bup/io.py", line 18, in path_msg
    return x.decode(errors='backslashreplace')
TypeError: don't know how to handle UnicodeDecodeError in error callback
Exit code: 1
Kup did not successfully complete the bup backup job: failed to save everything.

STEPS TO REPRODUCE
1. Start backup job
2. Wait a while
3. Get error

OBSERVED RESULT
No backup is made

EXPECTED RESULT
Backup should have made

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Manjaro Linux 20.1, Kernel 5.8.3-2
(available in About System)
KDE Plasma Version: 5.19.4-1
KDE Frameworks Version: 5.73.0-1
Qt Version: 5.15.0-4

ADDITIONAL INFORMATION
Comment 1 Rober 2020-09-09 11:51:43 UTC
I have the same problem: 

Kup is starting bup backup job at miércoles, 9 de septiembre de 2020 12:47:24 (CEST)

bup "-d" "/run/media/rober/Backup1Tb/Backups" "init"
Exit code: 0
bup "-d" "/run/media/rober/Backup1Tb/Backups" "index" "-u" "--exclude" "/home/rober/.cache" "--exclude" "/home/rober/.dreamchess" "--exclude" "/home/rober/.dropbox" "--exclude" "/home/rober/.mozilla" "--exclude" "/home/rober/.tor-browser" "--exclude" "/home/rober/.tor-browser-es" "--exclude" "/home/rober/.tor-browser-es-es" "--exclude" "/home/rober/Descargas" "--exclude" "/home/rober/Downloads" "/home/rober"
Exit code: 0
bup "-d" "/run/media/rober/Backup1Tb/Backups" "save" "-n" "kup" "-vv" "/home/rober"
Traceback (most recent call last):
  File "/usr/lib/bup/cmd/bup-save", line 324, in <module>
    log('%s %-70s\n' % (status, path_msg(ent.name)))
  File "/usr/lib/bup/cmd/../bup/io.py", line 18, in path_msg
    return x.decode(errors='backslashreplace')
TypeError: don't know how to handle UnicodeDecodeError in error callback
Exit code: 1
Kup did not successfully complete the bup backup job: failed to save everything.

SOFTWARE/OS VERSIONS 
Operating System: Arch Linux
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.73.0
Qt Version: 5.15.0
Kernel Version: 5.8.7-arch1-1
OS Type: 64-bit

KUP VERSION 0.8.0-2:
Comment 2 João Figueiredo 2020-09-12 00:07:54 UTC
I'm pretty sure this has something to do with having files with special characters in the name (á, ç, ã, etc).
I'm a maintainer of bup on ArchLinux's AUR, and one user had the exact same issue. It seems like that was the cause, because when removing the folder with those problematic filenames it all worked again.
Comment 3 Simon Persson 2020-09-12 07:53:52 UTC
*** Bug 426421 has been marked as a duplicate of this bug. ***
Comment 4 Rober 2020-09-12 07:57:50 UTC
(In reply to João Figueiredo from comment #2)
> I'm pretty sure this has something to do with having files with special
> characters in the name (á, ç, ã, etc).
> I'm a maintainer of bup on ArchLinux's AUR, and one user had the exact same
> issue. It seems like that was the cause, because when removing the folder
> with those problematic filenames it all worked again.

Sure, but what char is it? Maybe kup or bup should accept the same chars that Dolphin (Plasma)
Comment 5 Simon Persson 2020-09-12 07:59:56 UTC
Thanks for reporting! It seems many users are experiencing this after updating bup to version 0.31.

Issue is reported and discussed here:
https://groups.google.com/forum/#!topic/bup-list/Jaq_BACy7QU
Comment 6 João Figueiredo 2020-09-12 11:53:34 UTC
(In reply to Rober from comment #4)
> Sure, but what char is it? Maybe kup or bup should accept the same chars
> that Dolphin (Plasma)

Basically any non-ASCII character. It actually all works fine if you just use bup, this is a kup-specific bug. But yeah, it's definitely not an intended behavior; the fix should be on its way.
Comment 7 João Figueiredo 2020-09-12 12:02:45 UTC
(In reply to João Figueiredo from comment #6)
> this is a kup-specific bug

Or, more accurately, there was a change in bup that kup didn't account for.
Comment 8 KDE-BT 2020-09-13 13:15:55 UTC
Done a little testing:
1. backup with kup without special-chars: works
2. backup with kup adding a file with special char: error
3. backup with bup (same options as kup): error
4. backup with bup without option "-vv": works (restore possible)
5. backup with bup with option "-v" (subfolder without special char): works
6. backup with bup with option "-v" (subfolder with special char): works (!)

I have no idea, if this is helpful to anyone, or if it is even posted in the right place.
Comment 9 Simon Persson 2020-09-17 04:28:40 UTC
I think this has been fixed upstream. Found the following:

https://groups.google.com/forum/#!topic/bup-list/Ifw6gZ6sxBA

https://github.com/bup/bup/commit/eff166ca3ad17288b3114cc3c636c7b3d96ad155#diff-3f8c732e7bb07d7ef75a64f8effac28a

So anyone who is eager enough to get this working can try latest bup from git.
Comment 10 KDE-BT 2020-10-06 14:40:49 UTC
Making the changes in io.py will result in an error message when trying to restore a file (w/o special chars) from an existing backup:

Traceback (most recent call last):
  File "/usr/bin/bup", line 25, in <module>
    from bup.io import path_msg
  File "/usr/lib/bup/cmd/../bup/io.py", line 12
    """Return a string representation of a path."""
                                                  ^
IndentationError: expected an indented block 

So I rather do not implement this as it would mean to loose all existing backups.
Comment 11 KDE-BT 2020-10-14 10:31:33 UTC
I like to confirm that the bug is fixed. Backup as well as restore works fine now. 

Whatever went wrong the first time, I've tried - most certain a mistake on my side - didn't show up again.

Thank you and all the others for your time and effort in this matter as well as for your work in this tool in the first place.