Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1726

Package management: version detects incorrectly with rpm

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Rejected
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Promise type: packages
    • Labels:
      None
    • Platform:
      Linux

      Description

      This is exerpt from my configuration for updating packages (working correctly on cfengine v.3.6.1):

      <pre>
      bundle agent update_zabbix_packages_evc
      {
      vars:
      "packages" slist =>

      { "zabbix","zabbix-agent" }

      ;

      packages:
      "$(packages)"
      package_policy => "addupdate",
      package_select => "==",
      package_method => yum_rpm_my,
      package_version => "2.2.6",
      classes => check_result("$(this.promiser)");
      ...
      }

      body package_method yum_rpm_my
      {
      package_changes => "bulk";
      package_list_command => "/bin/rpm -qa --qf '%

      {name}

      %

      {version}

      %

      {arch}

      \n'";
      package_patch_list_command => "/usr/bin/yum --quiet check-update";

      package_list_name_regex => "(^[^ ]) [^ ] [^ ]+$";
      package_list_version_regex => "^[^ ]+ ([^ ]) [^ ]$";
      package_list_arch_regex => "^[^ ]+ [^ ]+ ([^ ]+)$";

      package_installed_regex => ".*";

      package_delete_convention => "$(name)";

      1. set it to "0" to avoid caching of list during upgrade
        package_list_update_command => "/usr/bin/yum --quiet check-update";
        package_list_update_ifelapsed => "240";

      package_add_command => "/usr/bin/yum -y install";
      package_update_command => "/usr/bin/yum -y update";
      package_delete_command => "/bin/rpm -e --nodeps";
      package_verify_command => "/bin/rpm -V";
      }
      ...
      </pre>

      Exerpt from output of cf-agent 3.6.1 (verbose):

      <pre>
      cf-agent -v -K -b install_zabbix_agent_evc -f ./test.cf
      ...
      2014-10-20T11:52:00+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (libgcc,4.4.7,x86_64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:00+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (fipscheck,1.2.0,x86_64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:00+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (ipw2200-firmware,3.1,noarch) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:00+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (newt,0.52.11,x86_64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:00+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (rt73usb-firmware,1.8,noarch) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:00+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (iwl3945-firmware,15.32.2.9,noarch) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:00+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (iwl4965-firmware,228.61.2.24,noarch) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:00+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (libtasn1,2.3,x86_64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:00+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (atmel-firmware,1.3,noarch) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (openssl,1.0.1e,x86_64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (ivtv-firmware,20080701,noarch) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (iwl5000-firmware,8.83.5.1_1,noarch) to [==] wiGth given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (zabbix,2.2.6,x86_64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Matched [available] name 'zabbix'
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Matched [available] wildcard arch '*'
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Check for compatible versioning model in (2.2.6,2.2.6)
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Verified that versioning models are compatible
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: CompareVersions: Checked whether package version 2.2.6 == 2.2.6: yes
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Version comparison returned MATCH for [available] package (zabbix,2.2.6,x86
      _64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: PackageMatch: package comparison for [available] zabbix was decisive: MATCH
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: CheckPackageState: Available package match for (zabbix,2.2.6,*) [name,version,arch] was decisive: MATCH
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Additional promise info: source path './test.cf' at line 36
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Package 'zabbix' already installed and matches criteria
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Defining promise result class 'zabbix_kept'
      2014-10-20T11:52:01+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Defining promise result class 'zabbix_ok'
      ...
      </pre>

      Exerpt from output of cf-agent 3.6.2 (verbose):

      <pre>
      ...
      2014-10-20T11:57:40+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (b43-openfwwf,5.2-4.el6,noarch) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:57:40+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (passwd,0.77-4.el6_2.2,x86_64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (attr,2.4.44-7.el6,x86_64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (rootfiles,8.1-6.1.el6,noarch) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (libselinux,2.0.94-5.3.el6_4.1,x86_64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (db4,4.7.25-18.el6_4,x86_64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (gzip,1.3.12-19.el6_4,x86_64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (dbus-glib,0.86-6.el6,x86_64) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Comparing [available] package (setup,2.8.14-20.el6_4.1,noarch) to [==] with given (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: PackageMatch did not find [available] packages to match the constraints of promise (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: CheckPackageState: Available package match for (zabbix,2.2.6,*) [name,version,arch] was decisive: ERROR-OR-NOMATCH
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: CheckPackageState: matched package (zabbix,2.2.6,*) [name,version,arch]; scheduling operation
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Checking if package (zabbix,2.2.6,*) [name,version,arch] is at the desired state (installed=1,matched=0)
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Package promises to refer to itself as 'zabbix' to the manager
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Package version seems to match criteria
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Package method does NOT specify a file repository
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Checking if latest available version is newer than installed...
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Looking for an installed package older than (zabbix,2.2.6,*) [name,version,arch]
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Found installed package (zabbix,2.2.6-1.el6,x86_64) [name,version,arch]
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Check for compatible versioning model in (2.2.6-1.el6,2.2.6)
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Verified that versioning models are compatible
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: CompareVersions: Checked whether package version 2.2.6-1.el6 < 2.2.6: no
      2014-10-20T11:57:41+0400 verbose: /default/install_zabbix_agent_evc/methods/'update_zabbix_packages_evc'/default/update_zabbix_packages_evc/packages/'zabbix'[0]: Installed package is up to date, not updating
      ...
      </pre>

      Note on how package version detects:

      On 3.6.1: Comparing [available] package (zabbix,2.2.6,x86_64) to ...
      On 3.6.2: Comparing [available] package (dbus-glib,0.86-6.el6,x86_64) to ...

      on 3.6.2 it adds release to package version

        Attachments

          Activity

            People

            • Assignee:
              a10040 Kristian Amlie
              Reporter:
              shigor Igor Moskovtsev
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel