Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1atX8l-0005G9-Uy for pgsql-admin@arkaria.postgresql.org; Fri, 22 Apr 2016 09:12:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1atX8l-0008SA-8K for pgsql-admin@arkaria.postgresql.org; Fri, 22 Apr 2016 09:12:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1atX73-0006aa-Ne for pgsql-admin@postgresql.org; Fri, 22 Apr 2016 09:10:57 +0000 Received: from hub.ringways.co.uk ([88.211.105.30] helo=ringways.co.uk) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1atX70-0004lA-Cb for pgsql-admin@postgresql.org; Fri, 22 Apr 2016 09:10:57 +0000 Received: from eddie.ringways.co.uk ([10.1.1.115]) by ringways.co.uk with esmtp (Exim 4.84) (envelope-from ) id 1atX6w-000M3k-W6 for pgsql-admin@postgresql.org; Fri, 22 Apr 2016 10:10:52 +0100 From: Gary Stainburn Organization: Ringways Garages Ltd To: "pgsql-admin" Subject: Server deleted then restored - now postgresql will not start Date: Fri, 22 Apr 2016 10:10:51 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201604221010.51228.gary.stainburn@ringways.co.uk> X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 95120 [Apr 22 2016] X-KLMS-AntiSpam-Version: 5.5.9.33 X-KLMS-AntiSpam-Envelope-From: gary.stainburn@ringways.co.uk X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Moebius-Timestamps: 4089032, 4089051, 4088439 X-KLMS-AntiSpam-Info: LuaCore: 443 443 53dc0f3cc06fd1110ee5e04b0f455b6759fbb4e4, {msgid_created_by_recepient}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;eddie.ringways.co.uk:7.1.1;127.0.0.199:7.1.2;ringways.co.uk:7.1.1 X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, 2016/04/21 10:15:09 X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, bases: 2016/04/22 00:57:00 #7629469 X-KLMS-AntiVirus-Status: Clean, skipped X-Spam-Score: -49.1 (-------------------------------------------------) X-Spam-Report: Spam detection software, running on the system "ollie2.ringways.co.uk", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see Gary Stainburn for details. Content preview: 123-REG have had a problem where some virtual servers were accidentally deleted. My server has finally been restores, but now my Postgresql service will not start. systemctl start postgresql returns a failed state. Both of the following commands gave nothing useful. [...] Content analysis details: (-49.1 points, 15.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -50 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.1 SCORE_RCPTS Adding score for each recipient -1.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.5000] 1.0 RING_SAFE No description available. X-forward-disable: yes X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org 123-REG have had a problem where some virtual servers were accidentally deleted. My server has finally been restores, but now my Postgresql service will not start. systemctl start postgresql returns a failed state. Both of the following commands gave nothing useful. systemctl status postgresql journalctl -xn The only helpful information I have found is the log file below. Firstly, I do not want to make the situation worse, but I need to get the service fixed. Can anyone suggest the steps I need to take, or a suitable web page to read. Gary [root@vps42342322 pg_log]# cat postgresql-Fri.log ERROR: duplicate key value violates unique constraint "forum_topics_posted_pkey" DETAIL: Key (user_id, topic_id)=(2, 306) already exists. STATEMENT: INSERT INTO forum_topics_posted (user_id, topic_id, topic_posted) VALUES (2, 306, 1) ERROR: duplicate key value violates unique constraint "forum_topics_posted_pkey" DETAIL: Key (user_id, topic_id)=(2, 306) already exists. STATEMENT: INSERT INTO forum_topics_posted (user_id, topic_id, topic_posted) VALUES (2, 306, 1) ERROR: duplicate key value violates unique constraint "forum_topics_posted_pkey" DETAIL: Key (user_id, topic_id)=(152, 306) already exists. STATEMENT: INSERT INTO forum_topics_posted (user_id, topic_id, topic_posted) VALUES (152, 306, 1) ERROR: duplicate key value violates unique constraint "forum_topics_posted_pkey" DETAIL: Key (user_id, topic_id)=(51, 68) already exists. STATEMENT: INSERT INTO forum_topics_posted (user_id, topic_id, topic_posted) VALUES (51, 68, 1) ERROR: duplicate key value violates unique constraint "forum_topics_posted_pkey" DETAIL: Key (user_id, topic_id)=(2, 306) already exists. STATEMENT: INSERT INTO forum_topics_posted (user_id, topic_id, topic_posted) VALUES (2, 306, 1) ERROR: duplicate key value violates unique constraint "forum_topics_posted_pkey" DETAIL: Key (user_id, topic_id)=(129, 306) already exists. STATEMENT: INSERT INTO forum_topics_posted (user_id, topic_id, topic_posted) VALUES (129, 306, 1) FATAL: the database system is starting up FATAL: the database system is starting up LOG: database system was interrupted; last known up at 2016-04-16 07:10:08 BST FATAL: the database system is starting up FATAL: the database system is starting up FATAL: the database system is starting up FATAL: the database system is starting up LOG: could not open file "pg_xlog/00000001000000040000003E" (log file 4, segment 62): No such file or directory LOG: invalid primary checkpoint record LOG: could not open file "pg_xlog/00000001000000040000003E" (log file 4, segment 62): No such file or directory LOG: invalid secondary checkpoint record PANIC: could not locate a valid checkpoint record LOG: startup process (PID 670) was terminated by signal 6: Aborted LOG: aborting startup due to startup process failure LOG: database system was interrupted; last known up at 2016-04-16 07:10:08 BST LOG: could not open file "pg_xlog/00000001000000040000003E" (log file 4, segment 62): No such file or directory LOG: invalid primary checkpoint record LOG: could not open file "pg_xlog/00000001000000040000003E" (log file 4, segment 62): No such file or directory LOG: invalid secondary checkpoint record PANIC: could not locate a valid checkpoint record LOG: startup process (PID 1922) was terminated by signal 6: Aborted LOG: aborting startup due to startup process failure LOG: database system was interrupted; last known up at 2016-04-16 07:10:08 BST LOG: could not open file "pg_xlog/00000001000000040000003E" (log file 4, segment 62): No such file or directory LOG: invalid primary checkpoint record LOG: could not open file "pg_xlog/00000001000000040000003E" (log file 4, segment 62): No such file or directory LOG: invalid secondary checkpoint record PANIC: could not locate a valid checkpoint record LOG: startup process (PID 2072) was terminated by signal 6: Aborted LOG: aborting startup due to startup process failure LOG: database system was interrupted; last known up at 2016-04-16 07:10:08 BST LOG: could not open file "pg_xlog/00000001000000040000003E" (log file 4, segment 62): No such file or directory LOG: invalid primary checkpoint record LOG: could not open file "pg_xlog/00000001000000040000003E" (log file 4, segment 62): No such file or directory LOG: invalid secondary checkpoint record PANIC: could not locate a valid checkpoint record LOG: startup process (PID 2098) was terminated by signal 6: Aborted LOG: aborting startup due to startup process failure LOG: database system was interrupted; last known up at 2016-04-16 07:10:08 BST LOG: could not open file "pg_xlog/00000001000000040000003E" (log file 4, segment 62): No such file or directory LOG: invalid primary checkpoint record LOG: could not open file "pg_xlog/00000001000000040000003E" (log file 4, segment 62): No such file or directory LOG: invalid secondary checkpoint record PANIC: could not locate a valid checkpoint record LOG: startup process (PID 2123) was terminated by signal 6: Aborted LOG: aborting startup due to startup process failure [root@vps45624564 pg_log]# -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin