salt icon indicating copy to clipboard operation
salt copied to clipboard

pkg.installed throws error when installing on RHEL 6.5

Open iskondi opened this issue 12 years ago • 5 comments

I have a state file that installs httpd on CentOS 6.4 and works like a champ, however, when trying to use the same state file on RHEL 6.5 I get the following error:

----------
    State: - pkg
    Name:      httpd
    Function:  installed
        Result:    False
        Comment:   An exception occurred in this state: Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/salt/state.py", line 1305, in call
    *cdata['args'], **cdata['kwargs'])
  File "/usr/lib/python2.6/site-packages/salt/states/pkg.py", line 428, in installed
    fromrepo=fromrepo, **kwargs)
  File "/usr/lib/python2.6/site-packages/salt/states/pkg.py", line 162, in _find_install_targets
    problems = _preflight_check(desired, **kwargs)
  File "/usr/lib/python2.6/site-packages/salt/states/pkg.py", line 288, in _preflight_check
    *desired.keys(), fromrepo=fromrepo, **kwargs
  File "/usr/lib/python2.6/site-packages/salt/modules/yumpkg.py", line 420, in check_db
    [x for x in yumbase.searchPackages(('name', 'arch'), (pkgname,))
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 2692, in searchPackages
    for (po, matched_strings) in match_gen:
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 2566, in searchGenerator
    for sack in self.pkgSack.sacks.values():
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 887, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 669, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.6/site-packages/yum/repos.py", line 279, in populateSack
    self.doSetup()
  File "/usr/lib/python2.6/site-packages/yum/repos.py", line 105, in doSetup
    self.ayum.plugins.run('postreposetup')
  File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/rhui-lb.py", line 120, in postreposetup_hook
    ', '.join(cds_balancers))
PluginYumExit: Could not contact any CDS load balancers: rhui2-cds01.us-west-2.aws.ce.redhat.com, rhui2-cds02.us-west-2.aws.ce.redhat.com.

If I change that section of the state file to instead be a cmd.run it will install correctly.

This throws the error above:

httpd:
  pkg:
    - installed

This works:

insthttpd:
  cmd:
    - run
    - name: yum -y install httpd

If I run salt-minion restart on the RHEL minion and rerun the state it will work correctly. I'm guessing that something is being updated as part of yum update that requires the salt-minion to restart but I cannot seem to perform that restart from within a state...

Salt-Master versions-report:
           Salt: 0.17.4
         Python: 2.6.6 (r266:84292, Nov 22 2013, 12:16:22)
         Jinja2: 2.2.1
       M2Crypto: 0.20.2
 msgpack-python: 0.1.13
   msgpack-pure: Not Installed
       pycrypto: 2.0.1
         PyYAML: 3.10
          PyZMQ: 2.2.0.1
            ZMQ: 3.2.4

Salt-Minion versions-report:
           Salt: 0.17.4
         Python: 2.6.6 (r266:84292, Nov 21 2013, 10:50:32)
         Jinja2: 2.2.1
       M2Crypto: 0.20.2
 msgpack-python: 0.1.13
   msgpack-pure: Not Installed
       pycrypto: 2.0.1
         PyYAML: 3.10
          PyZMQ: 2.2.0.1
            ZMQ: 3.2.4

iskondi avatar Jan 28 '14 06:01 iskondi

I think this will be alleviated by the change we made in version 2014.1.0 to use the version of yumpkg.py that shells out, instead of using the yum API. The version of yumpkg.py that you're using has been deprecated in the next major version of salt (2014.1.0). Any chance you could test on the release candidate that's out?

basepi avatar Jan 31 '14 22:01 basepi

@iskondi - were you able to test on the release that @basepi mentioned above? Are you still seeing these issues?

If everything is working here, feel free to close this one out. Otherwise, please let us know if the issue persists.

rallytime avatar Apr 14 '14 19:04 rallytime

I'm going to close this one, since we haven't heard back in awhile. If this issue still persists on current versions of salt, please comment and we'll re-open!

basepi avatar Apr 17 '14 16:04 basepi

Hey Nicole,

Sorry I wasn't able to test this, we ended up going a different route to work around it and setting it back up to test it would prove more complex. I'll let you know if we run into it in the future!

David T. F. Levinger Sr. Director IT, Paxata Cell: 415.269.0062 Email: [email protected]

Adaptive Data Preparation for Business Analysts Go from raw data to READY data...right now.

On Mon, Apr 14, 2014 at 12:16 PM, Nicole Thomas [email protected]:

@iskondi https://github.com/iskondi - were you able to test on the release that @basepi https://github.com/basepi mentioned above? Are you still seeing these issues?

If everything is working here, feel free to close this one out. Otherwise, please let us know if the issue persists.

Reply to this email directly or view it on GitHubhttps://github.com/saltstack/salt/issues/9982#issuecomment-40406339 .

iskondi avatar Apr 17 '14 16:04 iskondi

@iskondi - sounds good! Thanks for the info!

rallytime avatar Apr 17 '14 17:04 rallytime