Bug #115472 Upgrading with DNF/RPM from 8.4.0 fails due to conflict
Submitted: 1 Jul 2024 5:06 Modified: 14 Jan 19:40
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / C++ Severity:S3 (Non-critical)
Version:9.0.0 OS:Fedora (Fedora 40)
Assigned to: CPU Architecture:Any
Tags: dnf, packaging, rpm, yum

[1 Jul 2024 5:06] Daniël van Eeden
Description:
The upgrade from 8.4.0-1 to 9.0.0-1 fails due to a conflict on /usr/include/mysql-cppconn. 

$ sudo dnf update
Last metadata expiration check: 0:03:56 ago on Mon 01 Jul 2024 06:57:57 CEST.
Dependencies resolved.
===================================================================================
 Package                   Arch   Version         Repository                  Size
===================================================================================
Upgrading:
 mysql-connector-c++       x86_64 9.0.0-1.fc40    mysql-connectors-community 1.0 M
 mysql-connector-c++-devel x86_64 9.0.0-1.fc40    mysql-connectors-community 4.1 M
 mysql-connector-c++-jdbc  x86_64 9.0.0-1.fc40    mysql-connectors-community 1.7 M

Transaction Summary
===================================================================================
Upgrade  3 Packages

Total download size: 6.8 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): mysql-connector-c++-9.0.0-1.fc40.x86_64.rpm 5.0 MB/s | 1.0 MB     00:00    
(2/3): mysql-connector-c++-devel-9.0.0-1.fc40.x86_  10 MB/s | 4.1 MB     00:00    
(3/3): mysql-connector-c++-jdbc-9.0.0-1.fc40.x86_6 3.9 MB/s | 1.7 MB     00:00    
-----------------------------------------------------------------------------------
Total                                               16 MB/s | 6.8 MB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction test error:
  file /usr/include/mysql-cppconn from install of mysql-connector-c++-devel-9.0.0-1.fc40.x86_64 conflicts with file from package mysql-connector-c++-devel-8.4.0-1.fc40.x86_64

How to repeat:
See description
[1 Jul 2024 5:08] Daniël van Eeden
Workaround: do a `dnf remove` of the 8.4.0 packages and then install 9.0.0.
[2 Jul 2024 8:12] MySQL Verification Team
Hello Daniël,

Thank you for the report and feedback.

regards,
Umesh
[2 Jul 2024 13:47] Rafal Somla
Posted by developer:
 
We are investigating the issue. But a quick workaround would be to uninstall current version of 'mysql-connector-c++*' packages (if that is possible) and install the new ones.

Note however that in version 9.0.0 we are bumping ABI version of the -jdbc connector library (see release notes). Depending on your situation this might make it impossible to remove version 8.4.0 (if some other RPMs depend on the previous ABI) or it might break existing code that will require re-compile to work with the new ABI. If you are hit by that issue let us know!
[5 Jul 2024 13:04] Rafal Somla
Posted by developer:
 
It looks that we are hitting bug [1] of RPM package manager. In previous versions of -devel package /usr/include/mysql-cppconn/ was a symbolic link to a version-specific variant of the include folder. In version 9.0.0 we decided to put headers directly in /usr/include/mysql-cppconn/ and resign from version-specific variants. But, apparently, RPM manager can not correctly handle such change from symbolic link to regular directory. A workaround for the issue is proposed in [2] and we will most likely follow that advice.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=646523

[2] https://docs.fedoraproject.org/en-US/packaging-guidelines/Directory_Replacement/
[8 Jul 2024 12:13] Rafal Somla
Posted by developer:
 
Refined Problem Description
===========================

In previous versions of -devel package /usr/include/mysql-cppconn/ was a symbolic link to a version-specific variant of the include folder. In
version 9.0.0 we decided to put headers directly in /usr/include/mysql-cppconn/ and resigned from version-specific variants. But, apparently, RPM manager can not correctly handle an upgrade from a symbolic link to a regular directory (see bug [1]). 

Any fix for the issue would require updating our package specifications and this can happen no earlier than in 9.1 release. In the meantime the workaround is to uninstall mysql-connector-c++-devel package before upgrading to 9.0.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=646523
[14 Jan 19:40] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Connector/C++ 9.2.0 release, and here's the proposed changelog entry from the documentation team for review:

The -devel RPM package upgrade from 8.4.0 to 9.0.0 failed due to a
conflict on /usr/include/mysql-cppconn/. This was fixed by removing the
associated symlink in the %pretrans scriplet.

Thank you for the bug report.