jbrodriguez / unbalance

Go/React/Tailwind app to move folders/files between Unraid disks
MIT License
183 stars 12 forks source link

doens't handle folders with $ in the name properly #80

Open chicknwinner opened 8 months ago

chicknwinner commented 8 months ago

folder is not removed

2024/02/09 19:56:20 running Move operation ...

2024/02/09 19:56:20 command started: (src: /mnt/disk3) rsync -avPR -X "tree/torrents/music/Ty Dolla $ign - Campaign (WEB - FLAC)[2016]" "/mnt/disk1/"

2024/02/09 19:56:21 command:retcode(0):exitcode(0)

2024/02/09 19:56:21 Command Finished

2024/02/09 19:56:21 Current progress: 76.88% done ~ 0s left (0.00 MB/s)

2024/02/09 19:56:21 removing:(rm -rf "/mnt/disk3/tree/torrents/music/Ty Dolla $ign - Campaign (WEB - FLAC)[2016]")

2024/02/09 19:56:21 command started: (src: /mnt/disk3) rsync -avPR -X "tree/torrents/music/Ty Dolla $ign - Campaign (2016) [V0]" "/mnt/disk1/"

2024/02/09 19:56:21 command:retcode(0):exitcode(0)

2024/02/09 19:56:21 Command Finished

2024/02/09 19:56:21 Current progress: 100.00% done ~ 0s left (0.00 MB/s)

2024/02/09 19:56:21 removing:(rm -rf "/mnt/disk3/tree/torrents/music/Ty Dolla $ign - Campaign (2016) [V0]")

2024/02/09 19:56:21

unbalanced - MOVE operation completed
jbrodriguez commented 8 months ago

that's interesting, so you think it has to do with the $ sign ? have you tried the command on the command line (on a copy of your file) ?

KiTTYsh commented 5 months ago

Also having this issue, plus a related UI error... Release: 2024.03.26 installed from Community Apps

Planning started
Scanning music/Curren$y on /mnt/disk1
Checking issues ...
Getting items ...
Scanning music/Curren$y on /mnt/disk2
Checking issues ...
Getting items ...
Scanning music/Curren$y on /mnt/disk3
Checking issues ...
Getting items ...
Scanning music/Curren$y on /mnt/disk4
Checking issues ...
Getting items ...
Scanning music/Curren$y on /mnt/disk5
Checking issues ...
Getting items ...
Scanning music/Curren$y on /mnt/disk6
Checking issues ...
Getting items ...
Scanning music/Curren$y on /mnt/disk7
Checking issues ...
Getting items ...
Scanning music/Curren$y on /mnt/apps
Checking issues ...
Getting items ...
Scanning music/Curren$y on /mnt/cache
Checking issues ...
Getting items ...
Trying to allocate items to disk1 ...
Trying to allocate items to disk2 ...
Trying to allocate items to disk3 ...
Trying to allocate items to disk4 ...
Trying to allocate items to disk5 ...
Trying to allocate items to disk6 ...
Trying to allocate items to disk7 ...
Trying to allocate items to apps ...
Trying to allocate items to cache ...
Ended: Apr 16, 2024 19:36:25
Elapsed: 7.657571ms
Planning Ended

After planning stage is complete, target data-moved sizes show as 0, despite also having the star to identify that the folder exists on those devices: image

Attempting to click on a device to see items covers the page in the following error:

Unexpected Application Error!
n.items is null

I1@http://server:7090/assets/index-d19XgG5A.js:124:81609
tf@http://server:7090/assets/index-d19XgG5A.js:38:19519
zu@http://server:7090/assets/index-d19XgG5A.js:40:3139
Hg@http://server:7090/assets/index-d19XgG5A.js:40:44737
Fg@http://server:7090/assets/index-d19XgG5A.js:40:39729
v2@http://server:7090/assets/index-d19XgG5A.js:40:39657
tl@http://server:7090/assets/index-d19XgG5A.js:40:39508
Yu@http://server:7090/assets/index-d19XgG5A.js:40:35875
gh@http://server:7090/assets/index-d19XgG5A.js:40:36678
hr@http://server:7090/assets/index-d19XgG5A.js:38:3274
gt/<@http://server:7090/assets/index-d19XgG5A.js:40:34207

There's also definitely data in there:

root@server:/mnt/disk3/music# du -hs Curren\$y/
5.8G    Curren$y/
root@server:/mnt/disk3/music# find Curren\$y/ | wc -l
329

Hypothesis

Taking a bit of a guess here, but I might think that whatever way unbalanced is firing off shell commands, it's interpreting the $ as the start of an environment variable, which will evaluate to an empty string in most cases. This hunch seems to be confirmed by creating a folder with contents named music/Curren (no $y), in which case unbalanced will start evaluating data for that folder when instructed to operate on music/Curren$y.

jbrodriguez commented 5 months ago

Taking a bit of a guess here, but I might think that whatever way unbalanced is firing off shell commands, it's interpreting the $ as the start of an environment variable

ooooh, that makes a lot of sense !!!

i will check in this direction