Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1atYhf-0004jh-P9 for pgsql-admin@arkaria.postgresql.org; Fri, 22 Apr 2016 10:52:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1atYhf-0007Dg-6k for pgsql-admin@arkaria.postgresql.org; Fri, 22 Apr 2016 10:52:51 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1atYhe-0007DZ-F4 for pgsql-admin@postgresql.org; Fri, 22 Apr 2016 10:52:50 +0000 Received: from hub.ringways.co.uk ([88.211.105.30] helo=ringways.co.uk) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1atYhX-0000kq-0Q for pgsql-admin@postgresql.org; Fri, 22 Apr 2016 10:52:49 +0000 Received: from eddie.ringways.co.uk ([10.1.1.115]) by ringways.co.uk with esmtp (Exim 4.84) (envelope-from ) id 1atYhR-000PLm-Ma for pgsql-admin@postgresql.org; Fri, 22 Apr 2016 11:52:39 +0100 From: Gary Stainburn Organization: Ringways Garages Ltd To: pgsql-admin@postgresql.org Subject: Re: Server deleted then restored - now postgresql will not start Date: Fri, 22 Apr 2016 11:52:37 +0100 User-Agent: KMail/1.9.10 References: <201604221010.51228.gary.stainburn@ringways.co.uk> In-Reply-To: <201604221010.51228.gary.stainburn@ringways.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201604221152.37943.gary.stainburn@ringways.co.uk> X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 95121 [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: 4089181, 4089203, 4089166 X-KLMS-AntiSpam-Info: LuaCore: 443 443 53dc0f3cc06fd1110ee5e04b0f455b6759fbb4e4, {msgid_created_by_recepient}, ringways.co.uk:7.1.1;www.ringways.co.uk:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;eddie.ringways.co.uk:7.1.1;127.0.0.199:7.1.2 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: I've restored from the backup and everything is now working again On Friday 22 April 2016 10:10:51 Gary Stainburn wrote: > 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, [...] 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.4764] 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 I've restored from the backup and everything is now working again On Friday 22 April 2016 10:10:51 Gary Stainburn wrote: > 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]# -- Gary Stainburn Group I.T. Manager Ringways Garages http://www.ringways.co.uk -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin