Bug 1497234 - Rawhide mariadb-connector-c-devel-3.0.2-8.fc28.x86_64 Fails to Install
Summary: Rawhide mariadb-connector-c-devel-3.0.2-8.fc28.x86_64 Fails to Install
Alias: None
Product: Fedora
Classification: Fedora
Component: mariadb-connector-c
Version: rawhide
Hardware: x86_64
OS: Unspecified
Target Milestone: ---
Assignee: Michal Schorm
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2017-09-29 14:27 UTC by Ron Lovell
Modified: 2017-10-10 19:29 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-10-10 19:29:42 UTC
Type: Bug

Attachments (Terms of Use)

Description Ron Lovell 2017-09-29 14:27:27 UTC
Description of problem:
When trying to install mariadb-devel, installation of the dependency
mariadb-connector-c-devel fails:
Installing       : mariadb-connector-c-devel-3.0.2-8.fc28.x86_64                      1/2
Error unpacking rpm package mariadb-connector-c-devel-3.0.2-8.fc28.x86_64
Error unpacking rpm package mariadb-connector-c-devel-3.0.2-8.fc28.x86_64
error: unpacking of archive failed on file /usr/lib64/mysql: cpio: File
from package already exists as a directory in system

Version-Release number of selected component (if applicable):

How reproducible:
Try to install or upgrade mariadb-devel

Steps to Reproduce:

Actual results:
Installation of dependency mariadb-connector-c-devel fails.

Expected results:
mariadb-devel and its dependency mariadb-connector-c-devel install successfully.

Additional info:

Comment 1 George R. Goffe 2017-09-29 22:03:57 UTC

Me too.

ls -al /usr/lib64 | grep mysql gives:

drwxr-xr-x.   3 root root      4096 Sep 29 12:10 mysql
lrwxrwxrwx    1 root root         7 Sep 20 05:43 mysql;59c57708 -> mariadb
lrwxrwxrwx    1 root root         7 Sep 20 05:43 mysql;59c68911 -> mariadb
lrwxrwxrwx    1 root root         7 Sep 20 05:43 mysql;59ce949f -> mariadb
lrwxrwxrwx    1 root root         7 Sep 20 05:43 mysql;59cebe71 -> mariadb
lrwxrwxrwx    1 root root         7 Sep 20 05:43 mysql;59cebedd -> mariadb

Comment 2 Ron Lovell 2017-10-01 19:48:56 UTC
Good eye, George. I hadn't noticed those symlinks to mariadb, which I can confirm are left by unsuccessful attempts to install mariadb-connector-c-devel.

The problem seems to center around a conflict between mariadb-server, which installs to /usr/lib64/mysql, and mariadb-connector-c[-devel], which install to /usr/lib64/mariadb. mariadb-connector-c-devel expects or creates a symlink /usr/lib64/mysql -> mariadb.  Simply reinstalling all in the same order, with the mariadb and mysql* removed from /usr/lib64 in between, just results in the same conflict.  However, this does work:

Remove all the mariadb* packages.
Remove /usr/lib64/mariadb /usr/lib64/mysql*
I also removed /var/lib/mysql to toss all old data in the bit bucket.

dnf install mariadb-connector-c
That installs to /usr/lib64/mariadb, as before.
dnf install mariadb-connector-c-devel
That installs to /usr/lib64/mariadb and creates symlink /usr/lib64/mysql -> mariadb.
dnf install mariadb-server
That installs to (symlink) /usr/lib64/mysql, so files go into /usr/lib64/mariadb/.

I've been able to start the server, set a database root password, run the /usr/bin/mysql_secure_installation program, add myself as a user, and create a new database.  All that works, but I have to wonder what might go wrong because /usr/lib64/mysql isn't a directory. (In particular, I don't run SELinux, so I wouldn't know about SELinux conflicts.)

The maintainer should be able to determine what direction they plan to go (w.r.t. installation in /usr/lib64/mariadb versus /usr/lib64/mysql) in the integration of mariadb-connector-c with mariadb.

Comment 3 George R. Goffe 2017-10-02 04:44:39 UTC

Thanks for the praise... the ls results just looked a little odd.

Thanks too for the writeup.


Comment 4 Ron Lovell 2017-10-02 05:06:06 UTC

You're welcome. Oh, and I almost forgot:

dnf install mariadb-devel

That just installs header files and a pkgconfig file.

Comment 5 Michal Schorm 2017-10-02 10:49:37 UTC
Hello guys,
sorry for the delay, I was away form wednesday's evening.

I'll look into this immediatelly.

Can you give me your personal reproducer?
(dnf update / install from which package to which package ...)


So far I found two issues.
The first one is obvious - a conficlting file 'mysql_version.h' between 'mariadb-connector-c-devel' and 'mariadb-devel'.
The second one is symlink '/usr/lib64/mysql' to a directory '/usr/lib64/mariadb', which ... does odd things:

Comment 6 Ron Lovell 2017-10-02 23:35:38 UTC
Hi Michal,

Thanks for your response. The error installing mariadb-connector-c-devel occurs when mariadb-server (and other mariadb packages) are already installed. I happened to trigger by trying to install mariadb-devel, which depends on mariadb-connector-c-devel. But the problem can be reproduces by trying to install the latter. The mariadb-server etc. packages create and install into directory /usr/lib64/mysql. But mariadb-connect-c-devel expects /usr/lib64/mysql to be a symlink to mariadb, else it tries to create one. My workaround was to install mariadb-connector-c and mariadb-connector-c-devel first, so that the symlink /usr/lib64/mysql -> mariadb exists, then install mariadb-server etc. which will be coerced into installing in /usr/lib64/mariadb by following the symlink.  That worked per my brief testing.

As for the permament fix, in the process of transitioning from Mariadb 10.1 to 10.2, with the split of client libs to mariadb-connector-c, Fedora packagers will have to decide where things are going to go, then adjust the package installation to be consistent.  My other Linux distros are still using Mariadb 10.1, so I don't have an example to follow.


Comment 7 Michal Schorm 2017-10-03 11:20:07 UTC
Yesterday, I released 2 updates, that together should (hopefully) solve this issue (or atleast its part).



Now I'm just waiting them to appear in rawhide repositories.
I tested in crafted local repo, that every package from the set can be installed simultaneously, however, they could need to:

rm -rf /usr/lib64/mysql
rm -rf "/usr/lib64/mariadb*"

if they were some directories left with no owner.
You can check which package owns a file with:

rpm -qf <file>


Thanks Ron for the complex answer.

Comment 8 Michal Schorm 2017-10-03 11:35:41 UTC
Correction for the command in previous comment:

rm -rf /usr/lib64/{mysql*,mariadb*}

Comment 9 Ron Lovell 2017-10-04 02:53:05 UTC

I see what you mean. The mariadb-3:10.2.9-1 and mariadb-connector-c-3.0.2-9 updates came through today.  The upgrade of mariadb-connector-c-devel failed because it wanted to create a symlink /usr/lib/mariadb -> mysql, but a directory mariadb already existed (from previous versions of mariadb-connector-c*). I removed the mariadb* packages, removed /usr/lib64/mariadb/, then installed everything successfully. I finally noticed that mariadb-connector-c now installs into /usr/lib64/mysql/. I then realized I could have just removed /usr/lib64/mariadb/, then the upgrade of mariadb-connector-c-devel would have succeeded without having to reinstall any packages.

So, a new clean installation of mariadb including mariadb-devel should work, assuming there is not a non-symlink object /usr/lib64/mariadb/ in place beforehand.

There will be installation/upgrade issues for sites that had previous versions of mariadb-connector-c installed in /usr/lib64/mariadb/. Since that package is required by mariadb, the issue would apply to all mariadb 10.2 installations, at least as far back as mariadb-connector-c was a requirement by mariadb.

How about if upgrade/installation of mariadb-connector-c-devel recursively removed any existing directory /usr/lib64/mariadb/ before creating a symlink?  The new versions of -devel and the runtime package both install into /usr/lib64/mysql now. Are there any other Fedora packages that ever installed into /usr/lib64/mariadb/? If there are files that needed to be preserved, they would need to be moved to /usr/lib64/mysql first.

At any rate, wer'e making progress.  Thanks for the fixes!
- Ron

