Skip to content

[Bug]: postgresql database keeping restartΒ #8826

@allentown521

Description

@allentown521

Error Message and Logs

I have tried different images, 16, 17, and 18 all have this problem.
The strange thing is that other deployed postgresql containers on the same machine are normal, and only the newly created containers have this problem.

When the coolify panel shows that postgresql has Exited, execute docker inspect *** --format='{{.State.Health.Status}}' and the return is indeed health. At this time, the connection to the database fails. I checked the postgresql logs and there is no indication that it restarted.

There is only one stopped in the log, but the actual Exited state appears several times

Image

2026-03-09T09:55:43.146777934Z The files belonging to this database system will be owned by user "postgres".
2026-03-09T09:55:43.146860774Z This user must also own the server process.
2026-03-09T09:55:43.146864119Z
2026-03-09T09:55:43.147061327Z The database cluster will be initialized with locale "en_US.utf8".
2026-03-09T09:55:43.147071762Z The default database encoding has accordingly been set to "UTF8".
2026-03-09T09:55:43.147074688Z The default text search configuration will be set to "english".
2026-03-09T09:55:43.147076931Z
2026-03-09T09:55:43.147079235Z Data page checksums are disabled.
2026-03-09T09:55:43.147141382Z
2026-03-09T09:55:43.147298476Z fixing permissions on existing directory /var/lib/postgresql/data ... ok
2026-03-09T09:55:43.149879223Z creating subdirectories ... ok
2026-03-09T09:55:43.149897382Z selecting dynamic shared memory implementation ... posix
2026-03-09T09:55:43.165692814Z selecting default "max_connections" ... 100
2026-03-09T09:55:43.189466294Z selecting default "shared_buffers" ... 128MB
2026-03-09T09:55:43.233449272Z selecting default time zone ... UTC
2026-03-09T09:55:43.234584133Z creating configuration files ... ok
2026-03-09T09:55:43.370187849Z running bootstrap script ... ok
2026-03-09T09:55:43.584759977Z sh: locale: not found
2026-03-09T09:55:43.584804657Z 2026-03-09 09:55:43.584 UTC [34] WARNING: no usable system locales were found
2026-03-09T09:55:44.043252418Z performing post-bootstrap initialization ... ok
2026-03-09T09:55:44.136146103Z syncing data to disk ... ok
2026-03-09T09:55:44.136179034Z
2026-03-09T09:55:44.136188018Z
2026-03-09T09:55:44.136190201Z Success. You can now start the database server using:
2026-03-09T09:55:44.136192736Z
2026-03-09T09:55:44.136194808Z pg_ctl -D /var/lib/postgresql/data -l logfile start
2026-03-09T09:55:44.136196771Z
2026-03-09T09:55:44.136265980Z initdb: warning: enabling "trust" authentication for local connections
2026-03-09T09:55:44.136301655Z initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
2026-03-09T09:55:44.188295531Z waiting for server to start....2026-03-09 09:55:44.188 UTC [40] LOG: starting PostgreSQL 17.9 on x86_64-pc-linux-musl, compiled by gcc (Alpine 15.2.0) 15.2.0, 64-bit
2026-03-09T09:55:44.189664698Z 2026-03-09 09:55:44.189 UTC [40] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2026-03-09T09:55:44.194629894Z 2026-03-09 09:55:44.194 UTC [43] LOG: database system was shut down at 2026-03-09 09:55:44 UTC
2026-03-09T09:55:44.200379134Z 2026-03-09 09:55:44.200 UTC [40] LOG: database system is ready to accept connections
2026-03-09T09:55:44.263386052Z done
2026-03-09T09:55:44.263431763Z server started
2026-03-09T09:55:44.285256031Z
2026-03-09T09:55:44.285287871Z /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2026-03-09T09:55:44.285290775Z
2026-03-09T09:55:44.286135163Z waiting for server to shut down....2026-03-09 09:55:44.286 UTC [40] LOG: received fast shutdown request
2026-03-09T09:55:44.288239085Z 2026-03-09 09:55:44.288 UTC [40] LOG: aborting any active transactions
2026-03-09T09:55:44.290798959Z 2026-03-09 09:55:44.290 UTC [40] LOG: background worker "logical replication launcher" (PID 46) exited with exit code 1
2026-03-09T09:55:44.292926979Z 2026-03-09 09:55:44.292 UTC [41] LOG: shutting down
2026-03-09T09:55:44.294072656Z 2026-03-09 09:55:44.294 UTC [41] LOG: checkpoint starting: shutdown immediate
2026-03-09T09:55:44.299896613Z 2026-03-09 09:55:44.299 UTC [41] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.002 s, sync=0.001 s, total=0.007 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB; lsn=0/14ED290, redo lsn=0/14ED290
2026-03-09T09:55:44.305870232Z 2026-03-09 09:55:44.305 UTC [40] LOG: database system is shut down
2026-03-09T09:55:44.386313061Z done
2026-03-09T09:55:44.386506724Z server stopped
2026-03-09T09:55:44.388050232Z
2026-03-09T09:55:44.388068892Z PostgreSQL init process complete; ready for start up.
2026-03-09T09:55:44.388072226Z
2026-03-09T09:55:44.412259151Z 2026-03-09 09:55:44.412 UTC [1] LOG: starting PostgreSQL 17.9 on x86_64-pc-linux-musl, compiled by gcc (Alpine 15.2.0) 15.2.0, 64-bit
2026-03-09T09:55:44.412325895Z 2026-03-09 09:55:44.412 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2026-03-09T09:55:44.412332947Z 2026-03-09 09:55:44.412 UTC [1] LOG: listening on IPv6 address "::", port 5432
2026-03-09T09:55:44.414417999Z 2026-03-09 09:55:44.414 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2026-03-09T09:55:44.420039338Z 2026-03-09 09:55:44.418 UTC [54] LOG: database system was shut down at 2026-03-09 09:55:44 UTC
2026-03-09T09:55:44.424748336Z 2026-03-09 09:55:44.424 UTC [1] LOG: database system is ready to accept connections
2026-03-09T10:00:44.517792210Z 2026-03-09 10:00:44.517 UTC [52] LOG: checkpoint starting: time
2026-03-09T10:00:48.839319635Z 2026-03-09 10:00:48.839 UTC [52] LOG: checkpoint complete: wrote 46 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.313 s, sync=0.003 s, total=4.322 s; sync files=11, longest=0.002 s, average=0.001 s; distance=270 kB, estimate=270 kB; lsn=0/1530BA8, redo lsn=0/1530B50

Image

Steps to Reproduce

1.create a postgresql database
2.do nothing
3.keep restart (The interval time is not fixed, 1 minute, maybe tens of seconds)
4.

Example Repository URL

No response

Coolify Version

v4.0.0-beta.463

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    βœ… DoneIssues that are fixed and a PR is ready to be merged.πŸ› Possible BugReported issues that need to be reproduced by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions