UPLOAD_LOCATION folder on host doesn't contain Immich files

As in the title, the folder specified in UPLOAD_LOCATION env var seems to be ignored, as though it's not mounted. /usr/src/app/upload within the docker container does contain the files, but that is not reflected on the host system. I manually copied the contents from within docker to that location, but it is clear that it is still not 'connected'. I'd love some pointers as to where I might have gone wrong. Relevant config/terminal output: docker-compose.yml
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
...
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
...
.env
UPLOAD_LOCATION=/skyhawk/immich
...
UPLOAD_LOCATION=/skyhawk/immich
...
Exploring the contents of the docker container
$ sudo docker compose exec -it immich-server bash
root@4de1d68c4601:/usr/src/app# cd /usr/src/app/upload
root@4de1d68c4601:/usr/src/app/upload# ls
encoded-video immich library profile thumbs upload
$ sudo docker compose exec -it immich-server bash
root@4de1d68c4601:/usr/src/app# cd /usr/src/app/upload
root@4de1d68c4601:/usr/src/app/upload# ls
encoded-video immich library profile thumbs upload
External drive info
$ df
Filesystem 1K-blocks Used Available Use% Mounted on
...
skyhawk 3771083392 3519114240 251969152 94% /skyhawk
$ df
Filesystem 1K-blocks Used Available Use% Mounted on
...
skyhawk 3771083392 3519114240 251969152 94% /skyhawk
sudo docker system df running but is slow so pending results. Immich seems to pick up the right drive information in the UI: 3.3 TiB of 3.5 TiB used I previously had the env var mounted to a different path (which is a subfolder within my user directory and Immich would instead provide the disk usage of that drive (500gb, 80gb of which is Immich files). Using the path that the drive is actually mounted at did seem to fix the disk usage stats in the UI but hasn't otherwise fixed it. Anything obvious that I might have missed?
40 Replies
Immich
Immich4mo ago
:wave: Hey @Smilebags, 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. :blue_square: 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.
Tempest
Tempest4mo ago
Can you share the output of
cd /skyhawk/immich
ls
cd /skyhawk/immich
ls
Smilebags
SmilebagsOP4mo ago
It shows the standard folders because I just ran a docker cp a few hours ago.
$ cd /skyhawk/immich
/skyhawk/immich$ ls
encoded-video immich library profile thumbs upload
$ cd /skyhawk/immich
/skyhawk/immich$ ls
encoded-video immich library profile thumbs upload
Tempest
Tempest4mo ago
Did you change the env file before or after building the container? How are you planning on troubleshooting this then?
Smilebags
SmilebagsOP4mo ago
What I have confirmed is that adding a new file and navigating to the relevant path based on the files UUID shows that the necessary folder is missing. Until today, the folder was completely empty I docker compose down and docker compose up (without -d while debugging) after changing .env So I can see the server logs. I have tested whether it's permission related (by running the containers as a different user), it isn't, they're running as root, when running as another user, I get permission errors in the logs. I'm happy to change UPLOAD_LOCATION to a new path to help with debugging.
Tempest
Tempest4mo ago
Can you share your whole compose and env file? Feel free to scrub prostgres credentials
Tempest
Tempest4mo ago
When you run docker compose down, what's the output of docker ps before and after?
Smilebags
SmilebagsOP4mo ago
# 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=/skyhawk/immich
# The location where your database files are stored
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=************

# 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=***********

# 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=/skyhawk/immich
# The location where your database files are stored
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=************

# 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=***********

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
Before
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4de1d68c4601 ghcr.io/immich-app/immich-server:release "tini -- /bin/bash s…" 26 minutes ago Up 26 minutes (healthy) 0.0.0.0:2283->2283/tcp, :::2283->2283/tcp immich_server
3d3523068e52 ghcr.io/immich-app/immich-machine-learning:release "tini -- ./start.sh" 26 minutes ago Up 26 minutes (healthy) immich_machine_learning
daf9120c8931 tensorchord/pgvecto-rs:pg14-v0.2.0 "docker-entrypoint.s…" 2 hours ago Up 26 minutes (healthy) 5432/tcp immich_postgres
e5229b334949 redis:6.2-alpine "docker-entrypoint.s…" 2 hours ago Up 26 minutes (healthy) 6379/tcp immich_redis
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4de1d68c4601 ghcr.io/immich-app/immich-server:release "tini -- /bin/bash s…" 26 minutes ago Up 26 minutes (healthy) 0.0.0.0:2283->2283/tcp, :::2283->2283/tcp immich_server
3d3523068e52 ghcr.io/immich-app/immich-machine-learning:release "tini -- ./start.sh" 26 minutes ago Up 26 minutes (healthy) immich_machine_learning
daf9120c8931 tensorchord/pgvecto-rs:pg14-v0.2.0 "docker-entrypoint.s…" 2 hours ago Up 26 minutes (healthy) 5432/tcp immich_postgres
e5229b334949 redis:6.2-alpine "docker-entrypoint.s…" 2 hours ago Up 26 minutes (healthy) 6379/tcp immich_redis
After, empty (only contains unrelated containers)
Tempest
Tempest4mo ago
What about docker ps -a
Smilebags
SmilebagsOP4mo ago
Still after running down
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
856c4e5b6175 ghcr.io/immich-app/immich-server:release "tini -- /bin/bash b…" 2 hours ago Exited (126) 2 hours ago immich-immich-server-run-44999775e64a
9c71e9b18f1e ghcr.io/home-assistant/home-assistant:stable "/init" 7 weeks ago Up 7 weeks homeassistant

... a bunch of older ones
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
856c4e5b6175 ghcr.io/immich-app/immich-server:release "tini -- /bin/bash b…" 2 hours ago Exited (126) 2 hours ago immich-immich-server-run-44999775e64a
9c71e9b18f1e ghcr.io/home-assistant/home-assistant:stable "/init" 7 weeks ago Up 7 weeks homeassistant

... a bunch of older ones
Tempest
Tempest4mo ago
docker image prune When the container is stopped might be a good idea
Mraedis
Mraedis4mo ago
Is this Ubuntu perhaps
Smilebags
SmilebagsOP4mo ago
Yes
Mraedis
Mraedis4mo ago
Is it snap docker?
Smilebags
SmilebagsOP4mo ago
Can you tell me an easy way to check? I'm running it headless, docker has been setup for >2y
Mraedis
Mraedis4mo ago
sudo ps aux | grep snap perhaps Might be -aux I'm a bit rusty
Smilebags
SmilebagsOP4mo ago
$ sudo ps aux | grep snap
chris 7210 0.0 0.0 39128 256 ? Ss 2024 0:00 /snap/snapd-desktop-integration/253/usr/bin/snapd-desktop-integration
chris 7541 0.0 0.0 278796 532 ? Sl 2024 0:08 /snap/snapd-desktop-integration/253/usr/bin/snapd-desktop-integration
chris 1461060 0.0 0.0 9216 1536 pts/111 S+ 01:53 0:00 grep --color=auto snap
root 3669984 0.0 0.2 1396432 21100 ? Ssl 2024 8:17 /usr/lib/snapd/snapd
$ sudo ps aux | grep snap
chris 7210 0.0 0.0 39128 256 ? Ss 2024 0:00 /snap/snapd-desktop-integration/253/usr/bin/snapd-desktop-integration
chris 7541 0.0 0.0 278796 532 ? Sl 2024 0:08 /snap/snapd-desktop-integration/253/usr/bin/snapd-desktop-integration
chris 1461060 0.0 0.0 9216 1536 pts/111 S+ 01:53 0:00 grep --color=auto snap
root 3669984 0.0 0.2 1396432 21100 ? Ssl 2024 8:17 /usr/lib/snapd/snapd
Doesn't look like anything docker related in there
$ sudo docker --version
Docker version 26.1.4, build 5650f9b
$ which docker
/usr/bin/docker
$ sudo docker --version
Docker version 26.1.4, build 5650f9b
$ which docker
/usr/bin/docker
How confident should I be that a prune won't nuke whatever copy of the data the container does have access to @Tempest ?
Mraedis
Mraedis4mo ago
OK probably not snap docker then, because the volumes for snap get put somewhere weird which would explain this behavior
Tempest
Tempest4mo ago
I thought you said that you had a backup of the data?
Smilebags
SmilebagsOP4mo ago
I have a backup of that folder yes, less confident about the DB, or any unknown unknowns.
Tempest
Tempest4mo ago
Because right now we ARE trying to nuke the data, so it uses the correct file paths
bo0tzz
bo0tzz4mo ago
What's the output of docker inspect immich_server?
Smilebags
SmilebagsOP4mo ago
Nothing when it's not up. One sec, spinning it back up Sorry not nothing.
[]
Error: No such object: immich_server
[]
Error: No such object: immich_server
Smilebags
SmilebagsOP4mo ago
The mounts there look fine hey
bo0tzz
bo0tzz4mo ago
Yes, so it is mounted to the container right, and
Immich seems to pick up the right drive information in the UI: 3.3 TiB of 3.5 TiB used
suggests the same So then let's scrutinize the original issue
it is clear that it is still not 'connected'.
How are you determining this?
Smilebags
SmilebagsOP4mo ago
Previously, I was determining it because the folder was entirely empty. UPLOAD_LOCATION was previously ~/share/skyhawk/immich which resolves to the same folder on disk, but I imagine that's what was confusing Immich previously regarding the drive capacity. The way I'm doing it now (though I can do something more heavy handed if needed to confirm) is to upload a new image, and then look for the folder path in /skyhawk/immich/upload/6872c15a-dbad-4bbc-952d-5b9689e6f9d4 Images that existed before I docker cp ed them over, are obviously there. New images I upload don't show up. I can rename a folder and restart if that would help
bo0tzz
bo0tzz4mo ago
Do you have storage template enabled?
Smilebags
SmilebagsOP4mo ago
No
bo0tzz
bo0tzz4mo ago
You say previously it was pointing to the same folder on disk through a different path - how was that set up? If it was working, why was there any need to copy files over?
Smilebags
SmilebagsOP4mo ago
They weren't showing up in that location (either /skyhawk/immich or the user folder subdir). It was "working" to the extent that Immich had the files somewhere. But I don't want my files 'somewhere' that I don't know, understand or have control over. I suspect they're stored in a docker container somewhere, or somehow mapped to a different location on my main drive.
bo0tzz
bo0tzz4mo ago
Right, so it was never really working properly. Tbh I have no idea why your docker setup seemingly doesn't mount volumes properly
Smilebags
SmilebagsOP4mo ago
That's relieving to hear in a way 😆 It has completely stumped me. I might further test my assumption that it's not mounted correctly by renaming a file from docker and seeing whether it updates on disk. That feels like the weakest part of my understanding here.
Tempest
Tempest4mo ago
If you create a new immich instance in a new directory, does that work as intented?
Smilebags
SmilebagsOP4mo ago
I might try that next. I appreciate the help everyone! I'll loop back if I find the root cause I definitely did myself a disservice by copying files over and simultaneously tried to debug the issue Though good news is that it looks like it is indeed linked now. I created a dummy file from the server container and it showed up on disk so.. It looks like it is indeed working??? Now to find 80gb of zombie files My assumption equating the ID for an image in the FE (page URL, image URL) to the ID used for file storage may be wrong, suggesting why I couldn't find the new files. They may exist, somewhere in there, with an ID I don't know how to find
bo0tzz
bo0tzz4mo ago
Odds are those ended up inside of the container's temporary fs and then got deleted when the container was recreated
Smilebags
SmilebagsOP4mo ago
I've restarted immich multiple times prior to today Though that sort of thing is the concern that motivated me to try to sort this out I don't want some random docker container owning all my files and deleting them with an accidental command
Mraedis
Mraedis4mo ago
If they are in a docker volume I think you should be able to find them in var lib with sudo find /var/lib/ -name somefile.jpg
bo0tzz
bo0tzz4mo ago
Also try docker volume ls

Did you find this page helpful?