salt icon indicating copy to clipboard operation
salt copied to clipboard

Error when db, job cache entry is in master config but no DB present

Open ssgward opened this issue 11 years ago • 1 comments

Tested on 2014.7.0, 2014.7.1 and 2015.2.0.

I get the error below when no DB is present. When DB is installed, no error. I would expect that no error would be shown and that any command run would be successful, regardless of the job_cache entry.

Here is the entry in my master config:

####   DB Connection   #####
#####################################
mysql.host: '127.0.0.1'
mysql.user: 'username'
mysql.pass: 'password'
mysql.db: 'saltdb'
mysql.port: 3306

#####  Master Job Cache   #####
###############################
master_job_cache: mysql

I run salt '*' test.ping (or any other command) and get this error:

[ERROR   ] An un-handled exception was caught by salt's global exception handler:
TypeError: 'dict' object is not callable
Traceback (most recent call last):
  File "/usr/bin/salt", line 10, in <module>
    salt_main()
  File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 351, in salt_main
    client.run()
  File "/usr/lib/python2.7/dist-packages/salt/cli/salt.py", line 191, in run
    for full_ret in cmd_func(**kwargs):
  File "/usr/lib/python2.7/dist-packages/salt/client/__init__.py", line 594, in cmd_cli
    **kwargs):
  File "/usr/lib/python2.7/dist-packages/salt/client/__init__.py", line 1235, in get_cli_event_returns
    expect_minions=(verbose or show_timeout)
  File "/usr/lib/python2.7/dist-packages/salt/client/__init__.py", line 862, in get_iter_returns
    if self.returners['{0}.get_load'.format(self.opts['master_job_cache'])](jid) == {}:
  File "/usr/lib/python2.7/dist-packages/salt/returners/mysql.py", line 229, in get_load
    with _get_serv(ret=None, commit=True) as cur:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/usr/lib/python2.7/dist-packages/salt/returners/mysql.py", line 157, in _get_serv
    _options = _get_options(ret)
  File "/usr/lib/python2.7/dist-packages/salt/returners/mysql.py", line 145, in _get_options
    defaults=defaults)
  File "/usr/lib/python2.7/dist-packages/salt/returners/__init__.py", line 85, in get_returner_options
    attrs,
  File "/usr/lib/python2.7/dist-packages/salt/returners/__init__.py", line 164, in _options_browser
    value = _fetch_option(cfg, ret_config, virtualname, options[option])
  File "/usr/lib/python2.7/dist-packages/salt/returners/__init__.py", line 125, in _fetch_option
    c_cfg = cfg('{0}'.format(virtualname), {})
TypeError: 'dict' object is not callable
Traceback (most recent call last):
  File "/usr/bin/salt", line 10, in <module>
    salt_main()
  File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 351, in salt_main
    client.run()
  File "/usr/lib/python2.7/dist-packages/salt/cli/salt.py", line 191, in run
    for full_ret in cmd_func(**kwargs):
  File "/usr/lib/python2.7/dist-packages/salt/client/__init__.py", line 594, in cmd_cli
    **kwargs):
  File "/usr/lib/python2.7/dist-packages/salt/client/__init__.py", line 1235, in get_cli_event_returns
    expect_minions=(verbose or show_timeout)
  File "/usr/lib/python2.7/dist-packages/salt/client/__init__.py", line 862, in get_iter_returns
    if self.returners['{0}.get_load'.format(self.opts['master_job_cache'])](jid) == {}:
  File "/usr/lib/python2.7/dist-packages/salt/returners/mysql.py", line 229, in get_load
    with _get_serv(ret=None, commit=True) as cur:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/usr/lib/python2.7/dist-packages/salt/returners/mysql.py", line 157, in _get_serv
    _options = _get_options(ret)
  File "/usr/lib/python2.7/dist-packages/salt/returners/mysql.py", line 145, in _get_options
    defaults=defaults)
  File "/usr/lib/python2.7/dist-packages/salt/returners/__init__.py", line 85, in get_returner_options
    attrs,
  File "/usr/lib/python2.7/dist-packages/salt/returners/__init__.py", line 164, in _options_browser
    value = _fetch_option(cfg, ret_config, virtualname, options[option])
  File "/usr/lib/python2.7/dist-packages/salt/returners/__init__.py", line 125, in _fetch_option
    c_cfg = cfg('{0}'.format(virtualname), {})
TypeError: 'dict' object is not callable

ssgward avatar Jan 16 '15 21:01 ssgward

All fixed. :]

cachedout avatar Jan 20 '15 19:01 cachedout