Cant reach my server (Immich_Postrgres constantly restarting)
I have just upgraded my docker to 4.36.0 and my Immich to v1.121.0 by using docker compose pull && docker compose up -d and when I got to try access my immich server through the browser it says localhost didn’t send any data. When I looked into my containers I saw that immich_postgres is constantly restarting does anyone know why this is or could help out? Would be very much appreciated.
61 Replies
:wave: Hey @Malicalf,
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. :blue_square: uploaded the relevant information (see below).
7. :blue_square: 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.Sorry I had asked this question I was told to put quotes around something I cant remember what else I hadnt had time to try it and reply and it got closed
What is the file system postgres is stored on?
+ other details about your system please
We need more info on your system, please execute the following command (paste it into your terminal), and share the output of it afterwards:
(
lsb_release -d &&
echo -n 'Kernel Version: ' &&
cat /proc/version &&
docker -v &&
docker compose version &&
echo -n 'Docker-Compose!! (deprecated): ' &&
docker-compose version &&
echo -n 'CPU ' &&
lscpu | grep 'Model name' | tr -s ' ' &&
lscpu | grep 'Architecture' | tr -s ' ' &&
cat /proc/meminfo | grep MemTotal | tr -s ' ' &&
hostnamectl
)
@Malicalf and provide the info schuhbacca asked for (what file system is the postgres db stored on and is it local or remote storage). also provide logs
View container logs by running `docker compose logs`. For further information refer to https://immich.app/docs/guides/docker-help
Here are the docker compose logs
When I paste this into my CMD it just gives a bunch of syntax errors
Uhhh I dont understand the question sorry. I used docker compose downloaded onto windows and followed the immich site instructions to download so I guess the default file system?
Postgres is stored in the immich-app folder inside of my user on my main disc inside of docker?
uh oh, just noticed you are running docker desktop on windows...
so postgres is running on an NTFS file system I assume, this usually causes problems.
I recommend to install docker engine on a linux system, not on windows to avoid unnecessary incompatibilities and issues
Is this really the issue it was running fine for months?
Hmm, can you try docker compose down then “docker compose up”?
I had tried docker compose down then docker compose up -d whats the difference? is it just that I see the logs in my terminal?
Yes
Yeah Postgres is just still restarting did you want me to send the logs for that?
Yes please
Your docker-compose file is out of date

can you put quote around that line in the volumes section
and for the port, change to 2283:2283?
Will do thanks for the help Ill let you know if it works
I made the fix and postgres is still just restarting?
Unless I put the quotes in wrong or something
No you got it right
somethings seem to be wrong with the database
Do you have the
backups
folder at the UPLOAD_LOCATION
?
For the last trial, can you copy the entire content of this docker-compose.yml file and replace yours with it? https://github.com/immich-app/immich/blob/main/docker/docker-compose.ymlis the upload location just the - "D:/Documents/Photos & Videos:/usr/src/app/photos"
here is the path to your UPLOAD_LOCATION
UPLOAD_LOCATION=D:\Immich\Backup-assets
Can you navigate there
D:\Immich\Backup-assets
and see if there are any folder called backups
?Yeah in the backup-assets folder there is a folder called backups D:\Immich\Backup-assets\backups
the only thing in it is a .immich file
Should I do this now?
ah so you must have update from a version that didn't have that backup feature yet
yes
Done will I need to go in and edit it so that it still knows where my photos and stuff are or is it fine just to run it and see if it works?
you should just change the docker-compose file to the default one
not the .env file
Ah
hmm
Yeah so I copy and pasted the txt you sent me to replace my docker-compose.yml file but in my original one I had the - "D:/Documents/Photos & Videos:/usr/src/app/photos" so was just unsure if that will mess anything up
I copied the original file to my desktop first incase
Can you check your .env file and make sure there is no space here

You already have DB_DATA_LOCATION above so you can remove the line below
There was space behind all of them so what part am I removing?
I removed the spaces
Remove the space please
then run
docker compose down
and docker compose up
again
can you post the content of your .env again. after editing them?yup
You can remove these two lines as well

Then run
docker compose down
and docker compose up
Still looks to be having an issue
So it is likely that the database has corrupted so it cannot start up
let's try starting with a new database by changing this line to
DB_DATA_LOCATION=./postgres-test
as in paste that where I removed it before?
oh oops
nah I know what you mean
I assume once I have done that I just re do docker down then docker up
Yes
This means Ill need to reupload everything and re name every face and all of that again right? it looks like I can access the server now
Alright, so it means the previous database has corrupted somehow
Do you have any Linux system that you can run Immich on?
running Immich on Windows can be unreliable due to Docker on Windows is not the greatest
I dont have any computer running linux can I run it within the same computer or is that also unstable
I assume this is your main workstation?
Yeah
the location of the drive where you have your
docker-compose.yml
stored at, is it a local hard drive or network hard drive?Its my local disk
I have immich and docker and everything installed on my main ssd that has windows and everything on it and then I have my location that my photos and videos are kept on my seperate m.2 storage because it is larger
okay, that is good
hmm maybe it is better to run docker in the wsl context
fwiw, starting the last two release, we now have automatic database dump to save you in situation like this
but sorry man, looks like you will have to start over
That is so completely fine
so now if this were to happen its saved somewhere?
what happens then I make a new database then what?
then you run the restore command
Gotcha so if same thing ends up happening I can just do that and I should be all good again
Correct
please look into running Immich in at least wsl context
all your files should still in the
library
folderI will have a look thanks for your help
what does this do for me? Are you talking about now or if it were to be corrupted again
It is still however giving me this?
2024-12-02 11:27:37 [Nest] 19 - 12/02/2024, 12:27:37 AM LOG [Api:EventRepository] Websocket Connect: ZrgzunOoWjT1gfokAAAB
2024-12-02 11:24:21 [Nest] 7 - 12/02/2024, 12:24:21 AM ERROR [Microservices:TypeOrmModule] Unable to connect to the database. Retrying (1)...
2024-12-02 11:24:21 Error: connect ECONNREFUSED 172.18.0.4:5432
2024-12-02 11:24:21 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1610:16)
2024-12-02 11:24:21 [Nest] 7 - 12/02/2024, 12:24:21 AM ERROR [Microservices:TypeOrmModule] Unable to connect to the database. Retrying (2)...
2024-12-02 11:24:21 Error: connect ECONNREFUSED 172.18.0.4:5432
2024-12-02 11:24:21 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1610:16)
2024-12-02 11:24:21 [Nest] 7 - 12/02/2024, 12:24:21 AM ERROR [Microservices:TypeOrmModule] Unable to connect to the database. Retrying (3)...
2024-12-02 11:24:21 Error: connect ECONNREFUSED 172.18.0.4:5432
But regardless immich still seems to be working
maybe ill just fresh install on wsl
Option 1: restore old DB
Run the DB-restore from the website and re-use your old upload folder
Option 2: full fresh install
Just install a fresh immich instance and use immich-cli or immich-go on your OLD
UPLOAD_LOCATION/library
folder, which will re-import the files thereok perfect cheers