yum update fails and complains about duplicate pid

Bug #1454917 reported by monty solomon
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
High
Tomislav Plavcic
5.5
Fix Released
High
Tomislav Plavcic
5.6
Fix Released
High
Tomislav Plavcic

Bug Description

Error in PREIN scriptlet in rpm package Percona-Server-server-56-5.6.24-rel72.2.el6.x86_64
You have more than one PID file:
-rw-rw---- 1 mysql mysql 6 Mar 29 18:00 /opt/mysql/dbprod/monty-q0.pid
-rw-rw---- 1 mysql mysql 6 Mar 29 18:00 /opt/mysql/dbprod/monty-q0.pid
Please check which one (if any) corresponds to a running server
and delete all others before repeating the MySQL upgrade.

Tags: pkg
Revision history for this message
monty solomon (monty+launchpad) wrote :

Downloading Packages:
(1/4): Percona-Server-client-56-5.6.24-rel72.2.el6.x86_6 | 6.4 MB 00:00
(2/4): Percona-Server-devel-56-5.6.24-rel72.2.el6.x86_64 | 1.0 MB 00:00
(3/4): Percona-Server-server-56-5.6.24-rel72.2.el6.x86_6 | 20 MB 00:00
(4/4): Percona-Server-shared-56-5.6.24-rel72.2.el6.x86_6 | 724 kB 00:00
--------------------------------------------------------------------------------
Total 53 MB/s | 28 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating : Percona-Server-shared-56-5.6.24-rel72.2.el6.x86_64 1/8
  Updating : Percona-Server-client-56-5.6.24-rel72.2.el6.x86_64 2/8
Error in PREIN scriptlet in rpm package Percona-Server-server-56-5.6.24-rel72.2.el6.x86_64
You have more than one PID file:
-rw-rw---- 1 mysql mysql 6 Mar 29 18:00 /opt/mysql/dbprod/monty-q0.pid
-rw-rw---- 1 mysql mysql 6 Mar 29 18:00 /opt/mysql/dbprod/monty-q0.pid
Please check which one (if any) corresponds to a running server
and delete all others before repeating the MySQL upgrade.
error: %pre(Percona-Server-server-56-5.6.24-rel72.2.el6.x86_64) scriptlet failed, exit status 1
error: install: %pre scriptlet failed (2), skipping Percona-Server-server-56-5.6.24-rel72.2.el6
  Updating : Percona-Server-devel-56-5.6.24-rel72.2.el6.x86_64 4/8
  Cleanup : Percona-Server-devel-56-5.6.23-rel72.1.el6.x86_64 5/8
  Cleanup : Percona-Server-client-56-5.6.23-rel72.1.el6.x86_64 6/8
  Cleanup : Percona-Server-shared-56-5.6.23-rel72.1.el6.x86_64 7/8
  Verifying : Percona-Server-client-56-5.6.24-rel72.2.el6.x86_64 1/8
  Verifying : Percona-Server-devel-56-5.6.24-rel72.2.el6.x86_64 2/8
  Verifying : Percona-Server-shared-56-5.6.24-rel72.2.el6.x86_64 3/8
Percona-Server-server-56-5.6.23-rel72.1.el6.x86_64 was supposed to be removed but is not!
  Verifying : Percona-Server-server-56-5.6.23-rel72.1.el6.x86_64 4/8
  Verifying : Percona-Server-devel-56-5.6.23-rel72.1.el6.x86_64 5/8
  Verifying : Percona-Server-client-56-5.6.23-rel72.1.el6.x86_64 6/8
  Verifying : Percona-Server-shared-56-5.6.23-rel72.1.el6.x86_64 7/8
  Verifying : Percona-Server-server-56-5.6.24-rel72.2.el6.x86_64 8/8

Updated:
  Percona-Server-client-56.x86_64 0:5.6.24-rel72.2.el6
  Percona-Server-devel-56.x86_64 0:5.6.24-rel72.2.el6
  Percona-Server-shared-56.x86_64 0:5.6.24-rel72.2.el6

Failed:
  Percona-Server-server-56.x86_64 0:5.6.23-rel72.1.el6
  Percona-Server-server-56.x86_64 0:5.6.24-rel72.2.el6

Complete!

Revision history for this message
monty solomon (monty+launchpad) wrote :

After the script fails a mix of versions is installed on the server.

Revision history for this message
monty solomon (monty+launchpad) wrote :

