"no such file or directory" only for videos after moving IMMICH_MEDIA_LOCATION #6497

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

Originally created by @charludo on GitHub (Jul 24, 2025).

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

  • Yes

The bug

(Note: I'm not running immich through Docker, but rather using the NixOS module; this is the reason I am using IMMICH_MEDIA_LOCATION / services.immich.mediaLocation rather than UPLOAD_LOCATION.)

After moving /media/immich to /media/vm_state/immich and adjusting the IMMICH_MEDIA_LOCATION accordingly, I am almost trouble-free: the library loads successfully, I can see all image thumbnails and video thumbnails, and clicking on images opens them as you'd expect.

The only issues are videos, which apparently are still being looked for in the old location (see log excerpt below, this happens for all videos uploaded before the move)

The OS that Immich Server is running on

NixOS unstable

Version of Immich Server

v1.135.3

Version of Immich Mobile App

v1.135.3

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

n/a

Your .env content

[Service]
Environment="DB_URL=postgresql:///immich?host=/run/postgresql"
Environment="IMMICH_HOST=0.0.0.0"
Environment="IMMICH_MACHINE_LEARNING_URL=http://localhost:3003"
Environment="IMMICH_MEDIA_LOCATION=/media/vm_state/immich"
Environment="IMMICH_PORT=2283"
Environment="REDIS_SOCKET=/run/redis-immich/redis.sock"
Environment="TZDIR=/nix/store/lc765p3sqqj3f13cq6531v4k1jd45sl1-tzdata-2025b/share/zoneinfo"
Environment="UV_USE_IO_URING=0"

Reproduction steps

  1. set IMMICH_MEDIA_LOCATION
  2. start server
  3. upload a photo and a video
  4. stop server
  5. change IMMICH_MEDIA_LOCATION and move the folder accordingly
  6. start server
  7. see photo as you'd expected, see that video fails to play, see below message in logs

Relevant log output

Jul 24 10:58:13 SRV-IMMICH immich[1562822]: [Nest] 1562822  - 07/24/2025, 10:58:13 AM   ERROR [Api:GlobalExceptionFilter~1j9ny7w3] Unknown error: Error: ENOENT: no such file or directory, access '/media/immich/upload/876ac67b-05f0-4ca7-a4f8-3525360e7e4e/38/c6/38c64537-930e-4aa8-90af-ed3013d5222d.mp4'
Jul 24 10:58:13 SRV-IMMICH immich[1562822]: Error: ENOENT: no such file or directory, access '/media/immich/upload/876ac67b-05f0-4ca7-a4f8-3525360e7e4e/38/c6/38c64537-930e-4aa8-90af-ed3013d5222d.mp4'
Jul 24 10:58:13 SRV-IMMICH immich[1562822]:     at async access (node:internal/fs/promises:600:10)
Jul 24 10:58:13 SRV-IMMICH immich[1562822]:     at async sendFile (/nix/store/bigvq8lyd759waj3apbrc19qf0hzafh9-immich-1.135.3/dist/utils/file.js:53:9)
Jul 24 10:58:13 SRV-IMMICH immich[1562822]:     at async AssetMediaController.playAssetVideo (/nix/store/bigvq8lyd759waj3apbrc19qf0hzafh9-immich-1.135.3/dist/controllers/asset-media.controller.js:83:9)

Additional information

No response

Originally created by @charludo on GitHub (Jul 24, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug (Note: I'm not running immich through Docker, but rather using the NixOS module; this is the reason I am using `IMMICH_MEDIA_LOCATION` / `services.immich.mediaLocation` rather than `UPLOAD_LOCATION`.) After moving `/media/immich` to `/media/vm_state/immich` and adjusting the `IMMICH_MEDIA_LOCATION` accordingly, I am *almost* trouble-free: the library loads successfully, I can see all image thumbnails and video thumbnails, and clicking on images opens them as you'd expect. The only issues are videos, which apparently are still being looked for in the old location (see log excerpt below, this happens for all videos uploaded before the move) ### The OS that Immich Server is running on NixOS unstable ### Version of Immich Server v1.135.3 ### Version of Immich Mobile App v1.135.3 ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML n/a ``` ### Your .env content ```Shell [Service] Environment="DB_URL=postgresql:///immich?host=/run/postgresql" Environment="IMMICH_HOST=0.0.0.0" Environment="IMMICH_MACHINE_LEARNING_URL=http://localhost:3003" Environment="IMMICH_MEDIA_LOCATION=/media/vm_state/immich" Environment="IMMICH_PORT=2283" Environment="REDIS_SOCKET=/run/redis-immich/redis.sock" Environment="TZDIR=/nix/store/lc765p3sqqj3f13cq6531v4k1jd45sl1-tzdata-2025b/share/zoneinfo" Environment="UV_USE_IO_URING=0" ``` ### Reproduction steps 1. set `IMMICH_MEDIA_LOCATION` 2. start server 3. upload a photo and a video 4. stop server 5. change `IMMICH_MEDIA_LOCATION` and move the folder accordingly 6. start server 7. see photo as you'd expected, see that video fails to play, see below message in logs ### Relevant log output ```shell Jul 24 10:58:13 SRV-IMMICH immich[1562822]: [Nest] 1562822 - 07/24/2025, 10:58:13 AM ERROR [Api:GlobalExceptionFilter~1j9ny7w3] Unknown error: Error: ENOENT: no such file or directory, access '/media/immich/upload/876ac67b-05f0-4ca7-a4f8-3525360e7e4e/38/c6/38c64537-930e-4aa8-90af-ed3013d5222d.mp4' Jul 24 10:58:13 SRV-IMMICH immich[1562822]: Error: ENOENT: no such file or directory, access '/media/immich/upload/876ac67b-05f0-4ca7-a4f8-3525360e7e4e/38/c6/38c64537-930e-4aa8-90af-ed3013d5222d.mp4' Jul 24 10:58:13 SRV-IMMICH immich[1562822]: at async access (node:internal/fs/promises:600:10) Jul 24 10:58:13 SRV-IMMICH immich[1562822]: at async sendFile (/nix/store/bigvq8lyd759waj3apbrc19qf0hzafh9-immich-1.135.3/dist/utils/file.js:53:9) Jul 24 10:58:13 SRV-IMMICH immich[1562822]: at async AssetMediaController.playAssetVideo (/nix/store/bigvq8lyd759waj3apbrc19qf0hzafh9-immich-1.135.3/dist/controllers/asset-media.controller.js:83:9) ``` ### Additional information _No response_
Author
Owner

@bo0tzz commented on GitHub (Jul 24, 2025):

Due to how paths are stored in the database, it's currently not supported to change IMMICH_MEDIA_LOCATION. It should become possible after the upcoming release.

@bo0tzz commented on GitHub (Jul 24, 2025): Due to how paths are stored in the database, it's currently not supported to change `IMMICH_MEDIA_LOCATION`. It should become possible after the upcoming release.
Author
Owner

@charludo commented on GitHub (Jul 24, 2025):

Due to how paths are stored in the database, it's currently not supported to change IMMICH_MEDIA_LOCATION. It should become possible after the upcoming release.

Thanks for the fast answer! That means moving everything back for now, waiting for the next release, then changing the location should in theory work?

@charludo commented on GitHub (Jul 24, 2025): > Due to how paths are stored in the database, it's currently not supported to change `IMMICH_MEDIA_LOCATION`. It should become possible after the upcoming release. Thanks for the fast answer! That means moving everything back for now, waiting for the next release, then changing the location should in theory work?
Author
Owner

@bo0tzz commented on GitHub (Jul 24, 2025):

Yup

@bo0tzz commented on GitHub (Jul 24, 2025): Yup
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#6497