Photos not auto-uploading from Android for past few weeks.
For the past few weeks, the Android app cannot upload photos until I restart the docker container. Once I do, it uploads immediately.
The log makes it sound like a folder permission issue, but then why does that issue go away once I restart the container? I haven't changed anything and the auto-upload has worked perfectly for months and months - ever since I installed Immich really.
Here are the errors from the log. A string of these will pop up for each photo to be uploaded:
02/10/2024 08:15:07 AM
[Nest] 217 - 02/10/2024, 8:15:07 AM ERROR [Error: EACCES: permission denied, mkdir '/photos/upload/193f65c5-f33b-4521-9cc7-b0e9de67b155/e6/3c'
02/10/2024 08:15:07 AM
at mkdirSync (node:fs:1380:26)
02/10/2024 08:15:07 AM
at FilesystemProvider.mkdirSync (/app/immich/server/dist/infra/repositories/filesystem.provider.js:115:32)
02/10/2024 08:15:07 AM
at AssetService.getUploadFolder (/app/immich/server/dist/domain/asset/asset.service.js:121:32)
02/10/2024 08:15:07 AM
at /app/immich/server/dist/immich/interceptors/file-upload.interceptor.js:122:52
02/10/2024 08:15:07 AM
at callbackify (/app/immich/server/dist/immich/interceptors/file-upload.interceptor.js:62:37)
02/10/2024 08:15:07 AM
at FileUploadInterceptor.destination (/app/immich/server/dist/immich/interceptors/file-upload.interceptor.js:122:16)
02/10/2024 08:15:07 AM
at DiskStorage._handleFile (/app/immich/server/node_modules/multer/storage/disk.js:31:8)
02/10/2024 08:15:07 AM
at FileUploadInterceptor.handleFile (/app/immich/server/dist/immich/interceptors/file-upload.interceptor.js:132:29)
02/10/2024 08:15:07 AM
at /app/immich/server/node_modules/multer/lib/make-middleware.js:137:17
02/10/2024 08:15:07 AM
at callbackify (/app/immich/server/dist/immich/interceptors/file-upload.interceptor.js:62:16)] Error: EACCES: permission denied, mkdir '/photos/upload/193f65c5-f33b-4521-9cc7-b0e9de67b155/e6/3c'
Have you changed the folder permissions?
No. And, as I said, even if I did, it works after a container restart. It repeats. I take some photos, they fail to upload. I restart the container, they upload. The next day, I take some photos, they won't upload - rinse and repeat.
If I restart the container right now, it'll upload no problem.
The permissions on the folders say the owner is UNKNOWN and the permissions are "drwxr-xr-x"
These are the permissions for the folders as created by Immich.
Can you try with to execute chown -R nobody:users /mnt/photos where /mnt/photos is the folder mounted to /photos ?
That seems to have unclogged it. So, it should be set to nobody as the owner? Any idea why or how it got set to be unknown? Or, if it's set to UNKNOWN, why it would still work after a restart of the container? I feel like there's something going on here that caused this. Wondering if it's going to pop back up again.
I don't know if this matters, but the container is set for the PUID to be 99, the PGID 100, and the UMASK is 022. Is that all correct?
I think, somehow, you changed one of the folder permissions. nobody:users are the default permissions for the default uid and guid, no need to change that
Weird. No idea how that would have happened. I was thinking maybe the LuckyBackup profile I have running to back up the Immich folder may be doing something (although I don't know why it would), but it's run every night since and the nobody permissions have stayed the same. The auto-backup is running perfectly again as well.
I don't like it when I don't know why something happened, but I'm also glad this was an easy fix! :-)
Thanks!