Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload from app fail #328

Open
qbicus opened this issue Mar 29, 2024 · 17 comments
Open

Upload from app fail #328

qbicus opened this issue Mar 29, 2024 · 17 comments

Comments

@qbicus
Copy link

qbicus commented Mar 29, 2024

For every image that is upoloaded after the 1.99 release I get in the log file the following:

[Nest] 247  - 03/29/2024, 8:50:46 PM   ERROR [Error: EPERM: operation not permitted, utime '/photos/upload/c0ec343e-cbe3-4fe1-8402-f957e419a04c/e7/ce/e7ce631c-b3cb-4d7f-adb3-fb7efbd09197.jpg'] Error uploading file Error: EPERM: operation not permitted, utime '/photos/upload/c0ec343e-cbe3-4fe1-8402-f957e419a04c/e7/ce/e7ce631c-b3cb-4d7f-adb3-fb7efbd09197.jpg'
[Nest] 247  - 03/29/2024, 8:50:46 PM   ERROR [Error: EPERM: operation not permitted, utime '/photos/upload/c0ec343e-cbe3-4fe1-8402-f957e419a04c/e7/ce/e7ce631c-b3cb-4d7f-adb3-fb7efbd09197.jpg'] Failed to upload file
[Nest] 247  - 03/29/2024, 8:50:46 PM   ERROR [Error: EPERM: operation not permitted, utime '/photos/upload/c0ec343e-cbe3-4fe1-8402-f957e419a04c/e7/ce/e7ce631c-b3cb-4d7f-adb3-fb7efbd09197.jpg'] Error: EPERM: operation not permitted, utime '/photos/upload/c0ec343e-cbe3-4fe1-8402-f957e419a04c/e7/ce/e7ce631c-b3cb-4d7f-adb3-fb7efbd09197.jpg'

The image appears in the webinterface but it is broken.

@hydazz
Copy link
Member

hydazz commented Mar 30, 2024

is /photos mounted to a smb or other network storage on the host? or is it a normal filesystem mount?

@qbicus
Copy link
Author

qbicus commented Mar 30, 2024

/photos was always mounted as smb. It worked flawlessly before the update so I am at a loss. all that was done was pull the new image and in Postgre install the vectors thingy

@hydazz
Copy link
Member

hydazz commented Apr 2, 2024

