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

portage_config.enforce_nice_config crashed #8252

Closed
babykart opened this issue Nov 4, 2013 · 15 comments · Fixed by #8924
Closed

portage_config.enforce_nice_config crashed #8252

babykart opened this issue Nov 4, 2013 · 15 comments · Fixed by #8924
Labels
Bug broken, incorrect, or confusing behavior help-wanted Community help is needed to resolve this

Comments

@babykart
Copy link

babykart commented Nov 4, 2013

hi,
salt '*' portage_config.enforce_nice_config crashed on Gentoo distro.

entropie-mrs0-babykart:
    Traceback (most recent call last):
      File "/usr/lib64/python2.7/site-packages/salt/minion.py", line 659, in _thread_return
        return_data = func(*args, **kwargs)
      File "/usr/lib64/python2.7/site-packages/salt/modules/portage_config.py", line 72, in enforce_nice_config
        _order_all_package_confs()
      File "/usr/lib64/python2.7/site-packages/salt/modules/portage_config.py", line 89, in _order_all_package_confs
        _package_conf_ordering(conf_file)
      File "/usr/lib64/python2.7/site-packages/salt/modules/portage_config.py", line 184, in _package_conf_ordering
        append_to_package_conf(conf, string=line)
      File "/usr/lib64/python2.7/site-packages/salt/modules/portage_config.py", line 248, in append_to_package_conf
        atom = string.strip().split()[0]
    IndexError: list index out of range

salt-minion --versions-report
           Salt: 0.17.1
         Python: 2.7.5 (default, Oct 17 2013, 14:25:00)
         Jinja2: 2.7
       M2Crypto: 0.21.1
 msgpack-python: 0.4.0
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
         PyYAML: 3.10
          PyZMQ: 13.1.0
            ZMQ: 4.0.1
@basepi
Copy link
Contributor

basepi commented Nov 4, 2013

Thanks for the heads up. Should be easy to fix.

@babykart
Copy link
Author

babykart commented Nov 5, 2013

Hi,
Cool! because this bug breacks all states with pkg.installed on Gentoo.
Regards,

@basepi
Copy link
Contributor

basepi commented Nov 5, 2013

Definitely not a good thing!

@tmessi
Copy link
Contributor

tmessi commented Nov 12, 2013

@babykart what do your current package.* files look like?

@babykart
Copy link
Author

@shadowfax-chc for example

  • Directories:
package.keywords
package.use

File in package.keywords:

  • db.keywords:
virtual/mysql
dev-db/mariadb

File in package.use:

  • db.use:
dev-db/mariadb tcmalloc -perl

@tmessi
Copy link
Contributor

tmessi commented Nov 12, 2013

do any have comment lines?

@babykart
Copy link
Author

@shadowfax-chc yes and one with:

<sys-kernel/gentoo-sources-3.12
<sys-kernel/linux-headers-3.12

@tmessi
Copy link
Contributor

tmessi commented Nov 13, 2013

I think the comments might be the issue, The code needs to be updated to ignore lines with comments. It may also be having trouble with blank lines. When I get a chance I will fix it. You can try removing comment and blank lines for now.

@babykart
Copy link
Author

@shadowfax-chc thanks for your return. I will try this tonight...

@babykart
Copy link
Author

@shadowfax-chc It works effectively without blank lines and comments. Thank you.

@basepi
Copy link
Contributor

basepi commented Nov 14, 2013

So is there still something here that needs fixing, or can we close this issue?

@tmessi
Copy link
Contributor

tmessi commented Nov 14, 2013

Leave it open, the code needs to be fixed up so users don't need to manually remove comment and blank lines.

@babykart
Copy link
Author

@shadowfax-chc 👍

@ghost
Copy link

ghost commented Nov 29, 2013

I'm being hit by the same bug:

