salt: state.highstate error with require_in: sls:

Description of Issue/Question

state.highstate test=true returns with

    Passed invalid arguments to state.highstate: list indices must be integers, not unicode

(followed by the complete state.highstate docs).

state.show_top works fine, and returns the expected result.

running state.sls with each individual state works, too. But state.highstate does not.

I found that when I removed the “require_in” block of something like

include:
  - slsfile1
  - slsfile2

some-state:
  test.nop:
    - require:
      - sls: slsfile1
    - require_in:
      - sls: slsfile2

the error no longer appears. The same states worked fine in Salt 2017.x.x

The closest Issue I found is #22852, but that’s supposed to be fixed. In either case, an error message pointing to the exact location would be nice (I had to “bisect” the state tree down to the exact location).

In the minion log file (level: trace), I found this Traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/minion.py", line 1600, in _thread_return
    return_data = minion_instance.executors[fname](opts, data, func, args, kwargs)
  File "/usr/lib/python2.7/site-packages/salt/executors/direct_call.py", line 12, in execute
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/modules/state.py", line 1055, in highstate
    orchestration_jid=orchestration_jid)
  File "/usr/lib/python2.7/site-packages/salt/state.py", line 3881, in call_highstate
    return self.state.call_high(high, orchestration_jid)
  File "/usr/lib/python2.7/site-packages/salt/state.py", line 2693, in call_high
    high, req_in_errors = self.requisite_in(high)
  File "/usr/lib/python2.7/site-packages/salt/state.py", line 1574, in requisite_in
    hinges = find_sls_ids(pname, high)
  File "/usr/lib/python2.7/site-packages/salt/state.py", line 246, in find_sls_ids
    if item['__sls__'] == sls:
TypeError: list indices must be integers, not unicode

Setup

Steps to Reproduce Issue

see above

Versions Report

Master: Salt Version: Salt: 2018.3.0

Dependency Versions: cffi: Not Installed cherrypy: unknown dateutil: Not Installed docker-py: Not Installed gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed Jinja2: 2.8.1 libgit2: Not Installed libnacl: Not Installed M2Crypto: Not Installed Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.4.6 mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pycryptodome: Not Installed pygit2: Not Installed Python: 2.7.14 (default, Jan 31 2018, 02:12:13) python-gnupg: Not Installed PyYAML: 3.11 PyZMQ: 14.5.0 RAET: Not Installed smmap: Not Installed timelib: Not Installed Tornado: 4.2.1 ZMQ: 4.0.5

System Versions: dist: centos 6.9 Final locale: UTF-8 machine: x86_64 release: 2.6.32-696.20.1.el6.x86_64 system: Linux version: CentOS 6.9 Final

Minion: Salt Version: Salt: 2018.3.0

Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: Not Installed docker-py: Not Installed gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed Jinja2: 2.7.2 libgit2: Not Installed libnacl: Not Installed M2Crypto: 0.21.1 Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.4.8 mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pycryptodome: Not Installed pygit2: Not Installed Python: 2.7.5 (default, Aug 4 2017, 00:39:18) 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: centos 7.4.1708 Core locale: UTF-8 machine: x86_64 release: 3.10.0-693.11.6.el7.x86_64 system: Linux version: CentOS Linux 7.4.1708 Core

Thanks,

Martin

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

yep it works 😃

Yeah that looks like what you meant. I’ve gotten it to reproduce in 2017.7 as well as 2018.3. I have a fix already written, and attempting to write a unit test for this now.