[Error: EPERM: operation not permitted is a permission issue, ensure that /photos/upload/c0ec343e-cbe3-4fe1-8402-f957e419a04c/e7/ce/e7ce631c-b3cb-4d7f-adb3-fb7efbd09197.jpg (or the parent directories) are indeed owned by the desired user, perhaps the UID changed...

what does docker exec immich s6-setuidgid abc ls -la /photos/upload/c0ec343e-cbe3-4fe1-8402-f957e419a04c/e7/ce/e7ce631c-b3cb-4d7f-adb3-fb7efbd09197.jpg show?

@hydazz
Copy link
Member

hydazz commented Apr 10, 2024

success?

@someonewating
Copy link

someonewating commented Apr 14, 2024

Hi @hydazz , thank you for your attention first.

I have the exactly same issue. Just updated my postgredb, and then encountered this issue.

my /photo is mounted via smb as well, the permission is:

total 4.0K
drwxrwxrwx 2 root root    0 Aug 26  2023 .
drwxr-xr-x 1 root root 4.0K Apr 14 10:23 ..
drwxrwxrwx 2 root root    0 Sep 11  2023 encoded-video
drwxrwxrwx 2 root root    0 Sep 11  2023 library
drwxrwxrwx 2 root root    0 Sep 11  2023 log
drwxrwxrwx 2 root root    0 Sep 11  2023 machine-learning
drwxrwxrwx 2 root root    0 Sep 11  2023 redis
drwxrwxrwx 2 root root    0 Nov  6 22:05 .reverse-geocoding-dump
drwxrwxrwx 2 root root    0 Sep 11  2023 thumbs
drwxrwxrwx 2 root root    0 Sep 11  2023 typesense
drwxrwxrwx 2 root root    0 Sep 11  2023 upload

my error message is: [Nest] 522 - 04/14/2024, 10:24:52 AM ERROR [Error: EPERM: operation not permitted, utime '/photos/upload/3129b451-c047-4eda-8fd2-d1ed2c4f34a6/18/d1/18d149fd-0804-4ef8-8bb2-907fe579a731.jpg'] Error: EPERM: operation not permitted, utime '/photos/upload/3129b451-c047-4eda-8fd2-d1ed2c4f34a6/18/d1/18d149fd-0804-4ef8-8bb2-907fe579a731.jpg'

however if I run ls -ahl /photos/upload/3129b451-c047-4eda-8fd2-d1ed2c4f34a6/18/d1/18d149fd-0804-4ef8-8bb2-907fe579a731.jpg, I will get ls: cannot access '/photos/upload/3129b451-c047-4eda-8fd2-d1ed2c4f34a6/18/d1/18d149fd-0804-4ef8-8bb2-907fe579a731.jpg': No such file or directory.

For a long time I used environment variable in my docker compose file: PUID=1000 and PGID=1000 , but this is the first time I saw this error.

I also tried find / -name 18d149fd-0804-4ef8-8bb2-907fe579a731.jpg, but that file cannot even be found.

Not sure what is wrong now, I tried to log into the container and tried to create/remove files, and it works well. Looks like only the npm is unable to create files. The immich is able to show the image properly so I think it has read access.

Please kindly let me know your thoughts. Thank you in advance!

@hydazz
Copy link
Member

hydazz commented Apr 14, 2024

is this share mounted via fstab?

@someonewating
Copy link

I think no, as the output of cat /etc/fstab is empty.

Actually the immich and the storage are running on Azure Container App and Azure Storage Account, so I'm not sure how the storage has been mounted.

@hydazz
Copy link
Member

hydazz commented Apr 14, 2024

Does Azure allow you to change the permissions of the mount?

@someonewating
Copy link

Well it should be possible. may I know what permission I need to change?

@hydazz
Copy link
Member

hydazz commented Apr 14, 2024

The mounts should be mounted so that the owner is 1000 (whoever this maps to on the azure host), which you don't have access to, perhaps just set PUID and PGID to 0 if its not possible

you could also try chown -R abc:abc /photos?

@someonewating
Copy link

Thank you @hydazz , my issue has been resolved by changing PUID and PGUID to 0, which represents root user.

@someonewating
Copy link

someonewating commented Apr 14, 2024

Just another comment for users who using Azure Container APP and Azure Storage Account to run Immich. This version of Immich will take more time to start up, the default setting of the startup probe will treat the container as unhealthy, so the Initial delay seconds has to be increased.

@qbicus
Copy link
Author

qbicus commented Apr 16, 2024

In my case the permissions were fine as it worked without an issue till I did an update of the image (pull the latest etc). I solved it by saving all the images in a separate folder, deleting the old stack and re-creating everything from 0 and this time used the postgresql inside the image and not my separate one (I have a separate postgre that I used for other projects as well). Reimported the external library and now works.

Nothing changed in the mount/permissions etc

@goekhanm
Copy link

goekhanm commented Jun 12, 2024

Hi,
have the same problem here.
Immich, Redis and Postgres are in separated containers. Running the setup on the latest unraid. The photo-library is stored on an external USB-Storage. Library is mounted with the unraid-option "read/write -slave".

@qbicus

"postgresql inside the image"

Which Image do you use? Couldn't find an Immich-Image including Postgres.

@qbicus
Copy link
Author

qbicus commented Jun 13, 2024

Sorry wrong choice of words. I meant the docker compose file contains a postgresql container. In my previous set-up I had a separate VM that handled all my database requirements (postgresql, mysql with several versions). I think the problem was in the pgvectors extensions that was different than the newly required one.

@goekhanm
Copy link

@qbicus Thanks for clearing that up

@goekhanm
Copy link

Quick Update: I solved my problem by using the official unraid setup for immich via docker compose manager: https://immich.app/docs/install/unraid/
I hope it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants