salt Jobs fail with error "Rendering SLS 'sse' failed. Please see master log for details.
search cancel

salt Jobs fail with error "Rendering SLS 'sse' failed. Please see master log for details.

book

Article ID: 405132

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite) VMware SaltStack

Issue/Introduction

When attempting to execute a SaltStack job, such as applying a state (salt '*' state.apply path.to.sls), you encounter the error message: "Rendering SLS 'sse' failed. Please see master log for details."

Environment

salt-config 8.17

salt 3006.9

Cause

This error signifies that the Salt master failed to correctly process an SLS (Salt State Language) file during the rendering phase. Before Salt can apply the instructions defined in an SLS file, it first renders the file, which involves interpreting any embedded templating languages like Jinja and converting the content into a structured data format.
Common causes for this rendering failure include:
  • Jinja/YAML Syntax Errors: Improper indentation, missing colons, or other formatting issues within the YAML structure of the SLS file or the embedded Jinja templates can prevent successful rendering.
  • Missing or Incorrect Pillar/Grains Data: If the SLS relies on data from Salt's Pillar or Grains systems, and this data is unavailable, incorrectly formatted, or misreferenced, the rendering process may fail.
  • Undefined Variables: Attempting to use a Jinja variable that has not been defined or is referenced incorrectly can lead to a rendering error.
  • Circular Dependencies: In complex state hierarchies, where SLS files depend on each other in a cyclical manner, rendering errors can occur.
  • Stale Cache: In some cases, outdated or corrupted cache data on either the Salt master or minion can lead to unexpected rendering issues.


Sample salt-master logs: 

025-07-21 17:43:40,122 [salt.utils.parsers:1065][WARNING ][1603649] Master received a SIGTERM. Exiting.
2025-07-21 17:44:07,371 [salt.utils.templates:232 ][ERROR   ][4727] Rendering exception occurred
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/templates.py", line 476, in render_jinja_tmpl
    output = template.render(**decoded_context)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/opt/saltstack/salt/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 60, in top-level template code
  File "/opt/saltstack/salt/lib/python3.10/site-packages/jinja2/sandbox.py", line 326, in getattr
    value = getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'dict object' has no attribute '------SSE_APE---FQDNNNN------'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/templates.py", line 219, in render_tmpl
    output = render_str(tmplstr, context, tmplpath)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/templates.py", line 482, in render_jinja_tmpl
    raise SaltRenderError("Jinja variable {}{}".format(exc, out), line, tmplstr)
salt.exceptions.SaltRenderError: Jinja variable 'dict object' has no attribute '------SSE_APE---FQDNNNN------'; line 60

---
[...]

  {% set eapi_server_fqdn_list = [] %}
  {% set eapi_server_ipv4_list = [] %}
  {% for eapi_server in sse_eapi_servers %}
    {% set eapi_server_grains = salt.saltutil.runner('cache.grains', tgt=eapi_server) %}
    {% do eapi_server_fqdn_list.append(eapi_server_grains[eapi_server].fqdn) %}    <======================
    {% for eapi_ipv4 in eapi_server_grains[eapi_server].ipv4 if eapi_ipv4 != '127.0.0.1' %}
    {% do eapi_server_ipv4_list.append(eapi_ipv4) %}
    {% endfor %}
  {% endfor %}
sse_eapi_server_fqdn_list: {{ eapi_server_fqdn_list|tojson }}
[...]
---
2025-07-21 17:44:07,373 [salt.pillar      :957 ][CRITICAL][4727] Rendering SLS 'sse' failed, render error:
Jinja variable 'dict object' has no attribute '------SSE_APE---FQDNNNN------'; line 60

Note: Above logs are just an example, the actual content of the sls that failed to render may vary depending on the code written in the sls. 

Resolution

Follow these steps to troubleshoot and resolve the "Rendering SLS 'sse' failed" error:
 
1. Review the Salt Master Log
  • The most critical step: Examine the Salt master log file, typically located at /var/log/salt/master.
  • Look for specific error messages, including line numbers within the sse.sls file, or indications of missing variables or data.
 
2. Run Salt Master in Debug Mode
  • If the master log doesn't provide sufficient detail, restart the Salt master in debug mode: salt-master -l debug.
  • This will provide more verbose logging output, which may offer more insights into the rendering process and the source of the error.
 
3. Review the sse.sls File
  • Carefully inspect the sse.sls file for any YAML or Jinja syntax errors, paying close attention to indentation, variable declarations, and references to other Salt data structures like Pillar or Grains.
  • Ensure that any variables used within the file are properly defined and accessible to the rendering process.
 
4. Render the SLS File Locally (Optional but Recommended)
  • To isolate the problem, attempt to render the SLS file locally on a minion: salt-call --local slsutil.renderer /srv/salt/sse.sls.
  • This can help identify syntax issues without involving the entire state application process.
 
5. Refresh Grains and Pillars
  • If the issue is related to cached or outdated data, refresh the Grains and Pillars on the affected minion(s): salt <target_host_pattern> saltutil.refresh_grains.
  • This forces the minion to reload its Grains and Pillar data from the master.
 
6. Temporarily Move Aside the Pillar
  • If you suspect an issue with your pillar, you can temporarily move the pillar aside to see if the rendering error goes away.
  • This can help narrow down the source of the problem, particularly if the error is intermittent or difficult to trace.

Additional Information

  • The SaltStack documentation provides comprehensive details on troubleshooting and debugging, including strategies for rendering files in different contexts.
  • If you are unable to pinpoint the problem after following these steps, consider seeking assistance from the SaltStack community forums or support channels, providing detailed logs and code snippets to facilitate troubleshooting.