trapexit / mergerfs-tools

Optional tools to help manage data in a mergerfs pool
ISC License
372 stars 42 forks source link

Mergerfs.ctl mangles paths with escaped characters #113

Closed Devonavar closed 3 years ago

Devonavar commented 3 years ago

This may be an upstream bug, but I'm reporting it here first and I'll send it upstream to Python if necessary.

Symptom: script crashes on execution while finding mergerfs mountpoint that is mounted in a directory containing a space (and, presumably, other escaped characters). Script appears to be trying to escape the backslashes in path that denote escaped characters.

Traceback: Traceback (most recent call last): File "./mergerfs.ctl", line 275, in <module> main() File "./mergerfs.ctl", line 267, in main args.func(fspaths,args) File "./mergerfs.ctl", line 246, in cmd_info print_mergerfs_info(fspaths) File "./mergerfs.ctl", line 100, in print_mergerfs_info version = os.getxattr(ctrlfile,'user.mergerfs.version') FileNotFoundError: [Errno 2] No such file or directory: '/media/The\\040Hands\\040that\\040Feed\\040Us/.mergerfs'

/etc/fstab # MergerFS Pool /media/THTFU?/ /media/The\040Hands\040that\040Feed\040Us fuse.mergerfs defaults,allow_other,fsname=The\040Hands\040that\040Feed\040Us,dropcacheonclose=true,moveonenospc=true,ignorepponrename=true,minfreespace=20G,category.create=lfs,use_ino,x-systemd.requires=/media/THTFU1,x-systemd.requires=/media/THTFU2,x-systemd.requires=/media/THTFU3,x-systemd.requires=/media/THTFU4,x-systemd.requires=/media/THTFU5,x-systemd.requires=/media/THTFU6,x-systemd.requires=/media/THTFU7 0 2

/proc/self/mountinfo 153 29 0:49 / /media/The\040Hands\040that\040Feed\040Us rw,relatime shared:127 - fuse.mergerfs The\040Hands\040that\040Feed\040Us rw,user_id=0,group_id=0,default_permissions,allow_other

The path appears to be coming directly from /proc/self/mountinfo via Python's native fileparsing tools; the only processing appears to be split(), so somewhere in that processing an extra backslash is being added where it doesn't belong.

trapexit commented 3 years ago

There is nothing wrong upstream. It's just that /proc/self/mountinfo is showing the literal escape. I would need to have python unescape it.

trapexit commented 3 years ago

114 should fix it.

Devonavar commented 3 years ago

Confirmed working, thanks!

On 2021-01-30 10:19 a.m., trapexit wrote:

Closed #113 https://github.com/trapexit/mergerfs-tools/issues/113.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/trapexit/mergerfs-tools/issues/113#event-4269421067, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKJYIHPBECXVFVR77LGKTDS4RESXANCNFSM4WZUFSOA.