alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.57k stars 224 forks source link

Immich | Data location on networkshare permission denied #1341

Closed Breakingx closed 7 months ago

Breakingx commented 7 months ago

Description

Data location on networkshare permission denied. What can I do to fix this? I want to save the photos on my network drive which I connected with home assistant

Config of the Add-On: DB_DATABASE_NAME: immich DB_HOSTNAME: homeassistant.local DB_PASSWORD: homeassistant DB_PORT: "5432" DB_USERNAME: postgres DISABLE_MACHINE_LEARNING: false JWT_SECRET: SECRET PGID: 1000 PUID: 1000 TZ: Europe/Berlin data_location: /media/NAS/photos/

Reproduction steps

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Addon Logs

`[Nest] 1126  - 04/09/2024, 11:25:48 AM   ERROR [Error: EACCES: permission denied, mkdir '/media/NAS/photos/upload/191974e7-d85f-498a-a436-4cb737395bce/26/5f'
    at mkdirSync (node:fs:1373:26)
    at StorageRepository.mkdirSync (/app/immich/server/dist/repositories/storage.repository.js:112:37)
    at AssetService.getUploadFolder (/app/immich/server/dist/services/asset.service.js:114:32)
    at /app/immich/server/dist/middleware/file-upload.interceptor.js:127:52
    at callbackify (/app/immich/server/dist/middleware/file-upload.interceptor.js:63:31)
    at FileUploadInterceptor.destination (/app/immich/server/dist/middleware/file-upload.interceptor.js:127:16)
    at DiskStorage._handleFile (/app/immich/server/node_modules/multer/storage/disk.js:31:8)
    at FileUploadInterceptor.handleFile (/app/immich/server/dist/middleware/file-upload.interceptor.js:137:29)
    at /app/immich/server/node_modules/multer/lib/make-middleware.js:137:17
    at callbackify (/app/immich/server/dist/middleware/file-upload.interceptor.js:63:16)] Error: EACCES: permission denied, mkdir '/media/NAS/photos/upload/191974e7-d85f-498a-a436-4cb737395bce/26/5f'`

Architecture

aarch64

OS

HAos

Breakingx commented 7 months ago

Supervisor log: 2024-04-09 13:25:01.379 ERROR (MainThread) [supervisor.docker.addon] Add-on Immich try to access to blocked device sdb1!

alexbelgium commented 7 months ago

Supervisor log: 2024-04-09 13:25:01.379 ERROR (MainThread) [supervisor.docker.addon] Add-on Immich try to access to blocked device sdb1!

Hi, this is not an issue it is just a routine message as the addon tries to check it's access in case users want to mount such drives. This message just means that there is no sdb1 device.

Regarding immich I haven't used it for a long time - does it allow setting puid/pgid to 0/0? It might be a solution, or correcting the ownership in the mounted drive? From the path (/media instead of /mnt) it seems you are using the embedded HA mount system instead of my own so i'm not sure how they handle permissions when mounting... Hope this helps?

github-actions[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

zd3sf commented 2 months ago

Hi @alexbelgium

I have the same problem and setting the puid/pgid to 0/0 did not help. I am using the embedded HA mount system (by going to HA settings>system>storage). I can't find any articles about allowing docker addons to access HA mounts. Any suggestions?

this is the log: Failed to write /media/4TB/HASS/immich/encoded-video/.immich: Error: EACCES: permission denied, open '/media/4TB/HASS/immich/encoded-video/.immich' [Nest] 2611 - 09/18/2024, 11:24:51 AM ERROR [Api:StorageService] The "encoded-video" folder cannot be written to, please make sure the volume is mounted with the correct permissions