Page 1 of 1

A database connection error has been detected

Posted: Sun Jul 12, 2015 2:31 pm
by pfsweb
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

Tried running this script, no change. Also tried restarting both the database and nagiosxi servers

output from /var/log/httpd/error_log
[Sun Jul 12 14:59:27 2015] [error] [client 10.x.x.x] PHP Warning: pg_pconnect(): Unable to connect to PostgreSQL server: FATAL: connection limit exceeded for non-superusers in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-postgres64.inc.php on line 682, referer: http://nagiosxi.address.com/nagiosxi/
[Sun Jul 12 14:59:27 2015] [error] [client 10.x.x.x] PHP Notice: Undefined variable: result in /usr/local/nagiosxi/html/includes/db.inc.php on line 241, referer: http://nagiosxi.address.com/nagiosxi/

Re: A database connection error has been detected

Posted: Sun Jul 12, 2015 7:48 pm
by Box293
Is postgresql running?

Code: Select all

service postgresql status
The logs are named by the day, , for example postgresql-Mon.log
Can you please run this command for the most recent log:

Code: Select all

tail -n 100 /var/lib/pgsql/data/pg_log/postgresql-Mon.log
And also:

Code: Select all

tail /var/log/messages -n 100
Post the results here in a code block.

Re: A database connection error has been detected

Posted: Fri Oct 23, 2015 9:48 am
by pfsweb
Was this ever resolved? I'm actually having the same issue.

Re: A database connection error has been detected

Posted: Fri Oct 23, 2015 11:19 am
by hsmith
I think that is a question that only the original author of the topic can answer. ;)

Have these steps been done?
Box293 wrote:Is postgresql running?

Code: Select all

service postgresql status
The logs are named by the day, , for example postgresql-Mon.log
Can you please run this command for the most recent log:

Code: Select all

tail -n 100 /var/lib/pgsql/data/pg_log/postgresql-Mon.log
And also:

Code: Select all

tail /var/log/messages -n 100
Post the results here in a code block.

Re: A database connection error has been detected

Posted: Fri Oct 23, 2015 1:10 pm
by pfsweb
# service postgresql status
postmaster (pid 1914) is running...


# tail -n 100 /var/lib/pgsql/data/pg_log/postgresql-Mon.log
FATAL: connection limit exceeded for non-superusers
FATAL: connection limit exceeded for non-superusers
FATAL: connection limit exceeded for non-superusers
FATAL: connection limit exceeded for non-superusers
FATAL: connection limit exceeded for non-superusers
FATAL: connection limit exceeded for non-superusers
FATAL: connection limit exceeded for non-superusers
FATAL: connection limit exceeded for non-superusers

Re: A database connection error has been detected

Posted: Fri Oct 23, 2015 1:21 pm
by lmiltchev
Have you tried increasing the default "max_connections" value of 100 in the "/var/lib/pgsql/data/postgresql.conf", i.e.

Code: Select all

max_connections = 200
and restarting the posgresql?

Code: Select all

service postgresql restart

Re: A database connection error has been detected

Posted: Fri Oct 23, 2015 1:29 pm
by pfsweb
I did some research on the error message after I posted the results and found I could increase the limit. I have done so only a few minutes ago. I haven't seen any DB Connection errors since but it may be too early to tell.

Re: A database connection error has been detected

Posted: Fri Oct 23, 2015 2:15 pm
by jdalrymple
We'll leave the ticket open. Reach back out if the problem recurs.