Re: PostgreSQL 12 service failing in Ubuntu 20.04 after a few hours

From: Antonis Christodoulou <christan305(at)hotmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: PostgreSQL 12 service failing in Ubuntu 20.04 after a few hours
Date: 2023-01-01 21:11:19
Message-ID: PR3P193MB05084A74EA9F0EB86CCF1C90E1F69@PR3P193MB0508.EURP193.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello Adrian,

No it’s not open, but the database itself has very simple credentials (I am just starting with PostgreSQL). What’s weird about the logs?

> On 1 Jan 2023, at 11:00 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
>
> On 1/1/23 12:51, Antonis Christodoulou wrote:
>> Hi,
>> I have set up PostgreSQL according to this link:
>> https://www.cherryservers.com/blog/how-to-install-and-setup-postgresql-server-on-ubuntu-20-04 <https://www.cherryservers.com/blog/how-to-install-and-setup-postgresql-server-on-ubuntu-20-04> <https://www.cherryservers.com/blog/how-to-install-and-setup-postgresql-server-on-ubuntu-20-04 <https://www.cherryservers.com/blog/how-to-install-and-setup-postgresql-server-on-ubuntu-20-04>>
>> The issue is that after a few hours of operation, even if I don’t access the database at all, the Postgres process fails:
>> *christan(at)vultr*:*~*$ systemctl status postgresql*
>> *●*postgresql.service - PostgreSQL RDBMS
>> Loaded: loaded (/lib/systemd/system/postgresql.service; disabled; vendor preset: enabled)
>> Active: *active (exited)*since Sat 2022-12-31 19:56:56 UTC; 24h ago
>> Process: 3330722 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
>> Main PID: 3330722 (code=exited, status=0/SUCCESS)
>> *●*postgresql(at)12-main(dot)service <mailto:postgresql(at)12-main(dot)service> <mailto:postgresql(at)12-main(dot)service <mailto:postgresql(at)12-main(dot)service>> - PostgreSQL Cluster 12-main
>> Loaded: loaded (/lib/systemd/system/postgresql(at)(dot)service; enabled-runtime; vendor preset: enabled)
>> Active: *failed*(Result: exit-code) since Sat 2022-12-31 21:33:52 UTC; 23h ago
>> Process: 3330697 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 12-main start (code=exited, status=0/SUCCESS)
>> Process: 3341739 ExecStop=/usr/bin/pg_ctlcluster --skip-systemctl-redirect -m fast 12-main stop *(code=exited, status=2)*
>> Main PID: 3330702 (code=exited, status=0/SUCCESS)
>> Moreover, it looks like there is some process stuck into some eternal loop, eating up 4 cores:
>> *christan(at)vultr*:*~*$ ps -ef | grep postgres
>> *postgres*3342383 1 0 2022 ? 00:00:00 FzXlkULu
>> *postgres*3344758 1 99 2022 ? 3-14:39:11 OElid7Dp
>> *postgres*3419125 1 18 13:57 ? 01:17:03 tracepath
>> christan 3463982 3462489 0 20:44 pts/0 00:00:00 grep --color=auto *postgres*
>
> The above and the below look weird.
>
> Is this machine open to the world?
>
>> *
>> *
>> *christan(at)vultr*:*~*$ top -p 3344758
>> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
>> 3344758 postgres 20 0 2443428 2.3g 4 S 282.3 29.5 5201:46 OElid7Dp
>> Doing just systemctl postgresql doesn’t restart the process, I have to manually kill all the above processes then do systemctl restart.
>> Lastly, in the journalctl I see the following logs:
>> Dec 31 21:33:35 vultr.guest sudo[3340093]: *pam_unix(sudo:auth): co**nversation failed*
>> Dec 31 21:33:35 vultr.guest sudo[3340093]: *pam_unix(sudo:auth): auth could not identify password for [postgres]*
>> Dec 31 21:33:35 vultr.guest sudo[3340093]: *postgres : user NOT in sudoers ; TTY=unknown ; PWD=/var/lib/postgresql/12/main ; USER=root ; COMMAND=/usr/sbin/sysctl kernel.nmi_watchdog=0*
>> Dec 31 21:33:52 vultr.guest crontab[3341582]: (postgres) LIST (postgres)
>> Dec 31 21:33:52 vultr.guest crontab[3341584]: (postgres) REPLACE (postgres)
>> Dec 31 21:33:52 vultr.guest crontab[3341585]: (postgres) LIST (postgres)
>> Dec 31 21:33:52 vultr.guest crontab[3341588]: (postgres) LIST (postgres)
>> What am I missing here, maybe I have to make sure that postgres user has sudo rights?
>> Regards,
>> Antonis
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2023-01-01 21:48:17 Re: PostgreSQL 12 service failing in Ubuntu 20.04 after a few hours
Previous Message Adrian Klaver 2023-01-01 21:00:10 Re: PostgreSQL 12 service failing in Ubuntu 20.04 after a few hours