Open ryanwalder opened 4 years ago
@ryanwalder Thanks for filing an issue on this problem. Actually found that even with just the incorrect second.sls by itself that error reporting is incorrect.
root@deb9min:/srv/pillar# cat top.sls base: '*':
root@deb9min:/srv/pillar# cat second.sls one: two one: {} root@deb9min:/srv/pillar# salt-call --local pillar.items --retcode-passthrough [DEBUG ] Configuration file path: /etc/salt/minion [WARNING ] Insecure logging configuration detected! Sensitive data may be logged. [DEBUG ] Grains refresh requested. Refreshing grains. [DEBUG ] Reading configuration from /etc/salt/minion [DEBUG ] Including configuration from '/etc/salt/minion.d/_schedule.conf' [DEBUG ] Reading configuration from /etc/salt/minion.d/_schedule.conf [DEBUG ] Determining pillar cache [DEBUG ] LazyLoaded jinja.render [DEBUG ] LazyLoaded yaml.render [DEBUG ] compile template: /srv/pillar/top.sls [DEBUG ] Jinja search path: [u'/srv/pillar', u'/srv/spm/pillar'] [PROFILE ] Time (in seconds) to render '/srv/pillar/top.sls' using 'jinja' renderer: 0.00800204277039 [DEBUG ] Rendered data from file: /srv/pillar/top.sls: base: '*':
[DEBUG ] Results of YAML rendering: OrderedDict([(u'base', OrderedDict([(u'', [u'second'])]))]) [PROFILE ] Time (in seconds) to render '/srv/pillar/top.sls' using 'yaml' renderer: 0.000646114349365 [DEBUG ] LazyLoaded confirm_top.confirm_top [DEBUG ] LazyLoaded compound_match.match [DEBUG ] compound_match: t9 ? [DEBUG ] LazyLoaded glob_match.match [DEBUG ] compound_match t9 ? "*" => "True" [DEBUG ] compile template: /srv/pillar/second.sls [DEBUG ] Jinja search path: [u'/srv/pillar', u'/srv/spm/pillar'] [PROFILE ] Time (in seconds) to render '/srv/pillar/second.sls' using 'jinja' renderer: 0.00430393218994 [DEBUG ] Rendered data from file: /srv/pillar/second.sls: one: two one: {}
[CRITICAL] Rendering SLS 'second' failed, render error:
while constructing a mapping
in "
[DEBUG ] Results of YAML rendering: OrderedDict([(u'base', OrderedDict([(u'', [u'second'])]))]) [PROFILE ] Time (in seconds) to render '/srv/pillar/top.sls' using 'yaml' renderer: 0.000614166259766 [DEBUG ] LazyLoaded confirm_top.confirm_top [DEBUG ] LazyLoaded compound_match.match [DEBUG ] compound_match: t9 ? [DEBUG ] LazyLoaded glob_match.match [DEBUG ] compound_match t9 ? "*" => "True" [DEBUG ] compile template: /srv/pillar/second.sls [DEBUG ] Jinja search path: [u'/srv/pillar', u'/srv/spm/pillar'] [PROFILE ] Time (in seconds) to render '/srv/pillar/second.sls' using 'jinja' renderer: 0.00421905517578 [DEBUG ] Rendered data from file: /srv/pillar/second.sls: one: two one: {}
_errors:
- Rendering SLS 'second' failed. Please see master log for details.
root@deb9min:/srv/pillar# echo $? 0
Description of Issue
When running
pillar.items
if a pillar fails to render and is caught in_errors
it does not set the retcode to 5 as expected. It does fail and set the correct retcode when runningstate.apply
however.eg:
Setup
Setup pillar to read from 2 files
first.sls
second.sls
Steps to Reproduce Issue
Do the above and run
salt-call pillar.items --retcode-passthrough
you should seesecond.sls
fail due to duplicate keys, thenecho $?
and you'll see the retcode is 0, not 5 as described by the docs.Versions Report
Same version on minion & master