photoview / photoview

Photo gallery for self-hosted personal servers
https://photoview.github.io/
GNU Affero General Public License v3.0
4.8k stars 363 forks source link

Cannot scan photos, and permission error is raised. #695

Open vanillapod-ze opened 2 years ago

vanillapod-ze commented 2 years ago

Describe the bug Images cannot be scanned, when clicked settings/users/scan, nothing changed until clicking Scan all users, it raised permission denied error.

Something went wrong Server error: failed to add user for scanning (6): find albums for user (user_id: 6): read directory (/photos): open /photos: permission denied at (scanAll)

To Reproduce Steps to reproduce the behavior:

  1. vim docker-compose.yml, replace - ./photos_path:/photos:ro with- ./photos:/photos
  2. move my photos into ./photos
  3. restart docker with docker-compose down && docker-compose up -d
  4. visit the web site
  5. click settings/users/scan and Scan all users button

Expected behavior Albums is empty but ./photo is not. Permission denied error was raised, but user photoview do have admin permission.

Screenshots Browser image

Running docker-compose logs image

Your environment: Feel free to remove and add what you think might be useful.

Additional context I don't understand why, shouldn't I put my photos into ./photos ? I tried to remove :ro flag, but found /photos is still Read-only by running docker exec -it photoview_photoview_1 /bin/bash.

There are some files in ./photos image

But albums is empty image

vanillapod-ze commented 2 years ago

btw, I am running docker under Silverblue F36, and run a clean photoview, the auto-gen-folder photos_path is owned by root instead of current user, is it right?

[cp@fedora photoview]$ stat -c "%U %G"  photos_path/
root root

On my operations above, I have already change the folder's owner to my username before moving my photos into photoview/photos

cloo commented 2 years ago

Same problem here. No docker, Yunohost installation, nextcloud folder.

kkovaletp commented 3 weeks ago

@vanillapod-ze , thanks for your report. To me, it looks like an issue with file permissions on the host and some incompatibility with mounting to docker.

Anyway, we've done a big refactoring of the docker image and compose file. So, please try the config from the master branch and use the photoview:master image with it. I think that this issue should be fixed there.

Please let me know the results. If no response is provided soon, this issue will be closed as not planned, because it doesn't look like we still have this issue in the product.