Repository navigation
Description
Description
I have been attempting to upgrade Debian 10/11 machines to salt-minion/salt-common 3004 recently. I would like to be able to perform this upgrade through the salt-master if possible. However, whenever I kick-off an upgrade of the salt-minion through salt itself, I receive the error: salt.exceptions.LoaderError: The renderer jinja|yaml is unavailable, this error is often because the needed software is unavailable
I'm facing a similar problem to #49834 ; however, these machines are all using systemd.
Setup
salt-master is an LXC container running debian 10 (buster), provisioned directly from the proxmox debian 10 template
salt-minion is also and LXC container running debian 10, provisioned in the same way.
I have taken the advice of the FAQ in developing a state that waits until the upgrade is complete and restarts the salt-minion service at a time when it will be less disruptive, rather than letting apt handle the restart of the service:
{%- if grains['os_family'] == 'Debian' %}
Disable starting services:
file.managed:
- name: /usr/sbin/policy-rc.d
- user: root
- group: root
- mode: 0755
- contents:
- '#!/bin/sh'
- exit 101
# do not touch if already exists
- replace: False
- prereq:
- pkg: Upgrade Salt Minion
{%- endif %}
Upgrade Salt Minion:
pkg.latest:
- name: salt-minion
- refresh: True
Enable Salt Minion:
service.enabled:
- name: salt-minion
- require:
- pkg: Upgrade Salt Minion
{%- if grains['os_family'] == 'Debian' %}
Enable starting services:
file.absent:
- name: /usr/sbin/policy-rc.d
- onchanges:
- pkg: Upgrade Salt Minion
{%- endif %}
{%- if grains['os'] != 'Windows' %}
Restart Salt Minion:
cmd.run:
- name: 'salt-call service.restart salt-minion'
- bg: True
- onchanges:
- pkg: Upgrade Salt Minion
{%- endif %}
I then call this state from the salt-master, while specifying the node to update. I have edited the apt source.list by hand to reference Buster 10 with 3004. The machine is currently running 3003, but I have reproduced the bug by upgrading from 3002 as well:
salt node-1 state.apply maintenance.update-salt
Steps to Reproduce the behavior
- Install salt 3002 or 3003 on debian buster
- Update source list to prepare for the upgrade to 3004
- Use the above state file to upgrade the target node from salt-master
- Fail
The minion function caused an exception: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/minion.py", line 1905, in _thread_return
for executor in executors
File "/usr/lib/python3/dist-packages/salt/minion.py", line 1861, in _execute_job_function
executors[-1] = "sudo" # replace the last one with sudo
File "/usr/lib/python3/dist-packages/salt/loader.py", line 1241, in __call__
File "/usr/lib/python3/dist-packages/salt/loader.py", line 2274, in run
File "/usr/lib/python3/dist-packages/salt/loader.py", line 2289, in _run_as
File "/usr/lib/python3/dist-packages/salt/executors/direct_call.py", line 12, in execute
File "/usr/lib/python3/dist-packages/salt/loader.py", line 1241, in __call__
File "/usr/lib/python3/dist-packages/salt/loader.py", line 2274, in run
File "/usr/lib/python3/dist-packages/salt/loader.py", line 2289, in _run_as
File "/usr/lib/python3/dist-packages/salt/modules/state.py", line 792, in apply_
if mods:
File "/usr/lib/python3/dist-packages/salt/modules/state.py", line 1391, in sls
snapper_pre = _snapper_pre(opts, kwargs.get("__pub_jid", "called localy"))
File "/usr/lib/python3/dist-packages/salt/state.py", line 3269, in call_high
# Verify that the high data is structurally sound
File "/usr/lib/python3/dist-packages/salt/state.py", line 2495, in call_chunks
if action == "kill":
File "/usr/lib/python3/dist-packages/salt/state.py", line 2999, in call_chunk
elif status == "met":
File "/usr/lib/python3/dist-packages/salt/utils/decorators/state.py", line 45, in _func
result = func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/state.py", line 2229, in call
if low.get("__prereq__"):
File "/usr/lib/python3/dist-packages/salt/state.py", line 1256, in check_refresh
return
File "/usr/lib/python3/dist-packages/salt/state.py", line 1213, in module_refresh
Refresh all the modules
File "/usr/lib/python3/dist-packages/salt/state.py", line 1191, in load_modules
providers = {}
File "/usr/lib/python3/dist-packages/salt/loader.py", line 738, in render
salt.exceptions.LoaderError: The renderer jinja|yaml is unavailable, this error is often because the needed software is unavailable
The minion is not restarted. After this error, the master is unable to communicate with under any circumstance until the minion is manually restarted with systemctl restart salt-minion directly on the node.
Expected behavior
I expect that the salt-minion upgrade doesn't fail and receives the restart signal cleanly
Screenshots
n/a
Versions Report
salt --versions-report
Master -- minion is running 3003, attempting to upgrade to 3004 ``` Salt Version: Salt: 3004Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.8.1
docker-py: Not Installed
gitdb: 4.0.5
gitpython: 3.1.14
Jinja2: 2.11.3
libgit2: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.0
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: Not Installed
pycryptodome: 3.9.7
pygit2: Not Installed
Python: 3.9.2 (default, Feb 28 2021, 17:03:44)
python-gnupg: 0.4.6
PyYAML: 5.3.1
PyZMQ: 20.0.0
smmap: 4.0.0
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist: debian 11 bullseye
locale: utf-8
machine: x86_64
release: 5.13.19-2-pve
system: Linux
version: Debian GNU/Linux 11 bullseye
</details>
**Additional context**
- No errors at all when upgrading directly on the minion. Salt upgrades fine and can communicate with no issues directly to the master once finished. However, this is less than ideal if you plan to upgrade many minions to 3004 and would like to do it centrally.
- Upgrading from 3002 -> 3003 does not produce this error (even when the master is running 3004). This bug appears to be specific to the 3004 upgrade in my case. 3002 -> 3004 produces the error.
- I can reproduce the error using Bullseye going from deb repo (3002.6) -> salt repo (3004), so it does not appear to be specific to Buster
- I'm dubious that LXC is affecting this error, since 3002 -> 3003 shows that success is possible
Activity
welcome commentedon Jan 15, 2022
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!
ustolt commentedon Mar 3, 2022
We have the same problem when updating the salt-minion (V3003.2) on Ubuntu 18.04 and 20.04.
The update was tried in different ways.
pkg.upgrade:
root@saltmaster:/etc/salt# salt salt37minion02t pkg.upgrade dist_upgrade=true salt37minion02t: Minion did not return. [No response] The minions may not have all finished running and any remaining minions will return upon completion. To look up the return data for this job later, run the following command: salt-run jobs.lookup_jid 20220215100052552066... results in a unconfigured package state
minion logfile:
cmd.run:
Same unconfigured package result after apt install via cmd.run:
In all cases, a simple service restart is successful:
voidmain commentedon Jun 9, 2022
I have this same issue and it would be nice to find a solution that doesn't require restarting the
salt-minion. Our servers are managed programmatically and executing SSH into servers isn't possible because SSH access is restricted in order for us to maintain our security policies.adampav commentedon Jun 30, 2022
Same issue here.
I have debian11 cloud images, which are configured via cloud-init to install salt and reach out to master.
The salt-minion is installed based on the default debian repositories (salt-minion 3002.6 at the time of this writing).
Subsequently i execute a state that adds the salt repo and installs salt 3004.2. Master returns:
In the minion logs there is the:
stiobhan commentedon Aug 15, 2022
Same issue here. Is there more info needed?
MemoryLeak55 commentedon Sep 21, 2022
I'm experiencing the same issue with trying to upgrade from classic to onedir with this method. Same error
cmcmarrow commentedon Oct 11, 2022
Can confirm on Ubuntu on Salt 3003.2 But Salt 3004 Worked just fine. Will keep looking.
cmcmarrow commentedon Oct 11, 2022
pkg.upgrade dist_upgrade=true hangs but I dont get a jinja error
Bobo357 commentedon Nov 23, 2022
I created a workaround and I was able to upgrade most of our 200 minions from 3004 to 3005.1. About 10 of them needed manual restart for some reason but I did not examine why it failed in those few.
I changed the state that runs "salt-call service.restart salt-minion":
Now it still gets error from upgrade but because minion restart is scheduled before upgrade minion reconnects successfully after upgrade. Tune "sleep" parameter according to your environment speed, 30 should be more than enough for most adequate servers.
cp-samantha commentedon Jun 9, 2023
Just echoing recent comments that this issue seems to exist intermittently between versions. The conversion from py3 to onedir may have played a role in the most recent updates (I didn't really wish to spend the time investigating this time around).
The workaround from Bobo357 worked quite nicely -- the only thing I would add is that if you're using the Debian policy to prevent apt from restarting packages, that you just remember to go through and remove the
/usr/sbin/policy-rc.dfile after doing this (i.e.salt '*' cmd.run 'rm /usr/sbin/policy-rc.d)-- the state ultimately fails during the apt step, so the remaining clean-up won't run either (in addition to the noted restart issues)NdK73 commentedon Mar 20, 2024
I can confirm that client hanging is still an issue also with onedir packages (happened while upgrading 3006.6 to 3007.0).
I read that recent releases "isolated" the running minion via a dedicated slice to address this issue, but either I didn't understandcorrectly or it requires extra config steps.
xenadmin commentedon Jul 7, 2025
I'm currently trying to update our minions from 3006.9 to 3006.13 and they still all die during an upgrade and I have to restart them manually. This is super time consuming.
dwoz commentedon Oct 16, 2026
Thanks for the original report. This issue has been open for more than three years without recent activity and carries a severity label below
severity-high. As part of a backlog cleanup, we're closing older low- and medium-severity issues so triage can focus on reports against currently supported releases.Closing isn't a judgement that the problem wasn't real — only that the codebase has moved through several releases since this was filed, and much of the surrounding code has changed.
If you — or anyone else — can still reproduce this on the 3008.x LTS release, please leave a comment with a reproduction and a maintainer will reopen. The original reporter can also reopen directly.