pulsejet / memories

Fast, modern and advanced photo management suite. Runs as a Nextcloud app.
https://memories.gallery
GNU Affero General Public License v3.0
2.89k stars 77 forks source link

Timeline doesn't work with external storage #647

Open MuQ-dev opened 1 year ago

MuQ-dev commented 1 year ago

Describe the bug

I indexed my entire Nextcloud installation, and while setting the folder in memories to a folder mounted by external storage does work perfectly, meaning I can see the folders and photos, it doesn't work when setting the timeline root. It gives me this error: No valid root folder found (.nomedia?). I can confirm, that there is no .nomedia file in that folder. I confirmed that it was working with a normal local folder. Doing it with a normal folder was the only way to get started from the start screen, because setting the timeline root didn't do anything then, and does nothing in settings now.

To Reproduce Install Memories, index Set timeline folder to external storage folder

Platform:

pulsejet commented 1 year ago

1/ What's the name of the external storage? 2/ Where is it mounted? 3/ What does the "timeline path" in the settings look like?

pulsejet commented 1 year ago

Can you try placing the external storage in a "normal" folder, then set the timeline path to the outer folder?

MuQ-dev commented 1 year ago
  1. Bilder_Videos-Privat
  2. In the root folder of nextcloud
  3. //Bilder_Videos-Privat

I'll try putting it in a normal folder. Could be that memories gets confused when directly accessing this external share. Could also explain the double //

pulsejet commented 1 year ago

LMAO I accidentally edited your comment.

I'll try putting it in a normal folder. Could be that memories gets confused when directly accessing this external share. Could also explain the double //

That's normal. You likely hit a bug but not sure what's the best way to debug this. An identical scenario seems to work perfectly well for me.

MuQ-dev commented 1 year ago

Yeah no, putting the share in a folder doesn't change anything

pulsejet commented 1 year ago

You mean it still gives the same error? Can you try placing an image in the outer folder?

So if I understand right, it

  1. Works when pointing timeline root to Normal Folder
  2. Not work when pointing to External Storage
  3. Not work when pointing to Outer Folder with same error as above?
    Normal Folder
        Photo1
        Photo2
--->Outer Folder
        External Storage
        Photo3
MuQ-dev commented 1 year ago

Yes, the same error.

MuQ-dev commented 1 year ago

Placing an image while still mounting the share in that same folder doesn't work, and gives the same error. Interestingly, the Timeline view in the Folders Tab works perfectly.

pulsejet commented 1 year ago

Okay we need to do one more experiment.

  1. Set the timeline root to Normal Folder (now it works)
  2. Now move the external storage mount to Normal Folder (do not change anything in memories)
  3. What happens now?
pulsejet commented 1 year ago

Another thing to try: comment out the following line and restart the docker container

https://github.com/pulsejet/memories/blob/76dddf6a8b973421c8291b1c7b4da5bf378dd238/lib/Db/FsManager.php#L132

MuQ-dev commented 1 year ago

Ohhh wow that is weird. It's working now. (With first setting memories to an empty folder and then adding the external folder)

pulsejet commented 1 year ago

There's a chance that changing the name of the external storage might work then. E.g. if there's a space at the start or end then it won't work ...

MuQ-dev commented 1 year ago

Can't think of a reason why, but the only character that could be weird would be the _ "Bilder_Videos-Privat"

MuQ-dev commented 1 year ago

Yeah, it seem to be the underscore _ character. Any ideas of why? Underscores are not an uncommon character, especially in file naming.

gymnae commented 1 year ago

I've been using external local storage for some time now without hiccup (besides NC bugs in regards to automated tagging)

MuQ-dev commented 1 year ago

Well do you have a share containing an underscore in the root directory in nextcloud?

s4n-cz commented 1 year ago

For me the timeline works without any issues and I am using an underscore in the external storage name (NAS_photo). The external storage was configured from the admin interface and the type is SMB/CIFS. My timeline path currently consists of two folders, the first one is a local folder, the second one is the external storage - //Photos;//NAS_photo.

Versions: Nextcloud 26.0.1, Memories 5.1.0.

MuQ-dev commented 1 year ago

For me the timeline works without any issues and I am using an underscore in the external storage name (NAS_photo). The external storage was configured from the admin interface and the type is SMB/CIFS. My timeline path currently consists of two folders, the first one is a local folder, the second one is the external storage - //Photos;//NAS_photo.

Versions: Nextcloud 26.0.1, Memories 5.1.0.

Well the difference is that your folder with the underscore is in another local folder, not in the root of nextcloud.

pulsejet commented 1 year ago

I can't really pinpoint the issue here. Underscore is treated as any other character, so it shouldn't cause any issues. The only special character is space, only if the occurs at the start of end of the folder name.

MuQ-dev commented 1 year ago

I can't really pinpoint the issue here. Underscore is treated as any other character, so it shouldn't cause any issues. The only special character is space, only if the occurs at the start of end of the folder name.

I agree, it shouldn't. Yet, it works perfectly without the underscore, and not with it. Very weird...