Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

borg mount: UnicodeEncodeError crash while listing files #3400

Closed
orlitzky opened this issue Nov 29, 2017 · 2 comments
Closed

borg mount: UnicodeEncodeError crash while listing files #3400

orlitzky opened this issue Nov 29, 2017 · 2 comments

Comments

@orlitzky
Copy link

This is possibly related to #382. I was experiencing crashes when trying to ls my borg-mounted archives. From the client side, it looked like an IO error, and then afterwards, it was telling me that the endpoint was disconnected. The tl;dr is that I ran borg mount --debug --foreground and captured this:

Calling fuse_session_loop
handler raised <class 'UnicodeEncodeError'> exception ('ascii' codec can't encode character '\xf4' in position 110: ordinal not in range(128)), terminating main loop.
Terminated main loop because request handler raised exception, re-raising..
Calling fuse_session_remove_chan
Calling fuse_session_destroy
RepositoryCache: current items 104, size 3.68 MB / 2.15 GB, 0 hits, 104 misses, 0 slow misses (+0.0s), 0 evictions, 0 ENOSPC hit
RemoteRepository: 6.80 kB bytes sent, 4.95 MB bytes received, 135 messages sent
Local Exception
Traceback (most recent call last):
  File "/usr/lib64/python3.4/site-packages/borg/archiver.py", line 4073, in main
    exit_code = archiver.run(args)
  File "/usr/lib64/python3.4/site-packages/borg/archiver.py", line 4001, in run
    return set_ec(func(args))
  File "/usr/lib64/python3.4/site-packages/borg/archiver.py", line 1323, in do_mount
    return self._do_mount(args)
  File "/usr/lib64/python3.4/site-packages/borg/archiver.py", line 148, in wrapper
    return method(self, args, repository=repository, **kwargs)
  File "/usr/lib64/python3.4/site-packages/borg/archiver.py", line 1333, in _do_mount
    operations.mount(args.mountpoint, args.options, args.foreground)
  File "/usr/lib64/python3.4/site-packages/borg/fuse.py", line 303, in mount
    signal = fuse_main()
  File "/usr/lib64/python3.4/site-packages/borg/fuse.py", line 33, in fuse_main
    return llfuse.main(workers=1)
  File "src/fuse_api.pxi", line 343, in llfuse.main (src/llfuse.c:35968)
  File "src/handlers.pxi", line 436, in llfuse.fuse_opendir (src/llfuse.c:17900)
  File "src/handlers.pxi", line 437, in llfuse.fuse_opendir (src/llfuse.c:17850)
  File "/usr/lib64/python3.4/site-packages/borg/fuse.py", line 516, in opendir
    self._load_pending_archive(inode)
  File "/usr/lib64/python3.4/site-packages/borg/fuse.py", line 489, in _load_pending_archive
    self.process_archive(archive_name, [os.fsencode(archive_name)])
  File "/usr/lib64/python3.4/site-packages/borg/fuse.py", line 329, in process_archive
    path = os.fsencode(item.path)
  File "/usr/lib64/python3.4/os.py", line 770, in fsencode
    return filename.encode(encoding, errors)
UnicodeEncodeError: 'ascii' codec can't encode character '\xf4' in position 110: ordinal not in range(128)

That along with the suggestion in #382 inspired me to check my locale settings on both the client and server, and set them both to en_US.utf8. That seems to have worked.

This was a little baffling, so it might be worth a special exception handler. Otherwise, EWONTFIX it and let it serve as documentation to google searchers.

@ThomasWaldmann
Copy link
Member

@orlitzky
Copy link
Author

So it is =P

It might help to spam the terms UnicodeDecodeError and UnicodeEncodeError throughout that FAQ so that search engines can find it? Regardless, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants