xi upgrade fails after upgrading to php 7.4 on RHEL8 system

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
BenCowan
Posts: 85
Joined: Thu Jul 28, 2011 11:34 am

xi upgrade fails after upgrading to php 7.4 on RHEL8 system

Post by BenCowan »

This is related to my recent question regarding how to upgrade php to 7.4, which is now locked:
https://support.nagios.com/forum/viewto ... 16&t=62768

After successfully upgrading to php 7.4, I attempted my first upgrade today. It failed due to what looks like problems with dependencies related to either the repos and/or the php version. Here is the log:

fatal: [shire]: FAILED! => changed=true
cmd: cd /tmp/nagiosxi; ./upgrade -n
delta: '0:00:14.953593'
end: '2021-06-12 11:07:59.790947'
msg: non-zero return code
rc: 1
start: '2021-06-12 11:07:44.837354'
stderr: |-
PHP Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /tmp/nagiosxi/nagiosxi/basedir/html/includes/phpmailer/PHPMailerAutoload.php on line 45
PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /tmp/nagiosxi/nagiosxi/basedir/html/includes/utils.inc.php on line 262
PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /tmp/nagiosxi/nagiosxi/basedir/html/includes/components/ldap_ad_integration/adLDAP/src/classes/adLDAPUsers.php on line 520
PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /tmp/nagiosxi/nagiosxi/basedir/html/includes/utils.inc.php on line 262
Error:
Problem: package php-imap-7.2.11-1.el8.x86_64 requires php-common < 7.3, but none of the providers can be installed
- conflicting requests
- package php-common-7.2.11-1.module+el8+2561+1aca3413.x86_64 is filtered out by modular filtering
- package php-common-7.2.11-2.module+el8.1.0+3202+af5476b9.x86_64 is filtered out by modular filtering
- package php-common-7.2.11-4.module+el8.1.0+4555+f5cb8e18.x86_64 is filtered out by modular filtering
- package php-common-7.2.24-1.module+el8.2.0+4601+7c76a223.x86_64 is filtered out by modular filtering
stderr_lines: <omitted>
stdout: |-
Nagios xi Upgrade Log
==========================
DATE: Sat Jun 12 11:07:45 PDT 2021

DISTRO INFO:
RedHatEnterpriseServer
8.4
x86_64


Archive: sourceguardian/ixed4.lin.x86-64.zip
inflating: /usr/lib64/php/modules/ixed.7.4.lin
Sourceguardian extension found for PHP version 7.4
Sourceguardian extension already in php.ini
Checking required prereqs...
Please wait...

OLD VERSION: 5803
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStre 30 MB/s | 30 MB 00:00
Red Hat CodeReady Linux Builder for RHEL 8 x86_ 12 MB/s | 5.3 MB 00:00
Red Hat Enterprise Linux 8 for x86_64 - BaseOS 55 MB/s | 33 MB 00:00
Red Hat Enterprise Linux 8 for x86_64 - Supplem 40 kB/s | 3.8 kB 00:00
Dependencies resolved.
Nothing to do.
Complete!
Updating Subscription Management repositories.
Last metadata expiration check: 0:00:05 ago on Sat 12 Jun 2021 11:07:52 AM PDT.
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

More info:
[root@shire:~]# php -v
PHP 7.4.6 (cli) (built: May 12 2020 08:09:15) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.6, Copyright (c), by Zend Technologies
[root@shire:~]# rpm -qa |grep php
php-common-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-gd-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-fpm-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-odbc-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-xml-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-mysqlnd-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-opcache-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-pgsql-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-process-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-json-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-devel-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-pear-1.10.12-1.module+el8.3.0+6678+b09f589e.noarch
php-pdo-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-ldap-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-cli-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-mbstring-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
php-snmp-7.4.6-4.module+el8.3.0+7002+2eb69d76.x86_64
BenCowan
Posts: 85
Joined: Thu Jul 28, 2011 11:34 am

Re: xi upgrade fails after upgrading to php 7.4 on RHEL8 sys

Post by BenCowan »

So, I was able to upgrade to 5.8.4, using the following commands, but this bypasses the need for php-imap, and I don't know how important that package is...

dnf config-manager --disable nagiosxi-deps
vi /tmp/nagiosxi/upgrade, and change the following line:
#yum install `yum list installed php*common* | grep php | awk -F "-" {'print $1'} | tail -1`-imap -y
yum install `yum list installed php*common* | grep php | awk -F "-" {'print $1'}` -y
dnf config-manager --enable nagiosxi-deps
...then restarting xi daemons
BenCowan
Posts: 85
Joined: Thu Jul 28, 2011 11:34 am

Re: xi upgrade fails after upgrading to php 7.4 on RHEL8 sys

Post by BenCowan »

Since I'm working off a snap-shotted VM, I decided to chuck the RHEL repo supplied php, and switch over to the remi-7.4 stream, and this resolved my problems with ( php-imap , php-pecl-ssh2 ). I will be asking our RedHat Administrator permission to go this route, but I'm not sure what he'll say. He specifically told me a couple of weeks ago to NOT DO THIS. :D
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: xi upgrade fails after upgrading to php 7.4 on RHEL8 sys

Post by ssax »

The old PHP 7.2 packages must've still been installed if yum was failing on it. Or if the weren't maybe the cache was messed up for dnf/yum. You can try doing this before:

Code: Select all

yum clean all
I'm going to try to replicate this.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: xi upgrade fails after upgrading to php 7.4 on RHEL8 sys

Post by ssax »

This seems to be because the php-imap package isn't available in the standard repos and the only version that nagiosxi-deps has is php 7.2 so that won't work. That's likely why remi works as they have a replacement package for it.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: xi upgrade fails after upgrading to php 7.4 on RHEL8 sys

Post by ssax »

You may need to reach out to RHEL on this to see if they can provide an official php-imap 7.4 package and a compatible version of php-pecl-ssh2 so your security team will approve it. I'm only able to get it to work with remi being used.
BenCowan
Posts: 85
Joined: Thu Jul 28, 2011 11:34 am

Re: xi upgrade fails after upgrading to php 7.4 on RHEL8 sys

Post by BenCowan »

Thank you for the feedback!

I came to the same conclusion, that since Remi builds those missing 7.4 packages (php-imap, php-pecl-ssh2 (requires libssh2-1.9 from epel), and php-pdo-dblib) why fight with RHEL. I convinced our RedHat SA to let me switch to the remi repo, so all is well.

Lock it!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: xi upgrade fails after upgrading to php 7.4 on RHEL8 sys

Post by scottwilkerson »

BenCowan wrote:Thank you for the feedback!

I came to the same conclusion, that since Remi builds those missing 7.4 packages (php-imap, php-pecl-ssh2 (requires libssh2-1.9 from epel), and php-pdo-dblib) why fight with RHEL. I convinced our RedHat SA to let me switch to the remi repo, so all is well.

Lock it!
Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart