Author Topic: MariaDB-server upgrade error  (Read 7411 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
MariaDB-server upgrade error
« on: November 28, 2020, 01:28:00 PM »
How can i fix this problem?

Details:
Code: [Select]
yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: linux.darkpenguin.net
 * epel: mirror.de.leaseweb.net
 * extras: mirror.plustech.de
 * remi-safe: mirror.23media.com
 * updates: mirror.plustech.de
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-server.x86_64 0:10.1.48-1.el7.centos will be updated
---> Package MariaDB-server.x86_64 0:10.2.36-1.el7.centos will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================
 Package                                        Arch                                   Version                                                 Repository                               Size
=============================================================================================================================================================================================
Updating:
 MariaDB-server                                 x86_64                                 10.2.36-1.el7.centos                                    mariadb                                  24 M

Transaction Summary
=============================================================================================================================================================================================
Upgrade  1 Package

Total download size: 24 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
MariaDB-server-10.2.36-1.el7.centos.x86_64.rpm                                                                                                                        |  24 MB  00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction

******************************************************************
A MySQL or MariaDB server package (MariaDB-server-10.1.48-1.el7.centos.x86_64) is installed.

Upgrading directly from MySQL 10.1 to MariaDB 10.2 may not
be safe in all cases.  A manual dump and restore using mysqldump is
recommended.  It is important to review the MariaDB manual's Upgrading
section for version-specific incompatibilities.

A manual upgrade is required.

- Ensure that you have a complete, working backup of your data and my.cnf
  files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages.  Usually this command will
  list the packages you should remove:
  rpm -qa | grep -i '^mysql-'

  You may choose to use 'rpm --nodeps -ev <package-name>' to remove
  the package which contains the mysqlclient shared library.  The
  library will be reinstalled by the MariaDB-shared package.
- Install the new MariaDB packages supplied by MariaDB Foundation
- Ensure that the MariaDB server is started
- Run the 'mysql_upgrade' program

This is a brief description of the upgrade process.  Important details
can be found in the MariaDB manual, in the Upgrading section.
******************************************************************
error: %pre(MariaDB-server-10.2.36-1.el7.centos.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package MariaDB-server-10.2.36-1.el7.centos.x86_64
MariaDB-server-10.1.48-1.el7.centos.x86_64 was supposed to be removed but is not!
  Verifying  : MariaDB-server-10.1.48-1.el7.centos.x86_64                                                                                                                                1/2
  Verifying  : MariaDB-server-10.2.36-1.el7.centos.x86_64                                                                                                                                2/2

Failed:
  MariaDB-server.x86_64 0:10.1.48-1.el7.centos                                                  MariaDB-server.x86_64 0:10.2.36-1.el7.centos

Complete!


Before this, i did a bulk update.
Details:
Code: [Select]
yum update -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: linux.darkpenguin.net
 * epel: mirror.de.leaseweb.net
 * extras: mirror.plustech.de
 * remi-safe: mirror.23media.com
 * updates: mirror.plustech.de
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-client.x86_64 0:10.1.48-1.el7.centos will be updated
---> Package MariaDB-client.x86_64 0:10.2.36-1.el7.centos will be an update
---> Package MariaDB-common.x86_64 0:10.1.48-1.el7.centos will be updated
---> Package MariaDB-common.x86_64 0:10.2.36-1.el7.centos will be an update
--> Processing Dependency: MariaDB-compat for package: MariaDB-common-10.2.36-1.el7.centos.x86_64
---> Package MariaDB-devel.x86_64 0:10.1.48-1.el7.centos will be updated
---> Package MariaDB-devel.x86_64 0:10.2.36-1.el7.centos will be an update
---> Package MariaDB-server.x86_64 0:10.1.48-1.el7.centos will be updated
---> Package MariaDB-server.x86_64 0:10.2.36-1.el7.centos will be an update
---> Package MariaDB-shared.x86_64 0:10.1.48-1.el7.centos will be updated
---> Package MariaDB-shared.x86_64 0:10.2.36-1.el7.centos will be an update
---> Package python-pyspf.noarch 0:2.0.14-11.el7 will be updated
---> Package python-pyspf.noarch 0:2.0.14-13.el7 will be an update
--> Running transaction check
---> Package MariaDB-compat.x86_64 0:10.2.36-1.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================
 Package                                        Arch                                   Version                                                 Repository                               Size
=============================================================================================================================================================================================
Updating:
 MariaDB-client                                 x86_64                                 10.2.36-1.el7.centos                                    mariadb                                  11 M
 MariaDB-common                                 x86_64                                 10.2.36-1.el7.centos                                    mariadb                                  81 k
 MariaDB-devel                                  x86_64                                 10.2.36-1.el7.centos                                    mariadb                                 6.7 M
 MariaDB-server                                 x86_64                                 10.2.36-1.el7.centos                                    mariadb                                  24 M
 MariaDB-shared                                 x86_64                                 10.2.36-1.el7.centos                                    mariadb                                 112 k
 python-pyspf                                   noarch                                 2.0.14-13.el7                                           epel                                     50 k
Installing for dependencies:
 MariaDB-compat                                 x86_64                                 10.2.36-1.el7.centos                                    mariadb                                 2.2 M

Transaction Summary
=============================================================================================================================================================================================
Install             ( 1 Dependent package)
Upgrade  6 Packages

Total download size: 44 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/7): MariaDB-common-10.2.36-1.el7.centos.x86_64.rpm                                                                                                                 |  81 kB  00:00:00
(2/7): MariaDB-compat-10.2.36-1.el7.centos.x86_64.rpm                                                                                                                 | 2.2 MB  00:00:02
(3/7): MariaDB-client-10.2.36-1.el7.centos.x86_64.rpm                                                                                                                 |  11 MB  00:00:05
(4/7): MariaDB-devel-10.2.36-1.el7.centos.x86_64.rpm                                                                                                                  | 6.7 MB  00:00:01
(5/7): MariaDB-shared-10.2.36-1.el7.centos.x86_64.rpm                                                                                                                 | 112 kB  00:00:00
(6/7): python-pyspf-2.0.14-13.el7.noarch.rpm                                                                                                                          |  50 kB  00:00:00
(7/7): MariaDB-server-10.2.36-1.el7.centos.x86_64.rpm                                                                                                                 |  24 MB  00:00:01
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                        6.5 MB/s |  44 MB  00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : MariaDB-common-10.2.36-1.el7.centos.x86_64                                                                                                                               1/13
  Installing : MariaDB-compat-10.2.36-1.el7.centos.x86_64                                                                                                                               2/13
  Updating   : MariaDB-client-10.2.36-1.el7.centos.x86_64                                                                                                                               3/13

******************************************************************
A MySQL or MariaDB server package (MariaDB-server-10.1.48-1.el7.centos.x86_64) is installed.

Upgrading directly from MySQL 10.1 to MariaDB 10.2 may not
be safe in all cases.  A manual dump and restore using mysqldump is
recommended.  It is important to review the MariaDB manual's Upgrading
section for version-specific incompatibilities.

A manual upgrade is required.

- Ensure that you have a complete, working backup of your data and my.cnf
  files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages.  Usually this command will
  list the packages you should remove:
  rpm -qa | grep -i '^mysql-'

  You may choose to use 'rpm --nodeps -ev <package-name>' to remove
  the package which contains the mysqlclient shared library.  The
  library will be reinstalled by the MariaDB-shared package.
- Install the new MariaDB packages supplied by MariaDB Foundation
- Ensure that the MariaDB server is started
- Run the 'mysql_upgrade' program

This is a brief description of the upgrade process.  Important details
can be found in the MariaDB manual, in the Upgrading section.
******************************************************************
error: %pre(MariaDB-server-10.2.36-1.el7.centos.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package MariaDB-server-10.2.36-1.el7.centos.x86_64
error: MariaDB-server-10.2.36-1.el7.centos.x86_64: install failed
  Updating   : MariaDB-devel-10.2.36-1.el7.centos.x86_64                                                                                                                                5/13
  Updating   : MariaDB-shared-10.2.36-1.el7.centos.x86_64                                                                                                                               6/13
  Updating   : python-pyspf-2.0.14-13.el7.noarch                                                                                                                                        7/13
error: MariaDB-server-10.1.48-1.el7.centos.x86_64: erase skipped
  Cleanup    : MariaDB-client-10.1.48-1.el7.centos.x86_64                                                                                                                               8/13
  Cleanup    : MariaDB-shared-10.1.48-1.el7.centos.x86_64                                                                                                                               9/13
  Cleanup    : MariaDB-devel-10.1.48-1.el7.centos.x86_64                                                                                                                               10/13
  Cleanup    : MariaDB-common-10.1.48-1.el7.centos.x86_64                                                                                                                              11/13
  Cleanup    : python-pyspf-2.0.14-11.el7.noarch                                                                                                                                       12/13
  Verifying  : MariaDB-devel-10.2.36-1.el7.centos.x86_64                                                                                                                                1/13
  Verifying  : MariaDB-client-10.2.36-1.el7.centos.x86_64                                                                                                                               2/13
  Verifying  : MariaDB-compat-10.2.36-1.el7.centos.x86_64                                                                                                                               3/13
  Verifying  : python-pyspf-2.0.14-13.el7.noarch                                                                                                                                        4/13
  Verifying  : MariaDB-common-10.2.36-1.el7.centos.x86_64                                                                                                                               5/13
  Verifying  : MariaDB-shared-10.2.36-1.el7.centos.x86_64                                                                                                                               6/13
MariaDB-server-10.1.48-1.el7.centos.x86_64 was supposed to be removed but is not!
  Verifying  : MariaDB-server-10.1.48-1.el7.centos.x86_64                                                                                                                               7/13
  Verifying  : MariaDB-client-10.1.48-1.el7.centos.x86_64                                                                                                                               8/13
  Verifying  : MariaDB-server-10.2.36-1.el7.centos.x86_64                                                                                                                               9/13
  Verifying  : MariaDB-shared-10.1.48-1.el7.centos.x86_64                                                                                                                              10/13
  Verifying  : python-pyspf-2.0.14-11.el7.noarch                                                                                                                                       11/13
  Verifying  : MariaDB-common-10.1.48-1.el7.centos.x86_64                                                                                                                              12/13
  Verifying  : MariaDB-devel-10.1.48-1.el7.centos.x86_64                                                                                                                               13/13

Dependency Installed:
  MariaDB-compat.x86_64 0:10.2.36-1.el7.centos

Updated:
  MariaDB-client.x86_64 0:10.2.36-1.el7.centos   MariaDB-common.x86_64 0:10.2.36-1.el7.centos   MariaDB-devel.x86_64 0:10.2.36-1.el7.centos   MariaDB-shared.x86_64 0:10.2.36-1.el7.centos
  python-pyspf.noarch 0:2.0.14-13.el7

Failed:
  MariaDB-server.x86_64 0:10.1.48-1.el7.centos                                                  MariaDB-server.x86_64 0:10.2.36-1.el7.centos

Complete!
« Last Edit: November 28, 2020, 01:31:09 PM by brack »

Re: MariaDB-server upgrade error
« Reply #1 on: November 28, 2020, 03:46:35 PM »
How can i fix this problem?
By actually reading what it tells you to do.  ::)

Offline
*
Re: MariaDB-server upgrade error
« Reply #2 on: December 01, 2020, 06:33:34 PM »
Below the steps that I made...

1. Create a backup file.
Code: [Select]
mysqldump --all-databases > /home/fullbackup.sql.gz
2. Disable InnoDB fast shutdown
Code: [Select]
mysql

mysql -> SET GLOBAL innodb_fast_shutdown = 0;

3. Stop MariaDB
Code: [Select]
service mysql stop
4. Manually uninstall MariaDB 10.1
Code: [Select]
yum remove MariaDB-server MariaDB-client -y
5. Manually install MariaDB 10.2
Code: [Select]
yum install MariaDB-server MariaDB-client -y
6. Start MariaDB
Code: [Select]
service mysql start
7. Upgrade the DB to compatibility
Code: [Select]
mysql_upgrade
8. Enable service "mariadb.service" on "Services config -> Start-up Services".
Code: [Select]
systemctl enable mariadb.service
9. Reboot to check if all right.
Code: [Select]
reboot
If everything all right, relax and drink a coffee. If not, breath and drink a coffee to find a fix, but stay calm... you have a backup (Do you made the 1st step, right?).

Offline
*
Re: MariaDB-server upgrade error
« Reply #3 on: December 05, 2020, 04:46:29 AM »
Immense gratitude. Nothing works better than following exactly the instructions of someone who actually knows.

The orphan "mysql" in step 2 is of course redundant.

Thanks again for being such a valuable contributor to the CWP community.

Offline
*
Re: MariaDB-server upgrade error
« Reply #4 on: December 06, 2020, 09:56:34 AM »
Thumbs up to ehstbr

Steps works 100%

(not sure if my.cnf needs to be backed up first)

Offline
*
Re: MariaDB-server upgrade error
« Reply #5 on: December 20, 2020, 04:32:17 PM »
@brack thanks for posting this

@ehstbr thanks for your guide, I've been trying several ways to get it to upgrade, and your guide worked like a charm.

Thank you community!

[updated]
I just noticed CWP posted an article about this issue as well here: https://wiki.centos-webpanel.com/mariadb-upgrade-from-10-1-to-10-2
« Last Edit: December 20, 2020, 04:41:32 PM by davisdre »