-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] [3006.0] Regression: Include sls that includes jinja macros leads to Rendering SLS error #64111
Comments
Affecting us too, following code:
|
I think this change in the salt/utils/templates.py is causing it: If I manually replace the file with the version from before (https://github.com/saltstack/salt/blob/4ecfd3d3d549e655027a36746f9cf3bc9e11c6e9/salt/utils/templates.py), it seems to work. |
I am able to consistently reproduce this using the states in @babs's issue and |
I'm running into this too but with Surprisingly it seems to be specific to client side, I have a multi-master setup and the other minions are on 3003.2, everything is just fine there and all minions are running 3003.2 as well. One master and one minion are on 3006.0 (latest of the repo fetched April 19th 2023). master - 3006 aka mas6 Here's a test run of a formula/recipe/etc from min3 to mas6 (success):
Here's a run of min6 to mas6 (fails):
Anyway - this is not an issue unless you think it is. This is what happens when a 3005/3006 minion tries to talk to any 3003.2 master (not following the best practice of upgrading the master first so I think this is expected, but meh):
|
Even the official salt-formula breaks completely with 3006.0 with this error. Although mistakes can happen, it is surprising that an issue as showstoppingly grave as this one manages to go undetected in a LTS release. It is almost like this release has never been tested on an actual production-like system before release. Also, the upgrade was a mess as the salt-master now runs as a normal user that has no access to lots of stuff like ssh keys with correct permissions for root etc,. This is good for security and I applaud it, however this should be clearly noted in the release notes so we have some pointers to why everything breaks. Hopefully a quick fix release can happen for this specific issue so 3006 is at least usable with actual formulas. |
@hkbakke Even though it is off-topic, I couldn't agree more with the As for not being tested, it's really surprising indeed. It could have to do with the commit that causes this bug being only two weeks old, but it should have been caught. I'm all for updating software as quickly as feasible within an organisation, but it doesn't seem like salt has had a good |
I would ask the devs to please pull the 3006 release. The multitude of breaking issues, lack of clear communication on the change to running as the salt user, and the fact that reverting to a previous version will still break installations (systemd file still wants to run as salt user, this tripped me up for a bit). No mention of the salt user change here: https://docs.saltproject.io/en/latest/topics/releases/3006.html or https://saltproject.io/salt-3006-is-here/ If anything this should have be an option and not the default for the 3006 release. |
Test importing jinja files
I agree and feel that 3006.0 should just be pulled. Just the includes in and of itself is the main reason. Luckily because salt can't self-manage itself that well and I didn't put too much effort into it, the salt user change wasn't a big hit and was well done. But now I have to go back to 3005.1 in the meantime because of the include and have to play clean-up with the salt user change - luckily on only one host as I have four. Most may not have that option because, lets face it, for the most part salt just works :-D |
We've also encountered the Another issue with 3006.0 is where a dict is passed in the context to a jinja templated file (in the example below z_meta is passed in the context): {%- set zsys = pillar.get('zsys', {}) -%} This raises the exception: If the dict is read by putting |
Test importing jinja files
This bit me just now with the salt-users formula, as per other reports downgrading to 3005.1 restored normal behaviour. |
Same problem here after a fresh 3006 install. The error happens in the first line of a state file importing a template. With or without context gives the same error.
|
This issue has been fixed and will be available in the upcoming 3006.1 release. |
I ran the example said example on |
Description
Include of
sls
that includes jinja macros leads toRendering SLS 'base:common.file1' failed: Jinja error: 'NoneType' object has no attribute 'done'
Regression introduced in 3006.0, working fine on 3005.1 and previous.
state.apply common
gives the following error whilestate.apply common.file1
works fine.Setup
One master and one minion running 3006.
Steps to Reproduce the behavior
On the master side in a
common
folder:macros.jinja
init.sls
file1.sls
Expected behavior
On the minion side as from the master side, being able to call
state.apply common
without issue (as it was on 3005.1 and previous)Versions Report
salt --versions-report
The text was updated successfully, but these errors were encountered: