Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pC5RS-0001Tt-8p for pgsql-general@arkaria.postgresql.org; Sun, 01 Jan 2023 21:00:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pC5RR-0005M0-7h for pgsql-general@arkaria.postgresql.org; Sun, 01 Jan 2023 21:00:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pC5RP-0005Ln-I6 for pgsql-general@lists.postgresql.org; Sun, 01 Jan 2023 21:00:24 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pC5RH-0006vF-0B for pgsql-general@lists.postgresql.org; Sun, 01 Jan 2023 21:00:23 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 868C032004AE; Sun, 1 Jan 2023 16:00:11 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 01 Jan 2023 16:00:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1672606811; x= 1672693211; bh=il77J4GYHa0DR7BeHkCujiaxG8KB2to7Y8E6Bzb3tmI=; b=b SEkbyoWVjBQDDrtTbcaDw2/yzEdCp/UqT8bp7skInZnwRE4tGqUWzOx/AmZh1462 qYFrcgevLdjJ4oEo50VfFlYPROb4OaywACov3G0pHUuWJtsdzxmhIYKXbxfiv5lz f6CrB4MIfTHtn7piaeEvC9xwlKnQ1QbrX0MwtYTYt58FYRs7HKY09B+bm2NR43m1 ztAbmvKoIiMFzjMYlDGyhtT/GqCG51uB0HHYOZu4MUVloENy2cxCSjLaBYGR71fZ oUX0M7TJqTHxMjtuXg2YDaIk4LvcsHKT/7w0fptymuBDGbsQM9BWZ2k33cB38PV3 mDCZIQvRrvpVPhPD6DIKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1672606811; x=1672693211; bh=i l77J4GYHa0DR7BeHkCujiaxG8KB2to7Y8E6Bzb3tmI=; b=HQ27W1oQvhcCp3L8s /maExsZA/qD4L1wsyiOoP+EU+jCDcOVw362DKG5PAoJiMHOCQD/5dDaFMGIdcaz3 Jrvk4Cf6gFfWD/XI91CWU+wsexlgfn2qf4OyFr7QTvyeQweU8DXH8M7p3Qi0qK3L Ifi1Nz6gdrHjrjnT6saJPiTSL6oZYlPznLgPRUg0NrnpiMU0dubhT/xX4EwWVKDx 1XkYpiCEw6GEN/pGZrzpa+SY0AO1Lm66d5an/PW2/+heD8lG0eofkN/aj1KaEp77 DpVCWMLmnPjMUZdBFtm7tHWPBWDMdZgN8hF9mC6YFmz4apozzQKBpldt9H9/CEXI q601w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrjedtgddugeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeehieffueejtdeutddvgfeigeffhfeuuedugfehgfek hfeiteefgfffgeffueekgfenucffohhmrghinheptghhvghrrhihshgvrhhvvghrshdrtg homhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegr ughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 1 Jan 2023 16:00:10 -0500 (EST) Message-ID: <25d1ff9d-62dd-3124-d6f6-55615ed90d85@aklaver.com> Date: Sun, 1 Jan 2023 13:00:10 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: PostgreSQL 12 service failing in Ubuntu 20.04 after a few hours Content-Language: en-US To: Antonis Christodoulou , pgsql-general@lists.postgresql.org References: From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 > > 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@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@12-main.service - > PostgreSQL Cluster 12-main >      Loaded: loaded (/lib/systemd/system/postgresql@.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@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@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.klaver@aklaver.com