Page 1 of 2
fail to upgrade to the latest with DB error
Posted: Thu Jan 23, 2020 10:28 pm
by iwang
we have a nagios database in different machine, during the nagios upgrade, we got error:
——
Code: Select all
Sourceguardian extension already in php.ini
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using scclnagiosxi01.dvms.local for ServerName
[ OK ]
PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PST/-8.0/no DST' instead in /tmp/nagiosxi/nagiosxi/basedir/html/includes/components/xicore/dashlets.inc.php on line 35
PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PST/-8.0/no DST' instead in /tmp/nagiosxi/nagiosxi/basedir/html/includes/dashlets/internettrafficreport/internettrafficreport.inc.php on line 19
PHP Fatal error: Uncaught exception 'Exception' with message 'A database connection error has been detected, please follow the repair prompt below. If the issue persists, please contact Nagios support.' in /tmp/nagiosxi/nagiosxi/basedir/html/includes/db.inc.php:321
Stack trace:
#0 /tmp/nagiosxi/verify-prereqs.php(0): db_connect('nagiosxi')
#1 /tmp/nagiosxi/verify-prereqs.php(2): sg_load('52C4625F2E33770...')
#2 {main}
thrown in /tmp/nagiosxi/nagiosxi/basedir/html/includes/db.inc.php on line 321
and then the service is down!!
please help asap. it's production env. and please advice for the upgrade guide in this situation.
Re: fail to upgrade to the latest with DB error
Posted: Fri Jan 24, 2020 8:47 am
by scottwilkerson
Can you show the output of the following on the XI server:
Re: fail to upgrade to the latest with DB error
Posted: Fri Jan 24, 2020 12:34 pm
by iwang
as it's monitoring all prod so i have to revert the system to old snapshot for recovering so i lost the trace already.
regarding to this issue, what we observed are:
during the upgrade, it complains installed php-common-5.3.3-49.el6_6.x86_64, but looking for php-common-5.3.3-46.el6_6.x86_64, so we uninstalled php and reinstalled then got the error. that should be the root cause. but wondering why it complains the php version.
besides, we had a standby nagios server setup, where is the guide to have two cluster setup with one backend DB?
Re: fail to upgrade to the latest with DB error
Posted: Fri Jan 24, 2020 1:04 pm
by iwang
here is the output of date.timezone
-bash-4.1# grep date.timezone /etc/php.ini
;
http://www.php.net/manual/en/datetime.c ... e.timezone
date.timezone = America/Los_Angeles
Re: fail to upgrade to the latest with DB error
Posted: Fri Jan 24, 2020 3:58 pm
by scottwilkerson
It looks like the php date.timezone matches now, are you still getting the errors above?
Re: fail to upgrade to the latest with DB error
Posted: Fri Jan 24, 2020 5:01 pm
by iwang
I still am blocked here:
Code: Select all
Loading mirror speeds from cached hostfile
* epel: mirror.sfo12.us.leaseweb.net
Resolving Dependencies
--> Running transaction check
---> Package php-imap.x86_64 0:5.3.3-46.el6_7.1 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-46.el6_7.1 for package: php-imap-5.3.3-46.el6_7.1.x86_64
--> Processing Dependency: libc-client.so.2007()(64bit) for package: php-imap-5.3.3-46.el6_7.1.x86_64
--> Running transaction check
---> Package libc-client.x86_64 0:2007e-11.el6 will be installed
---> Package php-imap.x86_64 0:5.3.3-46.el6_7.1 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-46.el6_7.1 for package: php-imap-5.3.3-46.el6_7.1.x86_64
--> Finished Dependency Resolution
Error: Package: php-imap-5.3.3-46.el6_7.1.x86_64 (updates)
Requires: php-common(x86-64) = 5.3.3-46.el6_7.1
Installed: php-common-5.3.3-49.el6.x86_64 (@base)
php-common(x86-64) = 5.3.3-49.el6
Available: php-common-5.3.3-40.el6_6.x86_64 (base)
php-common(x86-64) = 5.3.3-40.el6_6
Available: php-common-5.3.3-46.el6_6.x86_64 (updates)
php-common(x86-64) = 5.3.3-46.el6_6
Available: php-common-5.3.3-46.el6_7.1.x86_64 (updates)
php-common(x86-64) = 5.3.3-46.el6_7.1
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Uploading Enabled Repositories Report
Loaded plugins: fastestmirror, product-id
Unable to upload Enabled Repositories Report
Re: fail to upgrade to the latest with DB error
Posted: Fri Jan 24, 2020 5:05 pm
by iwang
in case you need more information from yum command, here it is:
Code: Select all
-bash-4.1# yum info php-common
Loaded plugins: enabled_repos_upload, fastestmirror, package_upload, product-id, security, subscription-manager
tlsv1 alert unknown ca
Loading mirror speeds from cached hostfile
* epel: mirrors.sonic.net
Installed Packages
Name : php-common
Arch : x86_64
Version : 5.3.3
Release : 49.el6
Size : 2.9 M
Repo : installed
From repo : base
Summary : Common files for PHP
URL : http://www.php.net/
License : PHP
Description : The php-common package contains files used by both the php
: package and the php-cli package.
Uploading Enabled Repositories Report
Loaded plugins: fastestmirror, product-id
Unable to upload Enabled Repositories Report
-bash-4.1# yum repolist all
Loaded plugins: enabled_repos_upload, fastestmirror, package_upload, product-id, security, subscription-manager
tlsv1 alert unknown ca
Loading mirror speeds from cached hostfile
* epel: mirrors.sonic.net
repo id repo name status
C6.0-base CentOS-6.0 - Base disabled
C6.0-centosplus CentOS-6.0 - CentOSPlus disabled
C6.0-contrib CentOS-6.0 - Contrib disabled
C6.0-extras CentOS-6.0 - Extras disabled
C6.0-updates CentOS-6.0 - Updates disabled
C6.1-base CentOS-6.1 - Base disabled
C6.1-centosplus CentOS-6.1 - CentOSPlus disabled
C6.1-contrib CentOS-6.1 - Contrib disabled
C6.1-extras CentOS-6.1 - Extras disabled
C6.1-updates CentOS-6.1 - Updates disabled
C6.2-base CentOS-6.2 - Base disabled
C6.2-centosplus CentOS-6.2 - CentOSPlus disabled
C6.2-contrib CentOS-6.2 - Contrib disabled
C6.2-extras CentOS-6.2 - Extras disabled
C6.2-updates CentOS-6.2 - Updates disabled
C6.3-base CentOS-6.3 - Base disabled
C6.3-centosplus CentOS-6.3 - CentOSPlus disabled
C6.3-contrib CentOS-6.3 - Contrib disabled
C6.3-extras CentOS-6.3 - Extras disabled
C6.3-updates CentOS-6.3 - Updates disabled
C6.4-base CentOS-6.4 - Base disabled
C6.4-centosplus CentOS-6.4 - CentOSPlus disabled
C6.4-contrib CentOS-6.4 - Contrib disabled
C6.4-extras CentOS-6.4 - Extras disabled
C6.4-updates CentOS-6.4 - Updates disabled
C6.5-base CentOS-6.5 - Base disabled
C6.5-centosplus CentOS-6.5 - CentOSPlus disabled
C6.5-contrib CentOS-6.5 - Contrib disabled
C6.5-extras CentOS-6.5 - Extras disabled
C6.5-updates CentOS-6.5 - Updates disabled
C6.6-base CentOS-6.6 - Base disabled
C6.6-centosplus CentOS-6.6 - CentOSPlus disabled
C6.6-contrib CentOS-6.6 - Contrib disabled
C6.6-extras CentOS-6.6 - Extras disabled
C6.6-updates CentOS-6.6 - Updates disabled
base CentOS-6 - Base enabled: 6,575
base-debuginfo CentOS-6 - Debuginfo disabled
c6-media CentOS-6 - Media disabled
centosplus CentOS-6 - Plus disabled
cr CentOS-6 - CR enabled: 0
datadog Datadog, Inc. enabled: 6
epel Extra Packages for Enterprise Linux 6 - x86_64 enabled: 12,584
epel-debuginfo Extra Packages for Enterprise Linux 6 - x86_64 - Debug disabled
epel-source Extra Packages for Enterprise Linux 6 - x86_64 - Source disabled
extras CentOS-6 - Extras enabled: 50
fasttrack CentOS-6 - fasttrack disabled
updates CentOS-6 - Updates enabled: 1,263
repolist: 20,478
Uploading Enabled Repositories Report
Loaded plugins: fastestmirror, product-id
Unable to upload Enabled Repositories Report
-bash-4.1# ls -l /etc/yum.repos.d
total 52
-rw-r--r-- 1 root root 509 Sep 25 2011 CentOS-CR.repo
-rw-r--r-- 1 root root 647 Aug 3 2015 CentOS-Debuginfo.repo
-rw-r--r-- 1 root root 289 Aug 3 2015 CentOS-fasttrack.repo
-rw-r--r-- 1 root root 630 Aug 3 2015 CentOS-Media.repo
-rw-r--r-- 1 root root 6259 Aug 3 2015 CentOS-Vault.repo
-rw-r--r-- 1 root root 197 Jan 17 11:07 datadog.repo
-rw-r--r-- 1 root root 954 Jan 24 13:57 epel.repo
-rw-r--r-- 1 root root 1056 Nov 4 2012 epel-testing.repo.old
-rw-r--r-- 1 root root 1680 Mar 17 2016 local.repo
-rw-r--r-- 1 root root 301 Jan 19 2015 nagios-6.repo.old
-rw-r--r-- 1 root root 2575 Jan 24 13:58 redhat.repo-bk
-rw-r--r-- 1 root root 2566 Jan 24 13:59 redhat.repo-new
Re: fail to upgrade to the latest with DB error
Posted: Sat Jan 25, 2020 12:42 am
by iwang
using offline tarball to upgrade, i got below exceptions:
Code: Select all
---> Package sqlite.i686 0:3.6.20-1.el6_7.2 will be installed
--> Finished Dependency Resolution
Error: Package: php-imap-5.3.3-46.el6_7.1.x86_64 (updates)
Requires: php-common(x86-64) = 5.3.3-46.el6_7.1
Installed: php-common-5.3.3-49.el6.x86_64 (@base)
php-common(x86-64) = 5.3.3-49.el6
Available: php-common-5.3.3-40.el6_6.x86_64 (base)
php-common(x86-64) = 5.3.3-40.el6_6
Available: php-common-5.3.3-46.el6_6.x86_64 (updates)
php-common(x86-64) = 5.3.3-46.el6_6
Available: php-common-5.3.3-46.el6_7.1.x86_64 (updates)
php-common(x86-64) = 5.3.3-46.el6_7.1
Error: Package: php-devel-5.3.3-46.el6_7.1.x86_64 (updates)
Requires: php(x86-64) = 5.3.3-46.el6_7.1
Installed: php-5.3.3-49.el6.x86_64 (@base)
php(x86-64) = 5.3.3-49.el6
Available: php-5.3.3-40.el6_6.x86_64 (base)
php(x86-64) = 5.3.3-40.el6_6
Available: php-5.3.3-46.el6_6.x86_64 (updates)
php(x86-64) = 5.3.3-46.el6_6
Available: php-5.3.3-46.el6_7.1.x86_64 (updates)
php(x86-64) = 5.3.3-46.el6_7.1
Error: Package: 4:perl-libs-5.10.1-141.el6_7.1.i686 (updates)
Requires: perl = 4:5.10.1-141.el6_7.1
Installed: 4:perl-5.10.1-144.el6.x86_64 (@base)
perl = 4:5.10.1-144.el6
Available: 4:perl-5.10.1-141.el6.x86_64 (base)
perl = 4:5.10.1-141.el6
Available: 4:perl-5.10.1-141.el6_7.1.x86_64 (updates)
perl = 4:5.10.1-141.el6_7.1
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Uploading Enabled Repositories Report
Loaded plugins: fastestmirror, product-id
Unable to upload Enabled Repositories Report
Re: fail to upgrade to the latest with DB error
Posted: Sat Jan 25, 2020 12:45 am
by iwang
attaching the commandline i had issued for offline upgrade:
Code: Select all
tar xzf nagiosxi-5.6.10-1.el6.x86_64.tar.gz
cd nagiosxi
./upgrade
Re: fail to upgrade to the latest with DB error
Posted: Sat Jan 25, 2020 1:53 pm
by iwang
this exception was thrown when doing the ./upgrade directly from latest-xi package:
iwang wrote:we have a nagios database in different machine, during the nagios upgrade, we got error:
——
Sourceguardian extension already in php.ini
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using scclnagiosxi01.dvms.local for ServerName
[ OK ]
PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PST/-8.0/no DST' instead in /tmp/nagiosxi/nagiosxi/basedir/html/includes/components/xicore/dashlets.inc.php on line 35
PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PST/-8.0/no DST' instead in /tmp/nagiosxi/nagiosxi/basedir/html/includes/dashlets/internettrafficreport/internettrafficreport.inc.php on line 19
PHP Fatal error: Uncaught exception 'Exception' with message 'A database connection error has been detected, please follow the repair prompt below. If the issue persists, please contact Nagios support.' in /tmp/nagiosxi/nagiosxi/basedir/html/includes/db.inc.php:321
Stack trace:
#0 /tmp/nagiosxi/verify-prereqs.php(0): db_connect('nagiosxi')
#1 /tmp/nagiosxi/verify-prereqs.php(2): sg_load('52C4625F2E33770...')
#2 {main}
thrown in /tmp/nagiosxi/nagiosxi/basedir/html/includes/db.inc.php on line 321
and then the service is down!!
please help asap. it's production env. and please advice for the upgrade guide in this situation.