CentOS release 6.5 (Final)

Linux 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
monty solomon (monty+launchpad) wrote :

When mysql is shut down before the update the script displays a message about waiting for it to exit

Running Transaction
  Updating : Percona-Server-server-56-5.6.24-rel72.2.el6.x86_64 1/2
Giving mysqld 5 seconds to exit nicely

Revision history for this message
monty solomon (monty+launchpad) wrote :

I found the source of the problem -- the RPM script is not following the rule that when multiple instances of a given option are found, the last instance takes precedence. A similar issue caused bug 1201036.

Excerpt from the documentation
http://dev.mysql.com/doc/refman/5.6/en/option-files.html

If multiple instances of a given option are found, the last instance takes precedence.

My /etc/my.cnf file ends with an include directive

<!includedir /etc/mysql/conf.d/>

and the /etc/mysql/conf.d/001-basic-config.cnf file contains a duplicate pid entry

# tail -1 /etc/my.cnf
!includedir /etc/mysql/conf.d/

# grep -i pid /etc/my.cnf /etc/mysql/conf.d/001-basic-config.cnf
/etc/my.cnf:pid-file = /opt/mysql/dbprod/monty-q0.pid
/etc/mysql/conf.d/001-basic-config.cnf:pid-file = /opt/mysql/dbprod/monty-q0.pid

tags: added: pkg
Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

Yes, code in percona-server.spec looks like this:

  PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'`

So, we have to check what my_print_defaults outputs in case like yours:

[openxs@centos percona-server]$ my_print_defaults mysqld | grep pid
error: Found option without preceding group in config file: /tmp/pt.cnf at line: 1
--pid-file=/tmp/mysql.pid
--pid-file=/tmp/mysql.pid
[openxs@centos percona-server]$ my_print_defaults mysqld | grep buffer
error: Found option without preceding group in config file: /tmp/pt.cnf at line: 1
--innodb_buffer_pool_size=5M
--innodb_buffer_pool_size=100M

That is, my_print_defaults does not recognize the case of duplicated setting and just reports them all in order. .spec file should take this case into account for --pid-file it seems.

Revision history for this message
Tomislav Plavcic (tplavcic) wrote :

From what I see upstream handles this the same way. Anyway what I did is just put sort with removal of duplicates - should solve this case and have no effect on others.
PR's:
https://github.com/percona/percona-server/pull/198
https://github.com/percona/percona-server/pull/197

Revision history for this message
monty solomon (monty+launchpad) wrote :
Download full text (5.3 KiB)

The upstream package does not fail during the update. It stops and starts the server during the update process.

# yum -y update mysql-community*
Loaded plugins: downloadonly, fastestmirror, replace
Loading mirror speeds from cached hostfile
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.25-2.el6 will be updated
---> Package mysql-community-client.x86_64 0:5.6.27-2.el6 will be an update
---> Package mysql-community-common.x86_64 0:5.6.25-2.el6 will be updated
---> Package mysql-community-common.x86_64 0:5.6.27-2.el6 will be an update
---> Package mysql-community-devel.x86_64 0:5.6.25-2.el6 will be updated
---> Package mysql-community-devel.x86_64 0:5.6.27-2.el6 will be an update
---> Package mysql-community-libs.x86_64 0:5.6.25-2.el6 will be updated
---> Package mysql-community-libs.x86_64 0:5.6.27-2.el6 will be an update
---> Package mysql-community-libs-compat.x86_64 0:5.6.25-2.el6 will be updated
---> Package mysql-community-libs-compat.x86_64 0:5.6.27-2.el6 will be an update
---> Package mysql-community-server.x86_64 0:5.6.25-2.el6 will be updated
---> Package mysql-community-server.x86_64 0:5.6.27-2.el6 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package Arch Version Repository Size
================================================================================
Updating:
 mysql-community-client x86_64 5.6.27-2.el6 mysql56-community 18 M
 mysql-community-common x86_64 5.6.27-2.el6 mysql56-community 307 k
 mysql-community-devel x86_64 5.6.27-2.el6 mysql56-community 3.3 M
 mysql-community-libs x86_64 5.6.27-2.el6 mysql56-community 1.9 M
 mysql-community-libs-compat x86_64 5.6.27-2.el6 mysql56-community 1.6 M
 mysql-community-server x86_64 5.6.27-2.el6 mysql56-community 53 M

Transaction Summary
================================================================================
Upgrade 6 Package(s)

