I
Immichβ€’2mo ago
Phasedragon

File storage not connected to NAS

I'm trying to set up immich so that the docker container is running on one device (proxmox ubuntu server docker environment) with the uploaded user files stored on my NAS (truenas SMB share). Despite my best efforts, immich's storage space readout is behaving as if the upload files are going to the limited storage space of the docker environment, not the NAS. From a search of common issues, this sounds like it's a simple misconfiguration of the network share, however I'm confused by this because I can't find what's wrong with it. I even have other docker containers like jellyfin utilizing the network share without any issue. I have the SMB share mounted with /etc/fstab like this:
//10.0.0.94/Docker-Files /media/TRUENAS/Docker-Files cifs credentials=/home/.smb,vers=3.0,noperm 0 0
//10.0.0.94/Docker-Files /media/TRUENAS/Docker-Files cifs credentials=/home/.smb,vers=3.0,noperm 0 0
and I have set the immich .env file like so, ensuring that I'm only changing the upload location not database location as recommended:
# The location where your uploaded files are stored
UPLOAD_LOCATION=/media/TRUENAS/Docker-Files/immich/library

# The location where your database files are stored. Network shares are not supported for the database
DB_DATA_LOCATION=./postgres
# The location where your uploaded files are stored
UPLOAD_LOCATION=/media/TRUENAS/Docker-Files/immich/library

# The location where your database files are stored. Network shares are not supported for the database
DB_DATA_LOCATION=./postgres
results of running df -h appears to confirm that /media/TRUENAS/Docker-Files is correctly mounted:
root@hl-ubuntu:/media/TRUENAS/Docker-Files/immich/library# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 3.2G 8.5M 3.2G 1% /run
efivarfs 256K 219K 33K 88% /sys/firmware/efi/efivars
/dev/mapper/ubuntu--vg-ubuntu--lv 76G 68G 4.8G 94% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 2.0G 193M 1.6G 11% /boot
/dev/sda1 1.1G 6.2M 1.1G 1% /boot/efi
//10.0.0.94/Docker-Files 1.8T 54G 1.8T 3% /media/TRUENAS/Docker-Files
//10.0.0.94/Shared-Files 4.6T 2.9T 1.8T 63% /media/TRUENAS/Shared-Files
root@hl-ubuntu:/media/TRUENAS/Docker-Files/immich/library# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 3.2G 8.5M 3.2G 1% /run
efivarfs 256K 219K 33K 88% /sys/firmware/efi/efivars
/dev/mapper/ubuntu--vg-ubuntu--lv 76G 68G 4.8G 94% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 2.0G 193M 1.6G 11% /boot
/dev/sda1 1.1G 6.2M 1.1G 1% /boot/efi
//10.0.0.94/Docker-Files 1.8T 54G 1.8T 3% /media/TRUENAS/Docker-Files
//10.0.0.94/Shared-Files 4.6T 2.9T 1.8T 63% /media/TRUENAS/Shared-Files
No description
No description
56 Replies
Immich
Immichβ€’2mo ago
:wave: Hey @Phasedragon, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time). 2. :ballot_box_with_check: read applicable release notes. 3. :ballot_box_with_check: reviewed the FAQs for known issues. 4. :ballot_box_with_check: reviewed Github for known issues. 5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy). 6. :ballot_box_with_check: uploaded the relevant information (see below). 7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed.
Phasedragon
PhasedragonOPβ€’2mo ago
compose (unmodified from latest release)
#
# WARNING: To install Immich, follow our guide: https://immich.app/docs/install/docker-compose
#
# Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.

name: immich
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
# extends:
# file: hwaccel.transcoding.yml
# service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
- ${UPLOAD_LOCATION}:/data
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- 2283:2283
depends_on:
- redis
- database
restart: always
healthcheck:
disable: false
immich-machine-learning:
container_name: immich_machine_learning
# For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
# Example tag: ${IMMICH_VERSION:-release}-cuda
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
# extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
# file: hwaccel.ml.yml
# service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
healthcheck:
disable: false
redis:
container_name: immich_redis
image: docker.io/valkey/valkey:8-bookworm@sha256:a137a2b60aca1a75130022d6bb96af423fefae4eb55faf395732db3544803280
healthcheck:
test: redis-cli ping || exit 1
restart: always
database:
container_name: immich_postgres
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: --data-checksums
# Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs
# DB_STORAGE_TYPE: 'HDD'
volumes:
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
shm_size: 128mb
restart: always
volumes:
model-cache: null
#
# WARNING: To install Immich, follow our guide: https://immich.app/docs/install/docker-compose
#
# Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.

