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

pkg.group_installed doesn't handle missing package group #35819

Closed
cable2999 opened this issue Aug 26, 2016 · 2 comments
Closed

pkg.group_installed doesn't handle missing package group #35819

cable2999 opened this issue Aug 26, 2016 · 2 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix P4 Priority 4 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around State-Module
Milestone

Comments

@cable2999
Copy link

Description of Issue/Question

A malformed package group can cause a unhandled exception, even if you are trying to skip said package gruop.

Setup

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

CentOS7 with epel repo enabled:

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

MATE Desktop:
  pkg.group_installed:
    - skip:
      - admin-tools

[DEBUG   ] LazyLoaded config.get
[DEBUG   ] Results of YAML rendering: 
OrderedDict([('xfce', 'pkg.group_installed'), ('MATE Desktop', OrderedDict([('pkg.group_installed', [OrderedDict([('skip', ['admin-tools'])])])])), ('install-cinnamon-for-remlinux', OrderedDict([('pkg.installed', [OrderedDict([('pkgs', ['cinnamon'])])])]))])
[PROFILE ] Time (in seconds) to render '/var/cache/salt/minion/files/extra-desktops/init.sls' using 'yaml' renderer: 0.00969314575195
[DEBUG   ] LazyLoaded pkg.install
[DEBUG   ] LazyLoaded pkg.group_installed
[DEBUG   ] You should upgrade pyOpenSSL to at least 0.14.1 to enable the use of X509 extensions in the tls module
[DEBUG   ] Could not LazyLoad pkg.ex_mod_init
[INFO    ] Running state [MATE Desktop] at time 10:31:08.515147
[INFO    ] Executing state pkg.group_installed for MATE Desktop
[INFO    ] Executing command ['yum', '--quiet', 'groupinfo', 'MATE Desktop'] in directory '/root'
[INFO    ] Executing command ['yum', '--quiet', 'groupinfo', 'admin-tools'] in directory '/root'
[ERROR   ] An exception occurred in this state: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/state.py", line 1733, in call
    **cdata['kwargs'])
  File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1651, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/states/pkg.py", line 2231, in group_installed
    diff = __salt__['pkg.group_diff'](name)
  File "/usr/lib/python2.7/site-packages/salt/modules/yumpkg.py", line 1899, in group_diff
    group_pkgs = group_info(name, expand=True)
  File "/usr/lib/python2.7/site-packages/salt/modules/yumpkg.py", line 1863, in group_info
    expanded = group_info(line, expand=True)
  File "/usr/lib/python2.7/site-packages/salt/modules/yumpkg.py", line 1839, in group_info
    raise CommandExecutionError('Group \'{0}\' not found'.format(name))
CommandExecutionError: Group 'admin-tools' not found

[INFO    ] Completed state [MATE Desktop] at time 10:31:14.453135 duration_in_ms=5937.988
[DEBUG   ] LazyLoaded highstate.output
local:
----------
          ID: MATE Desktop
    Function: pkg.group_installed
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python2.7/site-packages/salt/state.py", line 1733, in call
                  **cdata['kwargs'])
                File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1651, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python2.7/site-packages/salt/states/pkg.py", line 2231, in group_installed
                  diff = __salt__['pkg.group_diff'](name)
                File "/usr/lib/python2.7/site-packages/salt/modules/yumpkg.py", line 1899, in group_diff
                  group_pkgs = group_info(name, expand=True)
                File "/usr/lib/python2.7/site-packages/salt/modules/yumpkg.py", line 1863, in group_info
                  expanded = group_info(line, expand=True)
                File "/usr/lib/python2.7/site-packages/salt/modules/yumpkg.py", line 1839, in group_info
                  raise CommandExecutionError('Group \'{0}\' not found'.format(name))
              CommandExecutionError: Group 'admin-tools' not found
     Started: 10:31:08.515147
    Duration: 5937.988 ms
     Changes:   

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

Salt Version:
Salt: 2016.3.1

Dependency Versions:
cffi: Not Installed
cherrypy: 3.2.2
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.7.2
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.7
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.5 (default, Nov 20 2015, 02:00:19)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 14.7.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5

System Versions:
dist: centos 7.2.1511 Core
machine: x86_64
release: 3.10.0-327.22.2.el7.x86_64
system: Linux
version: CentOS Linux 7.2.1511 Core

@Ch3LL
Copy link
Contributor

Ch3LL commented Aug 26, 2016

@cable2999 agreed we need to be spitting out a more useful error and not stack tracing here. Thanks we will need to get this fixed.

@Ch3LL Ch3LL added State-Module Bug broken, incorrect, or confusing behavior severity-low 4th level, cosemtic problems, work around exists severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P4 Priority 4 Platform Relates to OS, containers, platform-based utilities like FS, system based apps labels Aug 26, 2016
@Ch3LL Ch3LL added this to the Approved milestone Aug 26, 2016
@Ch3LL Ch3LL removed the severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around label Aug 26, 2016
rallytime pushed a commit to rallytime/salt that referenced this issue Aug 30, 2016
Includes an integration test to make sure this doesn't regress.

Fixes saltstack#35819
@rallytime
Copy link
Contributor

Hi @cable2999 - please see #35907 for the fix.

@rallytime rallytime added severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around TEAM Core and removed severity-low 4th level, cosemtic problems, work around exists labels Aug 30, 2016
@rallytime rallytime modified the milestones: C 4, Approved Aug 30, 2016
@rallytime rallytime self-assigned this Aug 30, 2016
@rallytime rallytime added the fixed-pls-verify fix is linked, bug author to confirm fix label Aug 30, 2016
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 fixed-pls-verify fix is linked, bug author to confirm fix P4 Priority 4 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around State-Module
Projects
None yet
Development

No branches or pull requests

4 participants