I
Immich•5mo ago
miknzau

Server Migration - ERROR [Microservices:StorageService] Failed to read upload/encoded-video/.immich:

I have migrated my Windows immich instance from an old to a new PC. The setup on the old pc was that ALL files related to immich were on dedicated external hard drive. d: I followed the steps on this page. https://immich.app/docs/administration/backup-and-restore (windows / powershell tab) Everything went totally smoothly, yet I couldn't load immich in the web browser, a look in the immich server logs has:
2025-01-01 16:54:04 [Nest] 7 - 01/01/2025, 9:54:04 AM ERROR [Microservices:StorageService] Failed to read upload/encoded-video/.immich: Error: ENOENT: no such file or directory, open 'upload/encoded-video/.immich'
2025-01-01 16:54:04 microservices worker error: Error: Failed to read "<UPLOAD_LOCATION>/encoded-video/.immich - Please see https://immich.app/docs/administration/system-integrity#folder-checks for more information."
2025-01-01 16:54:04 microservices worker exited with code 1
2025-01-01 16:54:04 Killing api process
2025-01-01 16:54:04 [Nest] 7 - 01/01/2025, 9:54:04 AM ERROR [Microservices:StorageService] Failed to read upload/encoded-video/.immich: Error: ENOENT: no such file or directory, open 'upload/encoded-video/.immich'
2025-01-01 16:54:04 microservices worker error: Error: Failed to read "<UPLOAD_LOCATION>/encoded-video/.immich - Please see https://immich.app/docs/administration/system-integrity#folder-checks for more information."
2025-01-01 16:54:04 microservices worker exited with code 1
2025-01-01 16:54:04 Killing api process
It seems to my novice eye that the code is looking for the folder "encoded-video" in the "upload" folder, yet to my knowledge it has never been there.
39 Replies
Immich
Immich•5mo ago
:wave: Hey @miknzau, 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. Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
miknzau
miknzauOP•5mo ago
I followed the steps on this page. https://immich.app/docs/administration/backup-and-restore (windows / powershell tab) Steps taken: 1. Successfully created a DB dump, on the old machine, with the immich instance running. 2. Closed immich, closed Docker, removed hard drive. 3. Installed hard drive on new machine and ensured same drive letter d: 4. Installed docker on new machine 5. Again commenced following https://immich.app/docs/administration/backup-and-restore (windows/PowerShell restore part) 6. Needed to copy the dump.sql file into the docker postgres server volume
docker cp "dump.sql" immich_postgres:/dump.sql
docker cp "dump.sql" immich_postgres:/dump.sql
(you should possibly add that step to the doc for windows users, as docker/WSL can't see the dump file in the windows file system) 7. Docker compose down -v (success) 8. Docker compose pull (success) 9. Docker compose create (success) 10. Docker start immich_postgres (success) waited 10 secs and jumped into Docker terminal via
docker exec -it immich_postgres bash
docker exec -it immich_postgres bash
11. ran
cat "/dump.sql" \
| sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \
| psql --username=postgres
cat "/dump.sql" \
| sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \
| psql --username=postgres
- success 12. exit (back to Powershell) 13. Docker compose up -d (success) So everything went totally smoothly, yet I couldn't load immich in the web browser, a look in the immich server logs has:
2025-01-01 16:54:04 [Nest] 7 - 01/01/2025, 9:54:04 AM ERROR [Microservices:StorageService] Failed to read upload/encoded-video/.immich: Error: ENOENT: no such file or directory, open 'upload/encoded-video/.immich'
2025-01-01 16:54:04 microservices worker error: Error: Failed to read "<UPLOAD_LOCATION>/encoded-video/.immich - Please see https://immich.app/docs/administration/system-integrity#folder-checks for more information."
2025-01-01 16:54:04 microservices worker exited with code 1
2025-01-01 16:54:04 Killing api process
2025-01-01 16:54:04 [Nest] 7 - 01/01/2025, 9:54:04 AM ERROR [Microservices:StorageService] Failed to read upload/encoded-video/.immich: Error: ENOENT: no such file or directory, open 'upload/encoded-video/.immich'
2025-01-01 16:54:04 microservices worker error: Error: Failed to read "<UPLOAD_LOCATION>/encoded-video/.immich - Please see https://immich.app/docs/administration/system-integrity#folder-checks for more information."
2025-01-01 16:54:04 microservices worker exited with code 1
2025-01-01 16:54:04 Killing api process
It seems to my novice eye that the code is looking for the folder "encoded-video" in the "upload" folder, yet to my knowledge it has never been there.
miknzau
miknzauOP•5mo ago
Please see the video here for the PowerShell session https://drive.google.com/file/d/11bbv9sAavklmISsHuopVEnT39jcQ6ar8/view?usp=sharing (ignore me miss-typing dump as dummp - lol)
Mraedis
Mraedis•5mo ago
It's because upload location does not refer to the library/upload folder but the library folder. Which itself is pretty confusingly named because there also is a library/library folder But these are mapped in the app to /usr/src/app/upload/(upload|library) to complete the circle of confusion I'm still remote on my phone so this explanation is the best I can do right now šŸ˜¶ā€šŸŒ«ļø
miknzau
miknzauOP•5mo ago
Ok, can wait for further analysis, although I want to stress that I have never altered any standard out of the box settings, so for the backup / restore to not work then possibly the documentation is missing a step? Also, as an FYI, I ran "storage template migration" and "migration" jobs with success on the installation before doing the DB dump. Any further thoughts on this issue?
Zeus
Zeus•5mo ago
Why do you say this? oh I see now. it's the issue of the folder mapping basically what has happened is you are either missing files from your restore or have the mount points messed up please post your full docker compose and .env
miknzau
miknzauOP•5mo ago
version: "3.8"

services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro
env_file:
- .env

ports:
- 2283:2283

depends_on:
- redis
- database
restart: always

immich-machine-learning:
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
volumes:
- model-cache:/cache
env_file:
- .env
restart: always

redis:
container_name: immich_redis
image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
restart: always

database:
container_name: immich_postgres
image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
env_file:
- .env
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
volumes:
- pgdata:/var/lib/postgresql/data
- ./backups:/var/backups
restart: always

volumes:
model-cache:
pgdata:
version: "3.8"

services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro
env_file:
- .env

ports:
- 2283:2283

depends_on:
- redis
- database
restart: always

immich-machine-learning:
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
volumes:
- model-cache:/cache
env_file:
- .env
restart: always

redis:
container_name: immich_redis
image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
restart: always

database:
container_name: immich_postgres
image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
env_file:
- .env
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
volumes:
- pgdata:/var/lib/postgresql/data
- ./backups:/var/backups
restart: always

volumes:
model-cache:
pgdata:
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

COMPOSE_PROJECT_NAME=immich

# The location where your uploaded files are stored
UPLOAD_LOCATION=./immich

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

# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=some-random-text
DB_PASSWORD=postgres

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

COMPOSE_PROJECT_NAME=immich

# The location where your uploaded files are stored
UPLOAD_LOCATION=./immich

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

# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=some-random-text
DB_PASSWORD=postgres

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis
I have only ever used standard default versions of these files (with nessesary changes when breaking changes on updates required them to be modified)
Zeus
Zeus•5mo ago
please post the screenshot of the contents of the folder the docker-compose is in, and also the contents of the ./immich folder
miknzau
miknzauOP•5mo ago
No description
miknzau
miknzauOP•5mo ago
No description
Zeus
Zeus•5mo ago
ok and what's in encoded-video ?
miknzau
miknzauOP•5mo ago
No description
Zeus
Zeus•5mo ago
my assumption is that ./immich does not work on windows perhaps you need ot provide the full path we don't really support/recommend windows for many reasons similar to this like D:\immich
miknzau
miknzauOP•5mo ago
I have been running this version on the preivious pc fine though?? with this actual disk too
Zeus
Zeus•5mo ago
sorry but windows and docker is sort of cursed, that's my best guess though
miknzau
miknzauOP•5mo ago
in fact yesterday i put this physical disk back in the old pc and immich is still running on that box fine!
Zeus
Zeus•5mo ago
it tends to work fine until it fails badly
miknzau
miknzauOP•5mo ago
makes no sense, I have done successful server migration once before. but htat was several versions ago (like maybe 6 months ago)
Zeus
Zeus•5mo ago
sorry, not sure what else to say but that we see issues like this all the time you can certainly keep debugging and trying stuff and maybe someone else has an idea
miknzau
miknzauOP•5mo ago
so working back from the error message... "Failed to read "<UPLOAD_LOCATION>/encoded-video/.immich" is <UPLOAD_LOCATION> which location would you say that is d:/immich in my setup?
Zeus
Zeus•5mo ago
that is correct
miknzau
miknzauOP•5mo ago
ok and the file is clearly there hmmm
Zeus
Zeus•5mo ago
yes but you need to take care for a few things, first of all / vs \ on windows also if a root drive may be required, I am not sure, like D:
miknzau
miknzauOP•5mo ago
but as I say, it is working perfectly on the previous machine, same drive same env same docker-compose so the issue isn't docker, or windows.
Zeus
Zeus•5mo ago
I can promise you the issue is not immich haha what it does is very simple. look for the presence of a file and open it in write mode docker and windows does wayyyy more stuff that can go wrong, and regularly does go wrong on windows specifically
miknzau
miknzauOP•5mo ago
There is one other ticket with this exact error on server migration, so that might offer some clues too
Zeus
Zeus•5mo ago
got it, best of luck
miknzau
miknzauOP•5mo ago
ok so just to be sure, I just now unmounted the D drive from the new server, plugged it back into the old server (both windows 11) and my immich is running fine still on the old server, using the same disk. So for sure something in the migration must be the issue
miknzau
miknzauOP•5mo ago
No description
Zeus
Zeus•5mo ago
Why are you running docker compose up from the immich folder..? Whats in that folder?
miknzau
miknzauOP•5mo ago
No description
Zeus
Zeus•5mo ago
Youre meant to run docker compose commands from the folder containing the compose.yaml file So idk why / how that works. Maybe more windows oddities Either way this basically confirms its a deployment or host OS issue, not immich. As a docker comtainer immich knows nothing about its environment
miknzau
miknzauOP•5mo ago
No description
miknzau
miknzauOP•5mo ago
so yeah it works from d:\ as well ok so running docker on the new machine with NO drive d present, the errors in immich server log are the same, this suggests docker ain't seeing drive D at all maybe.. Interesting clue. where can I see the paths / mounts that this installation of immich "thinks" assets are? Ok I got a large clue by the fact the error was the same when the disk was not present. So I took the disk back to the orig setup - ran immich. confirmed it was all working fine again.. Then took it to the new machine, made no changes, ran compose up and it voila - working fine.. Thanks to everyone - can mark this as resolved.
Zeus
Zeus•5mo ago
Sounds like you didn’t even have to change anything. Interesting haha
miknzau
miknzauOP•5mo ago
I literally didn't šŸ˜•
nooonji
nooonji•5mo ago
Hi! I’m new to basically everything so sorry for taking up your time, but I’m having the same error on Linux Ubuntu. I have my upload folder on another partition which didn’t mount automatically. My problems started after a reboot (and connecting my computer to a router, I was previously running without one [well I said I was new didn’t I?]). I’m very new to all of this, but did you basically just restart the container with the ā€compose downā€ and then ā€compose upā€ commands? Not at my computer but looking for things to try when I get home. I have changed in settings so that the partition now mounts after reboot but it didn’t solve my problem. I also changed permission on the upload folder to user but it didn’t help.
Mraedis
Mraedis•5mo ago
You always have to restart the container if mounts change @nooonji compose down/up will do fine
nooonji
nooonji•5mo ago
Thank you for your help! This did unfortunately not resolve my issue but a reinstall did. I noticed that my file path to my mounted partition had changed so I’m guessing that was what caused my issue.

Did you find this page helpful?