name: immich
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
# extends:
# file: hwaccel.transcoding.yml
# service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
- ${UPLOAD_LOCATION}:/data
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- 2283:2283
depends_on:
- redis
- database
restart: always
healthcheck:
disable: false
immich-machine-learning:
container_name: immich_machine_learning
# For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
# Example tag: ${IMMICH_VERSION:-release}-cuda
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
# extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
# file: hwaccel.ml.yml
# service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
healthcheck:
disable: false
redis:
container_name: immich_redis
image: docker.io/valkey/valkey:8-bookworm@sha256:a137a2b60aca1a75130022d6bb96af423fefae4eb55faf395732db3544803280
healthcheck:
test: redis-cli ping || exit 1
restart: always
database:
container_name: immich_postgres
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: --data-checksums
# Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs
# DB_STORAGE_TYPE: 'HDD'
volumes:
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
shm_size: 128mb
restart: always
volumes:
model-cache: null
.env (only changed UPLOAD_LOCATION and DB_PASSWORD)
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/media/TRUENAS/Docker-Files/immich/library

# The location where your database files are stored. Network shares are not supported for the database
DB_DATA_LOCATION=./postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=redacted

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/media/TRUENAS/Docker-Files/immich/library

# The location where your database files are stored. Network shares are not supported for the database
DB_DATA_LOCATION=./postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=redacted

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
Zeus
Zeusβ€’2mo ago
The mount needs to be active before immich starts up. That probably isn’t happening
Phasedragon
PhasedragonOPβ€’2mo ago
I can cd into the share and see that the files I expect to see are there, unless you mean something else by 'active'?
Zeus
Zeusβ€’2mo ago
That needs to be the case before immich is started though Not just right now
Phasedragon
PhasedragonOPβ€’2mo ago
I've tried recreating the immich container multiple times from scratch since then (plus deleting the Docker-Files/immich/library folder)
Immich
Immichβ€’2mo ago
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
Mraedis
Mraedisβ€’2mo ago
How did you do this
Phasedragon
PhasedragonOPβ€’2mo ago
I'm deploying docker containers from dockge, so deleting the dockge entry which contains the compose and env. Then using ssh to delete the associated folders
Mraedis
Mraedisβ€’2mo ago
You need to prune the images as well if the mount was broken before
Phasedragon
PhasedragonOPβ€’2mo ago
huh, why would the image hold onto anything relevant?
Mraedis
Mraedisβ€’2mo ago
Because you were writing inside the image
Phasedragon
PhasedragonOPβ€’2mo ago
trying anyway, just curious :confused2: That's not how I thought docker worked, huh
Mraedis
Mraedisβ€’2mo ago
It's not how you're supposed to use it, no any update will wipe the changes of course
Phasedragon
PhasedragonOPβ€’2mo ago
is there something I did wrong to make it write inside the image?
Mraedis
Mraedisβ€’2mo ago
wrong would be like Zeus said, the mount was not ready before docker started We can check this with just an image prune and restart πŸ™‚
Phasedragon
PhasedragonOPβ€’2mo ago
no change
Mraedis
Mraedisβ€’2mo ago
could you post the output of docker inspect immich_server ? feel free to anonymize the password
Phasedragon
PhasedragonOPβ€’2mo ago
Mraedis
Mraedisβ€’2mo ago
Alright and if you ls -la /media/TRUENAS/Docker-Files/immich/library is that empty or what does it show?
Phasedragon
PhasedragonOPβ€’2mo ago
total 0 drwxr-xr-x 2 root root 0 Aug 25 07:30 . drwxr-xr-x 2 root root 0 Aug 25 07:30 ..
Mraedis
Mraedisβ€’2mo ago
So docker thinks it's mounted but it's not Which would point at a permissions issue
Phasedragon
PhasedragonOPβ€’2mo ago
ok, I'm pretty sure this user has all the permissions on the network share, so it would be a local permission issue?
No description
Mraedis
Mraedisβ€’2mo ago
I really can't say, network mounts and docker are always funky πŸ‘€
Phasedragon
PhasedragonOPβ€’2mo ago
would you have a better suggestion for doing the compute on one device and storage on the other? Or would you find a different arrangement?
Mraedis
Mraedisβ€’2mo ago
One thing you could try is mounting the share directly through the compose in CIFS
Phasedragon
PhasedragonOPβ€’2mo ago
oh, I'm not familiar with that sounds nice though
Mraedis
Mraedisβ€’2mo ago
You would add a volume at the bottom:
volumes:
model-cache:
immich_data:
driver_opts:
type: cifs
o: "credentials=/home/.smb,vers=3.0,noperm 0 0"
device: "//10.0.0.94/Docker-Files/immich/library"
volumes:
model-cache:
immich_data:
driver_opts:
type: cifs
o: "credentials=/home/.smb,vers=3.0,noperm 0 0"
device: "//10.0.0.94/Docker-Files/immich/library"
And for the immich_server container instead of
volumes:
- ${UPLOAD_LOCATION}:/data
- /etc/localtime:/etc/localtime:ro
volumes:
- ${UPLOAD_LOCATION}:/data
- /etc/localtime:/etc/localtime:ro
You'd do
volumes:
- immich_data:/data
- /etc/localtime:/etc/localtime:ro
volumes:
- immich_data:/data
- /etc/localtime:/etc/localtime:ro
the o section of the volume might need tweaking, I'm not 100% sure on that
Phasedragon
PhasedragonOPβ€’2mo ago
yeah, something about it that it doesn't like. Having trouble finding any documentation or example of this though
`Error response from daemon: error while mounting volume '/var/lib/docker/volumes/immich_immich_data/_data': failed to mount local volume: mount //10.0.0.94/Docker-Files/immich/library:/var/lib/docker/volumes/immich_immich_data/_data, data: credentials=/home/.smb,vers=3.0,noperm 0 0: invalid argument
`Error response from daemon: error while mounting volume '/var/lib/docker/volumes/immich_immich_data/_data': failed to mount local volume: mount //10.0.0.94/Docker-Files/immich/library:/var/lib/docker/volumes/immich_immich_data/_data, data: credentials=/home/.smb,vers=3.0,noperm 0 0: invalid argument
Mraedis
Mraedisβ€’2mo ago
it's probably the 0 0 πŸ˜… remove those
Phasedragon
PhasedragonOPβ€’2mo ago
ah that's exactly what I was just trying but I'm having trouble getting it to listen to the change after changing this compose, what should I do besides docker down and docker compose up? Something about this is more stubborn to hold onto the old compose than usual
Mraedis
Mraedisβ€’2mo ago
you should only need to do compose up, is it still complaining about invalid argument?
Phasedragon
PhasedragonOPβ€’2mo ago
it's still trying to use the old compose, so same error with same 0 0 despite the new compose not having that
Mraedis
Mraedisβ€’2mo ago
Are you sure you saved the file? πŸ™ƒ and are you doing docker down or docker compose down
Phasedragon
PhasedragonOPβ€’2mo ago
yes certain, confirmed across different editors docker down at first, also tried docker compose down now
Phasedragon
PhasedragonOPβ€’2mo ago
and dockge is stuck like this, without the ability to confirm because it's a read-only terminal :noooo:
No description
Mraedis
Mraedisβ€’2mo ago
ah... :p you could try deleting the volume?
Phasedragon
PhasedragonOPβ€’2mo ago
trying is it not docker rm? removing the stack folder and docker rm doesn't seem to clean it up all the way, something is left over
Mraedis
Mraedisβ€’2mo ago
it's a persistent volume you need to explicitely delete it from the volumes I don't know how that works in dockge
Phasedragon
PhasedragonOPβ€’2mo ago
dockge is just a light gui on top of compose, doesn't get in the way of doing terminal work. How would you do it by terminal?
Mraedis
Mraedisβ€’2mo ago
docker volume rm
Phasedragon
PhasedragonOPβ€’2mo ago
ahh that's what I was missing - stopped all immich containers - removed all immich containers - removed all immich volumes - pruned images - removed folder with compose and env I think that's a clean slate now?
Mraedis
Mraedisβ€’2mo ago
as clean as can be
Phasedragon
PhasedragonOPβ€’2mo ago
howw
No description
Phasedragon
PhasedragonOPβ€’2mo ago
ok, trying this without dockge
Phasedragon
PhasedragonOPβ€’2mo ago
ok different error, that's progress
No description
Phasedragon
PhasedragonOPβ€’2mo ago
ohh I don't think the user running docker has access to /home/.smb I'll copy the .smb over into /opt
Phasedragon
PhasedragonOPβ€’2mo ago
hm that wasn't it
No description
Mraedis
Mraedisβ€’2mo ago
I guess it kind of was but this would be a new permissions error? πŸ˜› Try adding file_mode=0777,dir_mode=0777 to the o list @Phasedragon
Phasedragon
PhasedragonOPβ€’2mo ago
same response
No description
Phasedragon
PhasedragonOPβ€’2mo ago
so hard to tell where the permission denied is coming from
Mraedis
Mraedisβ€’2mo ago
not sure you can mix noprem and dir/file mode πŸ™ƒ
Phasedragon
PhasedragonOPβ€’2mo ago
I suppose that would make sense
Phasedragon
PhasedragonOPβ€’2mo ago
:Shrug:
No description
Mraedis
Mraedisβ€’2mo ago
Well I'm somewhat out of ideas here
Phasedragon
PhasedragonOPβ€’2mo ago
thanks for trying! At least I learned a few new things

Did you find this page helpful?