Overlapping mount issue when using Files Custom Locations #7012

Closed
opened 2026-02-05 12:43:00 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @szilardx on GitHub (Aug 29, 2025).

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

Using the recommended setup from the docs for Files Custom Locations, I started to get issues with disappearing thumbnails (all of them).
The only change beside Immich is that I updated the rclone executable.
I store the uploads on an rclone mounted cloud drive, and the thumbnails on a fast, "local" ssd. The below setup (docker-compose.yml section) worked until I updated rclone.

Upon examining the folders inside the container (docker exec -it immich_server bash and listing), I can see, that the thumbnail and encoded video folder's content disappears after a few minutes.
docker inspect immich_server show that the mounts are okay. But they are not, for example the thumbnails folder appears to be the one in the mounted folder which is set for uploads (the parent folder).

I realized that the issue is with the overlapping bind mount recommended by the docs for custom file locations.
https://github.com/immich-app/immich/blob/main/docs/docs/guides/custom-locations.md
The docs recommends to add the custom thumbs and encoded video location in the docker-compose.yml to be a subfolder of /data (or /usr/src/app/upload in the past). This results in overlapping bind mounts, as the UPLOAD_LOCATION is mounted to /data, and the THUMB_LOCATION is mounted to /data/thumbs. I guess my new rclone drive version causes some kind of a remount, and because of this the thumbs mount (which is a subfolder in the overlapping mounts situation) disappears.

As a temporary workaround I resolved this by changing my mounts in docker-compose.yml to not to be overlapping, like this:

    volumes:
#    - ${UPLOAD_LOCATION}:/data   (original line commented out)
      - /home/ubuntu/rclone/photo-uploads/library:/data/library
      - /home/ubuntu/rclone/photo-uploads/upload:/data/upload
      - ${THUMB_LOCATION}:/data/thumbs
      - ${ENCODED_VIDEO_LOCATION}:/data/encoded-video
      - ${PROFILE_LOCATION}:/data/profile
      - ${BACKUP_LOCATION}:/data/backups

I have a library and an upload folder too, as I use Storage Tempate Engine.

The OS that Immich Server is running on

Ubuntu 24.04

Version of Immich Server

v1.139.4

Version of Immich Mobile App

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

No response

Your docker-compose.yml content

services:
  immich-server:
      volumes:
      - ${UPLOAD_LOCATION}:/data
      - ${THUMB_LOCATION}:/data/thumbs
      - ${ENCODED_VIDEO_LOCATION}:/data/encoded-video
      - ${PROFILE_LOCATION}:/data/profile
      - ${BACKUP_LOCATION}:/data/backups

Your .env content

UPLOAD_LOCATION=/home/ubuntu/rclone/photo-uploads
ENCODED_VIDEO_LOCATION=/home/ubuntu/rclone/encoded-video
THUMB_LOCATION=/home/ubuntu/immich-app/library/thumbs
PROFILE_LOCATION=/home/ubuntu/immich-app/library/profile
BACKUP_LOCATION=/home/ubuntu/rclone/backups

Reproduction steps

  1. Use the recommended split folder setup from here, with the UPLOAD_LOCATION that is mounted to /data being a vfs from rclone(?)
  2. start immich_server
  3. After a few minutes thumbs folder becomes "empty". Location appears to be on UPLOAD_LOCATION/thumbs
  4. restarting immich containers solve this issue

Relevant log output


Additional information

No response

