Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

state pkg.installed fails when using wildcard '*' in version for el7_5.1 release #51137

Open
Paulo-Nunes opened this issue Jan 10, 2019 · 0 comments
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@Paulo-Nunes
Copy link
Contributor

Description of Issue/Question

Attempting to run pkg.installed state with name:'gcc-gfortran' and version:'4.8.5-28.el7*' fails when actual package version is: 4.8.5-28.el7_5.1
Seems to be related to not looking in the proper repo when wild card is used

Why can salt not install the package if the wildcard is used, but works when specifying the complete version?

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

Steps to Reproduce Issue

salt "minion" state.single pkg.installed name='gcc-gfortran' version="4.8.5-28.el7*"
----------
          ID: gcc-gfortran
    Function: pkg.installed
      Result: False
     Comment: Error occurred installing package(s). Additional info follows:
              
              errors:
                  - No version matching '4.8.5-28.el7*' found for package 'gcc-gfortran' (available: none)
     Started: 08:39:22.919816
    Duration: 12204.592 ms
     Changes: 
salt "minion" pkg.latest_version gcc-gfortran
4.8.5-28.el7_5.1

when running the install above as a salt-call with debug I see that salt runs:

[INFO    ] Executing command ['yum', '--quiet', '--showduplicates', 'repository-packages', 'x', 'list', 'gcc-gfortran'] in directory '/home/root'

And does this for each of the repos defined in /etc/yum.repos.d

Running the same command with the exact version results in a success.

[INFO    ] Executing command ['systemd-run', '--scope', 'yum', '-y', 'install', 'gcc-gfortran-4.8.5-28.el7_5.1'] in directory '/home/root'
[INFO    ] Executing command ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)'] in directory '/home/root'
[DEBUG   ] Could not LazyLoad pkg.version_clean: 'pkg.version_clean' is not available.
[INFO    ] Made the following changes:
'gcc-gfortran' changed from 'absent' to '4.8.5-28.el7_5.1'
'libquadmath-devel' changed from 'absent' to '4.8.5-28.el7_5.1'
----------
          ID: gcc-gfortran
    Function: pkg.installed
      Result: True
     Comment: 1 targeted package was installed/updated.
     Started: 08:42:06.226108
    Duration: 13764.925 ms
     Changes:   
              ----------
              gcc-gfortran:
                  ----------
                  new:
                      4.8.5-28.el7_5.1
                  old:
              libquadmath-devel:
                  ----------
                  new:
                      4.8.5-28.el7_5.1
                  old:

Running: rpm -qa --queryformat '%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)' and looking only for gcc-gfortran
gcc-gfortran_|-(none)_|-4.8.5_|-28.el7_5.1_|-x86_64_|-(none)

pkg.list_repo_pkgs does not list gcc-gfortran
list_repos does not list the repo that the package belongs to, but that repo is not defined in /etc/yum.repos.d

Using fromrepo='rhel7-201810-x86_64' in the pkg.installed state works.

Versions Report

Salt Version:
Salt: 2017.7.7

Dependency Versions:
cffi: 1.11.5
cherrypy: Not Installed
dateutil: 1.5
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.7.2
libgit2: 0.26.5
libnacl: Not Installed
M2Crypto: 0.28.2
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: 2.18
pycrypto: 2.6.1
pycryptodome: 3.6.1
pygit2: 0.26.3
Python: 2.7.5 (default, May 31 2018, 09:41:32)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4

System Versions:
dist: redhat 7.5 Maipo
locale: UTF-8
machine: x86_64
release: 3.10.0-862.14.4.el7.x86_64
system: Linux
version: Red Hat Enterprise Linux Server 7.5 Maipo

minion on same salt version and RHEL version

@garethgreenaway garethgreenaway added this to the Approved milestone Jan 11, 2019
@garethgreenaway garethgreenaway added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P2 Priority 2 labels Jan 11, 2019
@sagetherage sagetherage removed the P2 Priority 2 label Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

3 participants