0

I am running SpringBoot application deployed using Docker on Ubuntu. I am using Postgres 14 database. I observer that sometime Postgres database shut down itself and application stops functioning. This is the message i see in the logs at the time of shutdown:

2022-10-13 01:05:13.168 UTC [252712] [unknown]@[unknown] FATAL:  no PostgreSQL user name specified in startup packet
2022-10-13 03:29:17.416 UTC [256037] [unknown]@[unknown] LOG:  invalid length of startup packet
2022-10-13 05:37:41.705 UTC [258867] [unknown]@[unknown] LOG:  invalid length of startup packet
2022-10-13 05:55:44.607 UTC [259013] postgres@postgres FATAL:  no pg_hba.conf entry for host "109.237.97.141", user "postgres", database "postgres", no encryption
2022-10-13 06:12:02.686 UTC [163675] LOG:  received smart shutdown request
2022-10-13 06:12:02.686 UTC [255059] admin@active_inventory_db FATAL:  terminating connection due to administrator command
2022-10-13 06:12:02.686 UTC [259031] admin@active_inventory_db FATAL:  terminating connection due to administrator command
2022-10-13 06:12:02.687 UTC [259039] admin@active_inventory_db FATAL:  terminating connection due to administrator command
2022-10-13 06:12:02.687 UTC [259046] admin@active_inventory_db FATAL:  terminating connection due to administrator command
2022-10-13 06:12:02.687 UTC [259047] admin@active_inventory_db FATAL:  terminating connection due to administrator command
2022-10-13 06:12:02.687 UTC [259062] admin@active_inventory_db FATAL:  terminating connection due to administrator command
2022-10-13 06:12:02.688 UTC [259051] admin@active_inventory_db FATAL:  terminating connection due to administrator command
2022-10-13 06:12:02.688 UTC [259034] admin@active_inventory_db FATAL:  terminating connection due to administrator command
2022-10-13 06:12:02.688 UTC [259054] admin@active_inventory_db FATAL:  terminating connection due to administrator command
2022-10-13 06:12:02.688 UTC [259065] admin@active_inventory_db FATAL:  terminating connection due to administrator command
2022-10-13 06:12:02.721 UTC [163675] LOG:  background worker "logical replication launcher" (PID 252000) exited with exit code 1
2022-10-13 06:12:02.688 UTC [254661] admin@active_inventory_db FATAL:  terminating connection due to administrator command
2022-10-13 06:12:02.688 UTC [259050] admin@active_inventory_db FATAL:  terminating connection due to administrator command
2022-10-13 06:12:02.755 UTC [251995] LOG:  shutting down
2022-10-13 06:12:02.990 UTC [163675] LOG:  database system is shut down

admin is the DB user and active_inventory_db is the database configured to be used in Spring boot application.

Any user also faced this issue? We are getting this issue every week now.

Thanks, Jayesh Jain

Jayesh
  • 141
  • 1
  • 7
  • How shall we figure out what on your machine sends a shutdown signal to PostgreSQL? – Laurenz Albe Oct 13 '22 at 14:32
  • It looks like you have been hacked. I don't know why the hacker wants to shut down your db, maybe to keep other hackers out? Or maybe it is not done intentionally. – jjanes Oct 13 '22 at 14:40
  • @jjanes Only 80 and 443 port are open and 5432 port is accepting connection from only Docker Internal IP which is also deployed on the same machine? How else can the machine be hacked? – Jayesh Oct 17 '22 at 13:26
  • The 4th line of the logging output says it *is* open to the internet. How else would that log entry get there? – jjanes Oct 17 '22 at 15:41
  • I'm facing the same issue. Did you find any solution @Jayesh ? – Sriram Jun 15 '23 at 12:36

0 Answers0