FATAL: terminating connection due to unexpected postmaster exit

Viewed 3120

I am having several issues with workers losing connection to PostgreSQL database running in docker. In my logs I see this message repeated several times:

FATAL: terminating connection due to unexpected postmaster exit

I cannot find any information about this error on line. What exactly is an unexpected postmaster exit?

2 Answers

If this is Linux, most likely your postmaster process has been killed by OOM.

Yea so this actually happened to me when running TestContainers for postgres as part of integration tests. After hours and hours it ended up being that I needed to increase the memory and swap settings in my docker preferences in docker desktop. Then the issue went away and everything started working!! These are my settings but maybe in your case you may need even more aggressive settings so play with it a bit.enter image description here

Related