1

I get this error message after refactoring my sls files.

I created new sls files and use the include directive to have more modular formulars.

salt:/srv # salt-ssh w123 -v state.sls monitoring
Executing job with jid 20160512154840991359
-------------------------------------------


[ERROR   ] Rendering exception occurred :Jinja variable 'system_home' is undefined
[CRITICAL] Rendering SLS 'base:monitoring.service' failed: Jinja variable 'system_home' is undefined
w123:
    - Rendering SLS 'base:monitoring.service' failed: Jinja variable 'system_home' is undefined

How can I get the SLS filename and line number where the variable is undefined?

mootmoot
  • 294
  • 1
  • 6
guettli
  • 3,113
  • 14
  • 59
  • 110
  • Do you expect us to mind read your state.sls through the internet line? Provider the state file !. – mootmoot May 19 '16 at 09:36
  • @mootmoot do you need the code if you ask "how can I get a traceback on uncaught exceptions in programming language foo"? – guettli May 19 '16 at 10:13
  • Perhaps you should ask yourself, is this really similar? You just write some "secret" state file with jinja code and it spit error. Nobody can help you to point out the problem if you write a wrong jinja syntax without part of the code. – mootmoot May 19 '16 at 11:11
  • My question is "How can I get the filename and line number where the variable is missing?" and not "What's wrong with my Jinia template". I updated the title of the question. – guettli May 19 '16 at 13:33
  • 1
    You may try your luck using -l debug with salt-ssh. Nevertheless, the error already mentioned the SLS file , so converting `base:monitoring.service`, the file that cause the error can be either `salt://monitoring/service.sls` or `salt://monitoring/service/init.sls` . A `grep -nr` on those file to search for `system_home` should show which line contains the error. – mootmoot May 19 '16 at 13:49

1 Answers1

-1

This one of things kills me in regard to SaltStack! Unclear error messages, and it doesn't tell you where is the problem!

Anyway, check that post "Debugging Salt and Salt States", try to debug the error using "salt-call".

  • 1
    Can you explain what is in the link a bit better? It is good for answers to stand on their own. The link you reference could disappear. – chicks May 20 '16 at 23:14