saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.03k stars 5.47k forks source link

pkg.group_installed operation doesn't like obsoleted pointers #56478

Open nicholasmhughes opened 4 years ago

nicholasmhughes commented 4 years ago

Description of Issue

Stateful enforcement of package groups doesn't seem to work when a package has been obsoleted in lieu of another. YUM is able to resolve the pointer and install the new package, but that information never makes it back to Salt... which just checks to see if the original package listing was installed.

Setup

groupinstall_gnome_desktop:
  pkg.group_installed:
    - name: "@gnome-desktop"

Steps to Reproduce Issue

Run the state above:

[root@c7-xrdp-01 salt]# salt-call state.apply desktop --state-output=full -l info
[INFO    ] Loading fresh modules for state activity
[INFO    ] Fetching file from saltenv 'base', ** done ** 'desktop/init.sls'
[INFO    ] Running state [@gnome-desktop] at time 22:25:30.588810
[INFO    ] Executing state pkg.group_installed for [@gnome-desktop]
[INFO    ] Executing command [u'rpm', u'-qa', u'--queryformat', u'%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)_|-%{INSTALLTIME}'] in directory '/root'
[INFO    ] Executing command [u'yum', u'--quiet', u'groupinfo', u'@gnome-desktop'] in directory '/root'
[INFO    ] Executing command [u'systemd-run', u'--scope', u'yum', u'-y', u'install', u'redhat-access-gui', u'caribou', u'caribou-gtk3-module', u'caribou-gtk2-module'] in directory '/root'
[INFO    ] Executing command [u'rpm', u'-qa', u'--queryformat', u'%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)_|-%{INSTALLTIME}'] in directory '/root'
[ERROR   ] Failed to install the following packages: caribou, caribou-gtk2-module, caribou-gtk3-module, redhat-access-gui
[INFO    ] Completed state [@gnome-desktop] at time 22:25:35.290560 (duration_in_ms=4701.749)
local:
----------
          ID: groupinstall_gnome_desktop
    Function: pkg.group_installed
        Name: @gnome-desktop
      Result: False
     Comment: Failed to install the following packages: caribou, caribou-gtk2-module, caribou-gtk3-module, redhat-access-gui
     Started: 22:25:30.588811
    Duration: 4701.749 ms
     Changes:   

Summary for local
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
Total run time:   4.702 s

Here is where you can see that yum resolves pointers from the obsoleted packages, but the state merely checks to see if the original package is in the installed listing afterward.

[root@c7-xrdp-01 salt]# yum install caribou caribou-gtk2-module caribou-gtk3-module redhat-access-gui
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.umd.edu
 * epel: mirror.umd.edu
 * extras: mirrors.advancedhosters.com
 * updates: mirror.ash.fastserv.com
Package caribou-0.4.21-1.el7.x86_64 is obsoleted by gnome-shell-3.28.3-14.el7_7.x86_64 which is already installed
Package caribou-gtk2-module-0.4.21-1.el7.x86_64 is obsoleted by gnome-shell-3.28.3-14.el7_7.x86_64 which is already installed
Package caribou-gtk3-module-0.4.21-1.el7.x86_64 is obsoleted by gnome-shell-3.28.3-14.el7_7.x86_64 which is already installed
No package redhat-access-gui available.
Nothing to do

Versions Report

Salt Version:
           Salt: 3000

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.6.2
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Aug  7 2019, 00:51:29)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.1.4

System Versions:
           dist: centos 7.7.1908 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-1062.18.1.el7.x86_64
         system: Linux
        version: CentOS Linux 7.7.1908 Core
nicholasmhughes commented 4 years ago

seems to be reported in closed issue #42645

sagetherage commented 4 years ago

oh great, so it was reported and stale bot is hanging us - thank you for the report @nicholasmhughes

xeacott commented 4 years ago

I"ll keep this open then in the midst of the other issue, too. Reported/Related: https://github.com/saltstack/salt/issues/42645 Similar: https://github.com/saltstack/salt/issues/38841