Page 1 of 1

Run the following from the CLI as root to attempt to repair

Posted: Fri Jan 23, 2015 1:17 pm
by cwireless
Hi,
We have this configuration:
Red Hat Enterprise Linux Server release 5.3; 32 bit; VMWare Image of NagiosXI; No special configurations.Using Internet Explorer.

We recently upgraded to version R2.4 and we received this error below.

Code: Select all

Message: A database connection error has been detected, we are attempting to repair the server, if the repair does not resolve the issue, please contact Nagios support.

Run the following from the CLI as root to attempt to repair the DB

/usr/local/nagiosxi/scripts/repair_databases.sh
Message: A database connection error has been detected, we are attempting to repair the server, if the repair does not resolve the issue, please contact Nagios support.

Run the following from the CLI as root to attempt to repair the DB

/usr/local/nagiosxi/scripts/repair_databases.sh
SQL: SQL Error [nagiosxi] : Database connection failed SQL: SQL Error [nagiosxi] : Database connection failed SQL: SQL Error [nagiosxi] : Database connection failedMessage: A database connection error has been detected, we are attempting to repair the server, if the repair does not resolve the issue, please contact Nagios support.

Run the following from the CLI as root to attempt to repair the DB

/usr/local/nagiosxi/scripts/repair_databases.sh
we tried to rollback to version R2.3 and then we got this message

Code: Select all

-bash-3.2$ psql nagiosxi nagiosxi
psql: FATAL:  database is not accepting commands to avoid wraparound data loss in database "nagiosxi"
HINT:  Stop the postmaster and use a standalone backend to vacuum database "nagiosxi".
-bash-3.2$

First we receive a message about 1 million transactions, when it finished, then the BD started to display 4,294,896,293 transactions. Now the error still remains

Re: Run the following from the CLI as root to attempt to rep

Posted: Fri Jan 23, 2015 2:20 pm
by lgroschen
Did you attempt to run the repair script before rolling back?

Re: Run the following from the CLI as root to attempt to rep

Posted: Fri Jan 23, 2015 2:28 pm
by cwireless
Yes, in that moment did not work either, so we decided to rollback.

Re: Run the following from the CLI as root to attempt to rep

Posted: Fri Jan 23, 2015 3:04 pm
by slansing
Okay, so what exactly did you do to roll it back? That may have caused additional issues, if you can let us know the steps you took, that will help us get to the resolution faster. Thanks!

Re: Run the following from the CLI as root to attempt to rep

Posted: Fri Jan 23, 2015 3:21 pm
by cwireless
First we executed the repair script.

For the rollback, we followed the bacuk and restore procedure(PDF) and we try to restore a backup from January 21st. And the error was displayed

/usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/1421895603.tar.gz

Code: Select all

-rw-r--r-- 1 nagios nagios 694744895 Jan 20 22:03 1421809202.tar.gz
-rw-r--r-- 1 nagios nagios 691407262 Jan 21 22:03 1421895603.tar.gz

Re: Run the following from the CLI as root to attempt to rep

Posted: Fri Jan 23, 2015 4:32 pm
by cwireless
So far this is what we are doing.

Code: Select all

WARNING:  database "nagiosxi" must be vacuumed within 4289025932 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025931 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025930 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025929 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025928 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025927 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  some databases have not been vacuumed in over 1 billion transactions
HINT:  Better vacuum them soon, or you may have a wraparound failure.
WARNING:  database "nagiosxi" must be vacuumed within 4289025926 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
backend> WARNING:  database "nagiosxi" must be vacuumed within 4289025926 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025925 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025924 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025923 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025922 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025921 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025920 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025919 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025918 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025917 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025916 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025915 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025914 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025913 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025912 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025911 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025910 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025909 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025908 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025907 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025906 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025905 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025904 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025903 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025902 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "nagiosxi".
WARNING:  database "nagiosxi" must be vacuumed within 4289025901 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "

Re: Run the following from the CLI as root to attempt to rep

Posted: Fri Jan 23, 2015 7:44 pm
by Box293
Try these commands:

Code: Select all

service postgresql stop
su postgres
echo "VACUUM FULL;" > /tmp/fix.sql
postgres -D /var/lib/pgsql/data nagiosxi < /tmp/fix.sql
postgres -D /var/lib/pgsql/data postgres < /tmp/fix.sql
postgres -D /var/lib/pgsql/data template1 < /tmp/fix.sql
exit
service postgresql start

Re: Run the following from the CLI as root to attempt to rep

Posted: Sat Jan 24, 2015 7:22 am
by cwireless
Box293 wrote:Try these commands:

Code: Select all

service postgresql stop
su postgres
echo "VACUUM FULL;" > /tmp/fix.sql
postgres -D /var/lib/pgsql/data nagiosxi < /tmp/fix.sql
postgres -D /var/lib/pgsql/data postgres < /tmp/fix.sql
postgres -D /var/lib/pgsql/data template1 < /tmp/fix.sql
exit
service postgresql start

Greattttt!!!!!!! It worked like a charm.........

Thanks guys for your support...

Saludos.

Re: Run the following from the CLI as root to attempt to rep

Posted: Mon Jan 26, 2015 10:07 am
by tgriep
Glad it is fixed. We'll close the post for you.