Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-6925

puppetlabs-mysql : mysql_version error if zimbra is installed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mysql
    • Labels:
      None
    • Template:
      MODULES Bug Template
    • Epic Link:
    • Team:
      Modules
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      Module Version: 5.3.0
      Puppet Version: 4.9.4
      OS Name/Version: CentOS 7 (3.10.0-514.26.2.el7.x86_64)

      When retrieving facts froms servers which have zimbra installed, an error is returned for mysql_version.
       

      Error: Facter: error while resolving custom fact "mysql_version": undefined method `[]' for nil:NilClass
      

      This happens because zimbra is actually a wraper for many services, including MySQL/MariaDB.

      When mysql_version.rb calls 'mysql --version', it is actually calling zimbra's shell script wrapper, which performs some tests and then execute the real command.

      There are many possibilities for the returned values from the wrapper and mapping them all is not a very good approach.

      I was able to solve the issue with the change below to mysql_version.rb
      (the same goes for mysql*d*_version.rb) 

      Facter.add('mysql_version') do
        setcode do
          Facter::Util::Resolution.exec('mysql --version')[/\d+(\.\d+){2}/] if Facter::Util::Resolution.which('mysql')
        end
      end 
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            RASG RASG
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support