Scan fails on symlinked zip file: not a valid zip file
Describe the bug When I symlink a zip file into one of my Stash library directories and do a scan, it is not integrated into the library as a gallery. When you look at the logs, you see a "not a valid zip file" error logged.
Copying the same zip file into the Stash library at the same location and scanning works correctly.
To Reproduce Steps to reproduce the behavior:
- Symlink a zip file into one of the active library directories enabled for images
- Go to Setttings->Tasks, and select Scan
- Go to Settings->Logs, and observe that zip file scan resulted in "not a valid zip file" error
Error scanning zip file "XXXXX.zip": zip: not a valid zip file
Expected behavior Zip file integrated into Stash library as gallery
Stash Version: (from Settings -> About): 0.22.1
Desktop (please complete the following information):
- OS: macOS
- Browser: Safari
- Version: 17.0
As far as I know, symlinks are just a link to another location, if that location it's outside your library folders, I don't think stash will be able to index it. You probably should use a hard link instead, wich is more like a mirror.
Same problem on Debian with zip files in symlinks not working with Stash (get error message - not valid zip file while scanning, same file work well when not symlinkes).
Current tested/working hack to resolve this - mount directory with Samba set to resolve symlinks.
Proper fix will be much appreciated!
I've managed to reproduce this. It's a bit of an involved fix, so I likely won't fit it into a 0.26.x bugfix.