Originally created by @szilardx on GitHub (Aug 29, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug Using the recommended setup from the docs for Files Custom Locations, I started to get issues with disappearing thumbnails (all of them). The only change beside Immich is that I updated the rclone executable. I store the uploads on an rclone mounted cloud drive, and the thumbnails on a fast, "local" ssd. The below setup (docker-compose.yml section) worked until I updated rclone. Upon examining the folders inside the container (`docker exec -it immich_server bash` and listing), I can see, that the thumbnail and encoded video folder's content disappears after a few minutes. `docker inspect immich_server` show that the mounts are okay. But they are not, for example the thumbnails folder appears to be the one in the mounted folder which is set for uploads (the parent folder). I realized that the issue is with the overlapping bind mount recommended by the docs for custom file locations. https://github.com/immich-app/immich/blob/main/docs/docs/guides/custom-locations.md The docs recommends to add the custom thumbs and encoded video location in the docker-compose.yml to be a subfolder of /data (or /usr/src/app/upload in the past). This results in overlapping bind mounts, as the UPLOAD_LOCATION is mounted to /data, and the THUMB_LOCATION is mounted to /data/thumbs. I guess my new rclone drive version causes some kind of a remount, and because of this the thumbs mount (which is a subfolder in the overlapping mounts situation) disappears. As a temporary workaround I resolved this by changing my mounts in docker-compose.yml to not to be overlapping, like this: ``` volumes: # - ${UPLOAD_LOCATION}:/data (original line commented out) - /home/ubuntu/rclone/photo-uploads/library:/data/library - /home/ubuntu/rclone/photo-uploads/upload:/data/upload - ${THUMB_LOCATION}:/data/thumbs - ${ENCODED_VIDEO_LOCATION}:/data/encoded-video - ${PROFILE_LOCATION}:/data/profile - ${BACKUP_LOCATION}:/data/backups ``` I have a library and an upload folder too, as I use Storage Tempate Engine. ### The OS that Immich Server is running on Ubuntu 24.04 ### Version of Immich Server v1.139.4 ### Version of Immich Mobile App - ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Device make and model _No response_ ### Your docker-compose.yml content ```YAML services: immich-server: volumes: - ${UPLOAD_LOCATION}:/data - ${THUMB_LOCATION}:/data/thumbs - ${ENCODED_VIDEO_LOCATION}:/data/encoded-video - ${PROFILE_LOCATION}:/data/profile - ${BACKUP_LOCATION}:/data/backups ``` ### Your .env content ```Shell UPLOAD_LOCATION=/home/ubuntu/rclone/photo-uploads ENCODED_VIDEO_LOCATION=/home/ubuntu/rclone/encoded-video THUMB_LOCATION=/home/ubuntu/immich-app/library/thumbs PROFILE_LOCATION=/home/ubuntu/immich-app/library/profile BACKUP_LOCATION=/home/ubuntu/rclone/backups ``` ### Reproduction steps 1. Use the recommended split folder setup from here, with the UPLOAD_LOCATION that is mounted to /data being a vfs from rclone(?) 2. start immich_server 3. After a few minutes thumbs folder becomes "empty". Location appears to be on UPLOAD_LOCATION/thumbs 4. restarting immich containers solve this issue ### Relevant log output ```shell ``` ### Additional information _No response_
Author
Owner

@mmomjian commented on GitHub (Aug 29, 2025):

The nested mounts are intentional, because this allows storage template moves to be atomic. I assume this is an issue with rclone, which we don’t recommend using for mounts.

@mmomjian commented on GitHub (Aug 29, 2025): The nested mounts are intentional, because this allows storage template moves to be atomic. I assume this is an issue with rclone, which we don’t recommend using for mounts.
Author
Owner

@szilardx commented on GitHub (Aug 29, 2025):

Sorry, I see no mention in the docs about rclone. Also I just found this merged PR:
https://github.com/immich-app/immich/pull/2832

When not using custom split locations, I can understand the rational between the unified structure, atomic moves.

My understanding was that thumbnails are not using storage template, and my issue is that thumbnails are mounted under the UPLOAD_LOCATION env var - in a split storage config with THUMB_LOCATION.

It seems to me that if immich would use a separate folder internally, as a parent for thumbnails, encoded videos that is not the UPLOAD_LOCATION (/data/upload and /data/library), than this would prevent the above issue.
Researching overlapping bind mounts I can see some shadowing issue could occur.
Thank you for your help!

@szilardx commented on GitHub (Aug 29, 2025): Sorry, I see no mention in the docs about rclone. Also I just found this merged PR: https://github.com/immich-app/immich/pull/2832 When not using custom split locations, I can understand the rational between the unified structure, atomic moves. My understanding was that thumbnails are not using storage template, and my issue is that thumbnails are mounted under the UPLOAD_LOCATION env var - in a split storage config with THUMB_LOCATION. It seems to me that if immich would use a separate folder internally, as a parent for thumbnails, encoded videos that is not the UPLOAD_LOCATION (/data/upload and /data/library), than this would prevent the above issue. Researching overlapping bind mounts I can see some shadowing issue could occur. Thank you for your help!
Author
Owner

@mmomjian commented on GitHub (Aug 29, 2025):

I guess if you want to PR a warning for the docs that it can cause issues with rclone that would be fine. Our recommendation remains to nest them for most deployments.

We will not be changing the folder structure though.

@mmomjian commented on GitHub (Aug 29, 2025): I guess if you want to PR a warning for the docs that it can cause issues with rclone that would be fine. Our recommendation remains to nest them for most deployments. We will not be changing the folder structure though.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#7012