salt icon indicating copy to clipboard operation
salt copied to clipboard

Getting "invalid type of dict, a list is required" when trying to configure engines in master config file

Open b3hni4 opened this issue 9 years ago • 4 comments

Description of Issue/Question

Getting "invalid type of dict, a list is required" when trying to configure engines in master config file according to salt documentation page at: https://docs.saltstack.com/en/latest/ref/engines/all/salt.engines.reactor.html#module-salt.engines.reactor

part of the master config file looks like:


engines:
  reactor:
    refresh_interval: 70
    worker_threads: 12
    worker_hwm: 20000

reactor:
  - 'test/event/tag':
    - /srv/reactor/test_reactor.sls
...

Once the config is in place, the following message fills the master log file: /var/log/salt/master

2017-07-14 12:49:47,434 [salt.config      ][WARNING ][1266] Key 'engines' with value {'reactor': {'worker_hwm': 20000, 'worker_threads': 12, 'refresh_interval': 70}} has an invalid type of dict, a list is required for this value

but the salt reactor works fine with no issues.

if we change the master config as following to fix the "invalid type of dict, a list is required", the log warning messages would not be produced anymore, yet the salt reactor system works.

engines:
  - reactor:
      refresh_interval: 70
      worker_threads: 12
      worker_hwm: 20000

reactor:
  - 'test/event/tag':
    - /srv/reactor/test_reactor.sls
...

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).) Follow the instructions on Issue description.

Steps to Reproduce Issue

(Include debug logs if possible and relevant.) Follow the instructions on Issue description.

Versions Report

Salt Version:
           Salt: 2016.11.6

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 1.5
      docker-py: Not Installed
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 0.9.1
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.6 (default, Oct 26 2016, 20:30:19)
   python-gnupg: Not Installed
         PyYAML: 3.10
          PyZMQ: 14.0.1
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 3.13.0-123-generic
         system: Linux
        version: Ubuntu 14.04 trusty

@tn8or @RWejlgaard

b3hni4 avatar Jul 17 '17 06:07 b3hni4

Would the error here be the documentation giving a technically incorrect example or the warning message being displayed/flooded despite the system still being able to interpret the settings correctly?

CorvinM avatar Jul 17 '17 06:07 CorvinM

I think it could be a bit of both. The documentation gives an incorrect example. but by looking at the following __init__.py I can see both 'reactor' and 'engines' are defined to be of type list. https://github.com/saltstack/salt/blob/2016.11/salt/config/init.py#L689 https://github.com/saltstack/salt/blob/2016.11/salt/config/init.py#L701

b3hni4 avatar Jul 17 '17 06:07 b3hni4

I have marked this as a documentation error.

Thanks for reporting. Daniel

gtmanfred avatar Jul 17 '17 15:07 gtmanfred

Fixed via #42352

rallytime avatar Jul 18 '17 15:07 rallytime