Thread: Server deleted then restored - now postgresql will not start

Server deleted then restored - now postgresql will not start

From
Gary Stainburn
Date:
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]#


Re: Server deleted then restored - now postgresql will not start

From
Gary Stainburn
Date:
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