Bug 1494080

Summary: nagios-plugins-2.2.1-2git.fc28 FTBFS: Use mariadb-connector-c-devel instead of mysql-devel or mariadb-devel
Product: [Fedora] Fedora Reporter: Michal Schorm <mschorm>
Component: nagios-pluginsAssignee: Stephen John Smoogen <smooge>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: athmanem, b.heden, nb, netwiz, oliver, ondrejj, ppisar, smooge, smooge, swilkerson
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nagios-plugins-2.2.1-9.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-28 23:51:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1486480    

Description Michal Schorm 2017-09-21 12:35:54 UTC
Hello, a MariaDB went through big changes and your package will probabbly need a patch. However your package FTBFS for a long time, so I have no way to test the patch.

In most cases, this command was enough to fix all the issues:

sed -i "s/mysql-devel/mariadb-connector-c-devel/" $(fedpkg gimmespec) ; \
sed -i "s/mariadb-devel/mariadb-connector-c-devel/" $(fedpkg gimmespec) ; \
sed -i "s/%{_libdir}\/mysql/%{_libdir}\/mariadb/" $(fedpkg gimmespec) ; \
sed -i "s/mariadb-connector-c-devel/mariadb-connector-c-devel openssl-devel/" $(fedpkg gimmespec) ;

This change is currently applicable to the Rawhide (f28) only.



For more information check the tracking bugzilla.

Comment 1 Steven Haigh 2017-10-09 17:16:17 UTC
Not sure if related - but in F27, I'm seeing this:

/usr/lib64/nagios/plugins $ ldd check_mysql
        linux-vdso.so.1 (0x00007ffd284ec000)
        libnsl.so.1 => /lib64/libnsl.so.1 (0x00007fc2e9fa8000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fc2e9d8e000)
        libmysqlclient.so.18 => not found
        libz.so.1 => /lib64/libz.so.1 (0x00007fc2e9b77000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fc2e9822000)
        libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007fc2e95b6000)
        libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007fc2e912f000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc2e8f10000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fc2e8d0c000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fc2e8927000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc2ea3d1000)


However:
$ file /usr/lib64/mysql/libmysqlclient.so.18
/usr/lib64/mysql/libmysqlclient.so.18: symbolic link to libmariadb.so.3

$ file /usr/lib64/mysql/libmariadb.so.3
/usr/lib64/mysql/libmariadb.so.3: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=a5c17835b924d9830cc6b91764d3c3e80f650d05, stripped

Not sure why it isn't found - as:
/etc/ld.so.conf.d $ cat mariadb-connector-c-x86_64.conf
/usr/lib64/mariadb
/etc/ld.so.conf.d $ cat mariadb-x86_64.conf
/usr/lib64/mysql

Comment 2 Michal Schorm 2017-10-10 05:51:52 UTC
Resolved with latest connector-c build.

The issue is that ldconfig can't use symlink
/usr/lib64/mariadb -> /usr/lib64/mysql
as a valid path.

The was released yesterday, when I found out, but it can take up to several days to reach your (and KOJI's) repository

Comment 3 Steven Haigh 2017-10-31 00:24:17 UTC
For what it matters, I still have this issue in F27.

Not sure if its been fixed elsewhere and just needs building for F27?

Comment 4 Michal Schorm 2017-10-31 07:14:57 UTC
For f27 I highly recommend trying this update:
https://bodhi.fedoraproject.org/updates/FEDORA-2017-d3f3d368a1

Comment 5 Steven Haigh 2017-10-31 07:43:57 UTC
This doesn't seem to make a difference for me:

$ ./check_mysql
./check_mysql: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

$ rpm -qa | grep mysql
nagios-plugins-mysql-2.2.1-4git.fc26.x86_64
php-mysqlnd-7.1.11~RC1-1.fc27.x86_64

$ rpm -qa | grep mariadb
mariadb-common-10.2.9-3.fc27.x86_64
mariadb-errmsg-10.2.9-3.fc27.x86_64
mariadb-config-10.2.9-3.fc27.x86_64
mariadb-libs-10.2.9-3.fc27.x86_64
mariadb-10.2.9-3.fc27.x86_64
mariadb-server-10.2.9-3.fc27.x86_64
mariadb-connector-c-3.0.2-13.fc27.x86_64
mariadb-server-utils-10.2.9-3.fc27.x86_64

libmysqlclient.so.18 is present in /usr/lib64/mysql and is a symlink to libmariadb.so.3

Comment 6 Michal Schorm 2017-10-31 08:33:02 UTC
where can I get the "check_mysql" binary?

Comment 7 Steven Haigh 2017-10-31 09:05:46 UTC
I just noticed I had the f26 version installed - as I was testing with it....

I believe I tried the f26 version due to a higher revision number...

The package is "nagios-plugins-mysql" which gives a binary in /usr/lib64/nagios/plugins

The f27 package is:
nagios-plugins-mysql-2.2.1-2git.fc27.x86_64

I've installed that again - but the same issue.

Comment 8 Steven Haigh 2017-10-31 09:20:51 UTC
Ah - this is why I was using the F26 nagios-plugins group:
https://bugzilla.redhat.com/show_bug.cgi?id=1500028

Comment 9 Petr Pisar 2017-11-14 16:10:02 UTC
For you information, nagios-plugins-2.2.1-2git.fc28 fails to build in F28 because it was not ported to mariadb-connector-c:

gcc -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I.. -I../lib -I../gl -I../intl -I/usr/include/ldap -I/include -I/include -I/usr/include/mysql -I/usr/include/mysql -I/include -DNP_VERSION='"2.2.1"' -I/usr/include/mysql -I/usr/include/mysql -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -c -o check_mysql-check_mysql.o `test -f 'check_mysql.c' || echo './'`check_mysql.c
[...]
check_mysql.c:61:24: error: 'MYSQL_PORT' undeclared here (not in a function); did you mean 'MYSQL_STMT'?
 unsigned int db_port = MYSQL_PORT;
                        ^~~~~~~~~~

Comment 10 Stephen John Smoogen 2017-11-21 13:54:57 UTC
I have built a set that compiles with rawhide and f27. It does not use maria-connector-c yet in rawhide as the rpm it was getting still said it provided no files. I will fix later when that changes.

Comment 11 Michal Schorm 2017-11-21 14:05:24 UTC
I'm not sure I understood.

The difference between f27 & Rawhide is that on:
Rawhide
  you should use mariadb-connector-c-devel for devel
  and mariadb-connector-c for libraries
f27
  you should use mariadb-devel and mariadb-libs for libraries.

--

The mariadb-libs does not exist anymore on Rawhide, since its functionality is porvided by Conc/C, as well as client devel files.

Comment 12 Fedora Update System 2017-11-21 15:46:14 UTC
nagios-plugins-2.2.1-9.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-ef9d46f257

Comment 13 Fedora Update System 2017-11-21 16:24:11 UTC
nagios-plugins-2.2.1-9.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-69f33af241

Comment 14 Fedora Update System 2017-11-21 17:09:27 UTC
nagios-plugins-2.2.1-9.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-f6a0118ce5

Comment 15 Fedora Update System 2017-11-22 05:23:44 UTC
nagios-plugins-2.2.1-9.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-f6a0118ce5

Comment 16 Fedora Update System 2017-11-22 06:33:32 UTC
nagios-plugins-2.2.1-9.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-ef9d46f257

Comment 17 Fedora Update System 2017-11-22 11:10:14 UTC
nagios-plugins-2.2.1-9.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-69f33af241

Comment 18 Fedora Update System 2017-11-28 23:51:56 UTC
nagios-plugins-2.2.1-9.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.