Server deleted then restored - now postgresql will not start

From: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
To: "pgsql-admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Server deleted then restored - now postgresql will not start
Date: 2016-04-22 09:10:51
Message-ID: 201604221010.51228.gary.stainburn@ringways.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)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(at)vps45624564 pg_log]#

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Albe Laurenz 2016-04-22 09:20:15 Re: pgadmin select slow than psql command much
Previous Message rajan 2016-04-22 04:12:33 Re: Partition table data are not found in the pg_dump backup