Total download size: 78 M
Downloading Packages:
(1/6): mysql-community-client-5.6.27-2.el6.x86_64.rpm | 18 MB 00:00
(2/6): mysql-community-common-5.6.27-2.el6.x86_64.rpm | 307 kB 00:00
(3/6): mysql-community-devel-5.6.27-2.el6.x86_64.rpm | 3.3 MB 00:00
(4/6): mysql-community-libs-5.6.27-2.el6.x86_64.rpm | 1.9 MB 00:00
(5/6): mysql-community-libs-compat-5.6.27-2.el6.x86_64.r | 1.6 MB 00:00
(6/6): mysql-community-server-5.6.27-2.el6.x86_64.rpm | 53 MB 00:01
--------------------------------------------------------------------------------
Total 31 MB/s | 78 MB 00:02
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating : mysql-community-common-5.6.27-2.el6.x86_64 1/12
  Updating : mysql-community-libs-5.6.27-2.el6.x86_64 2/12
  Updating : mysql-community-client-5.6.27-2.el6.x86_64 3/12
  Updating : mys...

Read more...

Revision history for this message
monty solomon (monty+launchpad) wrote :
Download full text (6.9 KiB)

The same is true during a downgrade.

# yum downgrade mysql-community*
Loaded plugins: downloadonly, fastestmirror, replace
Setting up Downgrade Process
Loading mirror speeds from cached hostfile
No Match for available package: mysql-community-bench-5.6.20-4.el6.x86_64
No Match for available package: mysql-community-embedded-5.6.15-1.el6.i686
No Match for available package: mysql-community-embedded-5.6.15-1.el6.x86_64
No Match for available package: mysql-community-embedded-devel-5.6.15-1.el6.i686
No Match for available package: mysql-community-embedded-devel-5.6.15-1.el6.x86_64
No Match for available package: mysql-community-test-5.6.15-1.el6.x86_64
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.26-2.el6 will be a downgrade
---> Package mysql-community-client.x86_64 0:5.6.27-2.el6 will be erased
---> Package mysql-community-common.x86_64 0:5.6.26-2.el6 will be a downgrade
---> Package mysql-community-common.x86_64 0:5.6.27-2.el6 will be erased
---> Package mysql-community-devel.x86_64 0:5.6.26-2.el6 will be a downgrade
---> Package mysql-community-devel.x86_64 0:5.6.27-2.el6 will be erased
---> Package mysql-community-libs.x86_64 0:5.6.26-2.el6 will be a downgrade
---> Package mysql-community-libs.x86_64 0:5.6.27-2.el6 will be erased
---> Package mysql-community-libs-compat.x86_64 0:5.6.26-2.el6 will be a downgrade
---> Package mysql-community-libs-compat.x86_64 0:5.6.27-2.el6 will be erased
---> Package mysql-community-release.noarch 0:el6-4 will be a downgrade
---> Package mysql-community-release.noarch 0:el6-5 will be erased
---> Package mysql-community-server.x86_64 0:5.6.26-2.el6 will be a downgrade
---> Package mysql-community-server.x86_64 0:5.6.27-2.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package Arch Version Repository Size
================================================================================
Downgrading:
 mysql-community-client x86_64 5.6.26-2.el6 mysql56-community 18 M
 mysql-community-common x86_64 5.6.26-2.el6 mysql56-community 307 k
 mysql-community-devel x86_64 5.6.26-2.el6 mysql56-community 3.2 M
 mysql-community-libs x86_64 5.6.26-2.el6 mysql56-community 1.9 M
 mysql-community-libs-compat x86_64 5.6.26-2.el6 mysql56-community 1.6 M
 mysql-community-release noarch el6-4 mysql-tools-community 5.0 k
 mysql-community-server x86_64 5.6.26-2.el6 mysql56-community 53 M

Transaction Summary
================================================================================
Downgrade 7 Package(s)

Total download size: 78 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): mysql-community-client-5.6.26-2.el6.x86_64.rpm | 18 MB 00:00
(2/7): mysql-community-common-5.6.26-2.el6.x86_64.rpm | 307 kB 00:00
(3/7): mysql-community-devel-5.6.26-2.el6.x86_64.rpm | 3.2 MB 00:00
(4/7): mysql-community-libs-5.6.26-2.el6.x86_64.rpm | 1.9 MB 00:00
(5/7): mysql-community-libs-compat-5.6.26-...

Read more...

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-902

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.