2013-11-28 13:15:41,276 [salt.minion                                 ][WARNING ] The minion function caused an exception: Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/salt/minion.py", line 691, in _thread_return
    return_data = func(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/salt/modules/state.py", line 358, in sls
    ret = st_.state.call_high(high_)
  File "/usr/lib64/python2.7/site-packages/salt/state.py", line 1583, in call_high
    ret = self.call_chunks(chunks)
  File "/usr/lib64/python2.7/site-packages/salt/state.py", line 1316, in call_chunks
    running = self.call_chunk(low, running, chunks)
  File "/usr/lib64/python2.7/site-packages/salt/state.py", line 1431, in call_chunk
    self._mod_init(low)
  File "/usr/lib64/python2.7/site-packages/salt/state.py", line 521, in _mod_init
    mret = self.states[minit](low)
  File "/usr/lib64/python2.7/site-packages/salt/states/pkg.py", line 871, in mod_init
    ret = __salt__['pkg.ex_mod_init'](low)
  File "/usr/lib64/python2.7/site-packages/salt/modules/ebuild.py", line 169, in ex_mod_init
    __salt__['portage_config.enforce_nice_config']()
  File "/usr/lib64/python2.7/site-packages/salt/modules/portage_config.py", line 72, in enforce_nice_config
    _order_all_package_confs()
  File "/usr/lib64/python2.7/site-packages/salt/modules/portage_config.py", line 90, in _order_all_package_confs
    _unify_keywords()
  File "/usr/lib64/python2.7/site-packages/salt/modules/portage_config.py", line 114, in _unify_keywords
    append_to_package_conf('accept_keywords', string=line)
  File "/usr/lib64/python2.7/site-packages/salt/modules/portage_config.py", line 251, in append_to_package_conf
    atom = _p_to_cp(atom)
  File "/usr/lib64/python2.7/site-packages/salt/modules/portage_config.py", line 54, in _p_to_cp
    ret = _porttree().dbapi.xmatch("match-all", p)
  File "/usr/lib64/python2.7/site-packages/portage/dbapi/porttree.py", line 825, in xmatch
    mydep = dep_expand(origdep, mydb=self, settings=self.settings)
  File "/usr/lib64/python2.7/site-packages/portage/dbapi/dep_expand.py", line 35, in dep_expand
    mydep = Atom(mydep, allow_repo=True)
  File "/usr/lib64/python2.7/site-packages/portage/dep/__init__.py", line 1255, in __init__
    raise InvalidAtom(self)
InvalidAtom: #

2013-11-28 13:18:15,844 [salt.minion                                 ][WARNING ] The minion function caused an exception: Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/salt/minion.py", line 691, in _thread_return
    return_data = func(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/salt/modules/state.py", line 358, in sls
    ret = st_.state.call_high(high_)
  File "/usr/lib64/python2.7/site-packages/salt/state.py", line 1583, in call_high
    ret = self.call_chunks(chunks)
  File "/usr/lib64/python2.7/site-packages/salt/state.py", line 1316, in call_chunks
    running = self.call_chunk(low, running, chunks)
  File "/usr/lib64/python2.7/site-packages/salt/state.py", line 1431, in call_chunk
    self._mod_init(low)
  File "/usr/lib64/python2.7/site-packages/salt/state.py", line 521, in _mod_init
    mret = self.states[minit](low)
  File "/usr/lib64/python2.7/site-packages/salt/states/pkg.py", line 871, in mod_init
    ret = __salt__['pkg.ex_mod_init'](low)
  File "/usr/lib64/python2.7/site-packages/salt/modules/ebuild.py", line 169, in ex_mod_init
    __salt__['portage_config.enforce_nice_config']()
  File "/usr/lib64/python2.7/site-packages/salt/modules/portage_config.py", line 71, in enforce_nice_config
    _convert_all_package_confs_to_dir()
  File "/usr/lib64/python2.7/site-packages/salt/modules/portage_config.py", line 80, in _convert_all_package_confs_to_dir
    _package_conf_file_to_dir(conf_file)
  File "/usr/lib64/python2.7/site-packages/salt/modules/portage_config.py", line 136, in _package_conf_file_to_dir
    os.mkdir(path, 0755)
OSError: [Errno 2] No such file or directory: '/etc/portage/package.accept_keywords'

I can confirm that the breakage is related to comments ('#' signs) inside /etc/portage/package.use or /etc/portage/package.unmask.

@kaithar
Copy link
Contributor

kaithar commented Jan 15, 2014

Regression encountered. I'm going move it to a new issue actually.

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 help-wanted Community help is needed to resolve this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants