Open jeffdyke opened 3 years ago
Better error messages for YAML failures has been requested before (can't find it right now) but it's very difficult given the basic code structure.
@jeffdyke Thanks for the report. To clarify, the first example appears to be invalid YAML but your message seems to indicate that you believe it is valid and Salt should be able to parse it. Is that the case or is this in fact invalid YAML and Salt is just not providing a friendly error message when the parsing fails.
Hey now, @garethgreenaway - Its been a while, so am re-reading this, i had forgotten about it. I'm not sure why i claimed it was valid yaml...its not. Parse errors[0] that happen after later normally are very specific, so i was surprised when the top file fails it simply told me it does not exist. I understand the merging that needs to occur, and don't dismiss the complexity.
I think, as @OrangeDog properly moved it to feature, its as simple as
missing key
, with no stack (from my memory). Having that would have be be good enough, i bet you don't hear about this issue much. The presumed complexity of opening up a PR in this part of the code, seemed silly to me.
Thanks for following up.
[0] - these are jinja errors, so not a great comparison.
Edit: I appreciate that this stayed open. 👍
Description From the
Yes its my fault, but.....
department If top.sls contains valid yaml, but not valid top.sls for salt it fails with'No Top file or master_tops data matches found. Please see master log for details.'
There is nothing in the log except for a key error in
events.py
on 899data["user"] = load["user"]
So this made load leaving the the user key unset and it fails hard.
This is the valid yaml that killed it
The valid yaml that fixed it
Note the hyphen before
match
top.sls
f-up I've had in years, but It would be great to have a way to tell if the top file is valid. I was looking atpykwalify
is there a schema fortop.sls
, even that is sufficient.I don't think any of the other debugging assistance stuff is required but i am running on both the master and minion.
Thanks!