Comment 10 Michal Schorm 2017-10-04 11:16:45 UTC
Hi Ron,
I aimed directly to deliver the hot fix this time.

Now, when it works "somehow", I'll look back into upgrade issues.

Comment 11 Michal Schorm 2017-10-04 12:38:40 UTC
I'm thinking about adding something like this, to the connector-c:

rpm -qf /usr/lib64/mysql
if [ $? -eq 1 ]; then
	if [ "$(ls -A /usr/lib64/mysql)" ]; then
	     mv /usr/lib64/mysql /usr/lib64/.mysql_update_tmp
	rm -rf /usr/lib64/{mysql*,mariadb*}

if [ "$(ls -A /usr/lib64/.mysql_update_tmp)" ]; then
    mv /usr/lib64/.mysql_update_tmp/* /usr/lib64/mysql
    rm /usr/lib64/.mysql_update_tmp


I'm gonna test it, and see, if that helps.

Comment 12 Michal Schorm 2017-10-04 20:42:37 UTC
I managed to add some fixes to both mariadb and mariadb-connector-c packages.

The results are:
 * mariadb-connector-c package cleans mess from its older version by scriptlet above
 * mariadb package use correct obsoletes, making update from mariadb 10.1 to 10.2 possible.


 when upgrade from mdb 10.1 to mdb 10.2, option "--allowerasing" is needed. If not used, the update will fail, beacuse won't want to drop mariadb-libs package.


mariadb-connector-c build 3.0.2-10:

mariadb build 3:10.2.9-2

Comment 13 Peter Lemenkov 2017-10-05 10:26:45 UTC
I believe this should be pushed to F-27 as well. I have troubles building OpenSIPS for F-27 only due to missing /usr/include/mysql/mysql/mysql_version.h

* https://koji.fedoraproject.org/koji/taskinfo?taskID=22257099

Comment 14 Peter Lemenkov 2017-10-05 10:27:51 UTC
(In reply to Peter Lemenkov from comment #13)
> I believe this should be pushed to F-27 as well. I have troubles building
> OpenSIPS for F-27 only due to missing
> /usr/include/mysql/mysql/mysql_version.h
> * https://koji.fedoraproject.org/koji/taskinfo?taskID=22257099

Sorry, I meant change introduced in 3.0.2-6

Comment 15 Fedora Update System 2017-10-06 08:03:05 UTC
mariadb-10.2.9-3.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-dff1218bfa

Comment 16 Fedora Update System 2017-10-06 22:26:09 UTC
mariadb-10.2.9-3.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-dff1218bfa

Comment 17 Ron Lovell 2017-10-07 12:57:04 UTC
The mariadb-3:10.2.9-3.fc28 and mariadb-connector-c-3.0.2-10.fc28 updates came through this morning. They're looking good as best I can test without actually having an old mariadb-connector-c installation in /usr/lib64/mariadb/.

First I simply applied the updates. That worked fine. The output included:
  Running scriptlet: mariadb-connector-c-devel-3.0.2-10.fc28.x86_64                  20/201
  Upgrading        : mariadb-connector-c-devel-3.0.2-10.fc28.x86_64                  20/201
  Running scriptlet: mariadb-connector-c-devel-3.0.2-10.fc28.x86_64                  20/201
ls: cannot access '/usr/lib64/.mysql_update_tmp': No such file or directory

Then I removed all mariadb* packages. To make things interesting, I then:

   mkdir -p /usr/lib64/mariadb/plugin

I did not remove /usr/lib64/mysql/. Then I installed mariadb-server and mariadb-devel and their dependencies. That worked fine. Output included:
  Running scriptlet: mariadb-connector-c-devel-3.0.2-10.fc28.x86_64                    6/14
file /usr/lib64/mysql is not owned by any package
  Installing       : mariadb-connector-c-devel-3.0.2-10.fc28.x86_64                    6/14

After installation the bogus /usr/lib64/mariadb/ directory has been replaced with symlink /usr/lib64/mariadb -> mysql, as expected.

The server starts and works normally.
Good work, guys.


Comment 18 Fedora Update System 2017-10-10 19:29:42 UTC
mariadb-10.2.9-3.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.