Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5986

MariaDB upgrade on CentOS 6 fails due to sed error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.5.36, 10.0.10
    • Fix Version/s: 5.5.37, 10.0.11
    • Component/s: None
    • Labels:

      Description

      When updating MariaDB-server from 5.5.36 to 10.0.10 on CentOS, an error happens when trying to check information about the already installed MariaDB-server package.

      The main issue seems to revolve around an invalid sed syntax:

      Error in PREIN scriptlet in rpm package MariaDB-server-10.0.10-1.el6.x86_64
      sed: invalid option – '1'

      Full error message is attached as log file.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              elenst Elena Stepanova added a comment - - edited

              The problem affects minor upgrades too, so it must be fixed by 5.5.37 release.

              The line in the pre-in script is
              installed=`echo "$installed"|sed -n -1p`

              I'm not sure whether -1p is a non-standard sed option or a typo, but since it doesn't work with standard sed on the target systems, it can't be used.

              It was introduced in 5.5 tree by the following revision:

              revno: 4118
              revision-id: sergii@pisem.net-20140324190137-t0554znbq5ed1w10
              parent: sergii@pisem.net-20140319090334-mpgf90l05547ji8y
              committer: Sergei Golubchik <sergii@pisem.net>
              branch nick: 5.5
              timestamp: Mon 2014-03-24 20:01:37 +0100
              message:
                MDEV-5831 Upgrade from MariaDB 5.5.36 via yum fails
              
                Allow "rpm -q --whatprovides mysql-server" to return more than one row.
                (all rows should be identical though)
              
              Show
              elenst Elena Stepanova added a comment - - edited The problem affects minor upgrades too, so it must be fixed by 5.5.37 release. The line in the pre-in script is installed=`echo "$installed"|sed -n -1p` I'm not sure whether -1p is a non-standard sed option or a typo, but since it doesn't work with standard sed on the target systems, it can't be used. It was introduced in 5.5 tree by the following revision: revno: 4118 revision-id: sergii@pisem.net-20140324190137-t0554znbq5ed1w10 parent: sergii@pisem.net-20140319090334-mpgf90l05547ji8y committer: Sergei Golubchik <sergii@pisem.net> branch nick: 5.5 timestamp: Mon 2014-03-24 20:01:37 +0100 message: MDEV-5831 Upgrade from MariaDB 5.5.36 via yum fails Allow "rpm -q --whatprovides mysql-server" to return more than one row. (all rows should be identical though)
              Hide
              atkinson.tommy Tom Atkinson added a comment - - edited

              Suggested fix:

              installed=`echo "$installed"|uniq`
              

              or

              installed=`echo "$installed"|head -n1`
              
              Show
              atkinson.tommy Tom Atkinson added a comment - - edited Suggested fix: installed=`echo "$installed"|uniq` or installed=`echo "$installed"|head -n1`
              Hide
              chaz6 Chris Hills added a comment -

              I would suggest simply:-

              installed =`echo "$installed"|sed -n p1`
              

              In the mean time you can upgrade like this:-

              sudo yum remove MariaDB-server && sudo yum install MariaDB-server
              
              Show
              chaz6 Chris Hills added a comment - I would suggest simply:- installed =`echo "$installed" |sed -n p1` In the mean time you can upgrade like this:- sudo yum remove MariaDB-server && sudo yum install MariaDB-server
              Hide
              shenlong Hansen Ler added a comment -

              Thanks Christ for the workaround. Just remember after running this script

              sudo yum remove MariaDB-server && sudo yum install MariaDB-server
              

              Remember to start your SQL server

              sudo service mysql start
              
              Show
              shenlong Hansen Ler added a comment - Thanks Christ for the workaround. Just remember after running this script sudo yum remove MariaDB-server && sudo yum install MariaDB-server Remember to start your SQL server sudo service mysql start
              Hide
              elenst Elena Stepanova added a comment -

              ...and don't forget to run mysql_upgrade.
              In other words, do what exactly the error message (after the sed error) says, it suggests to perform manual upgrade via remove/install.

              Show
              elenst Elena Stepanova added a comment - ...and don't forget to run mysql_upgrade. In other words, do what exactly the error message (after the sed error) says, it suggests to perform manual upgrade via remove/install.

                People

                • Assignee:
                  serg Sergei Golubchik
                  Reporter:
                  pprkut Heinz Wiesinger
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 5 minutes
                    5m