saltstack / saltstack/salt

[BUG] no hard stop when there is a pillar rendering error

Open
#57,923 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug severity-high
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

The error in a pillar file

system_configs:
  test_vums_p:
  test_vums_p:
  check_vums_q:
  check_vums_q:

The issue

salt keeps going and executes without a hard stop running states without any pillar data which is quite disturbing.

Why? Because there might be essential data in the pillar file which could easily lead to a reconfiguration of the whole host.

The Output

[CRITICAL] Rendering SLS 'vums-work' failed, render error:
while constructing a mapping
  in "<unicode string>", line 2, column 3
found conflicting ID 'test_vums_p'
  in "<unicode string>", line 3, column 3
Traceback (most recent call last):
  File "/root/src/salt/salt/pillar/__init__.py", line 741, in render_pstate
    **defaults)
  File "/root/src/salt/salt/template.py", line 101, in compile_template
    ret = render(input_data, saltenv, sls, **render_kwargs)
  File "/root/src/salt/salt/renderers/yaml.py", line 71, in render
    raise SaltRenderError(exc)
SaltRenderError: while constructing a mapping
  in "<unicode string>", line 2, column 3
found conflicting ID 'test_vums_p'
  in "<unicode string>", line 3, column 3
[CRITICAL] Pillar render error: Rendering SLS 'vums-work' failed. Please see master log for details.
[CRITICAL] Rendering SLS 'vums-work' failed, render error:
while constructing a mapping
  in "<unicode string>", line 2, column 3
found conflicting ID 'test_vums_p'
  in "<unicode string>", line 3, column 3
Traceback (most recent call last):
  File "/root/src/salt/salt/pillar/__init__.py", line 741, in render_pstate
    **defaults)
  File "/root/src/salt/salt/template.py", line 101, in compile_template
    ret = render(input_data, saltenv, sls, **render_kwargs)
  File "/root/src/salt/salt/renderers/yaml.py", line 71, in render
    raise SaltRenderError(exc)
SaltRenderError: while constructing a mapping
  in "<unicode string>", line 2, column 3
found conflicting ID 'test_vums_p'
  in "<unicode string>", line 3, column 3
[CRITICAL] Pillar render error: Rendering SLS 'vums-work' failed. Please see master log for details.

###################################################
THE REGULAR SALT OUTPUT
###################################################

Summary for vums-work
-------------
Succeeded: 68 (changed=3)
Failed:     2
-------------
Total states run:     70
Total run time:   20.662 s

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with salt/pillar/init.py at render_pstate, then follow salt/template.py's compile_template and salt/renderers/yaml.py's render path. Reproduce the duplicate-ID pillar error and trace what happens afterward. Done means a pillar rendering error prevents states from executing instead of continuing without pillar data, with a regression test covering the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.