Skip to content

[BUG] salt-minion 3004 upgrade from salt-master produces "The renderer jinja|yaml is unavailable" #61462

Closed as not planned

Description

@cp-samantha

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: 3004

Dependency 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

  1. added
    bug
    on Jan 15, 2022
  2. welcome commented on Jan 15, 2022

    @welcome

    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!

  3. ustolt commented on Mar 3, 2022

    @ustolt

    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
    root@salt37minion02t:/# systemctl status salt-minion
    ● salt-minion.service - The Salt Minion
         Loaded: loaded (/lib/systemd/system/salt-minion.service; enabled; vendor preset: enabled)
         Active: failed (Result: exit-code) since Tue 2022-02-15 11:03:46 CET; 1min 23s ago
           Docs: man:salt-minion(1)
                 file:///usr/share/doc/salt/html/contents.html
                 https://docs.saltproject.io/en/latest/contents.html
        Process: 120555 ExecStart=/usr/bin/salt-minion (code=exited, status=1/FAILURE)
       Main PID: 120555 (code=exited, status=1/FAILURE)
    
    Feb 15 11:03:40 salt37minion02t systemd[1]: salt-minion.service: Found left-over process 1615 (salt-minion) in control group while st>
    Feb 15 11:03:40 salt37minion02t systemd[1]: This usually indicates unclean termination of a previous run, or service implementation d>
    Feb 15 11:03:40 salt37minion02t systemd[1]: salt-minion.service: Found left-over process 100483 (salt-minion) in control group while >
    Feb 15 11:03:40 salt37minion02t systemd[1]: This usually indicates unclean termination of a previous run, or service implementation d>
    Feb 15 11:03:40 salt37minion02t systemd[1]: Starting The Salt Minion...
    Feb 15 11:03:41 salt37minion02t systemd[1]: Started The Salt Minion.
    Feb 15 11:03:45 salt37minion02t salt-minion[1615]: The Salt Minion is shutdown. Minion received a SIGTERM. Exited.
    Feb 15 11:03:46 salt37minion02t salt-minion[120568]: The Salt Minion is shutdown.
    Feb 15 11:03:46 salt37minion02t systemd[1]: salt-minion.service: Main process exited, code=exited, status=1/FAILURE
    Feb 15 11:03:46 salt37minion02t systemd[1]: salt-minion.service: Failed with result 'exit-code'.

    ... results in a unconfigured package state

    root@salt38minion02t:/l# dpkg -l|grep salt
    iU  salt-common                          3004+ds-1                             all          shared libraries that salt requires for all packages
    iU  salt-minion                          3004+ds-1                             all          client package for salt, the distributed remote execution system

    minion logfile:

      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
    2022-02-15 11:01:45,119 [salt.template    :240 ][ERROR   ][112593] The renderer "jinja|yaml" is not available
    2022-02-15 11:01:45,121 [salt.loader      :737 ][CRITICAL][112593] The renderer jinja|yaml is unavailable, this error is often because the needed software is unavailable

    cmd.run:
    Same unconfigured package result after apt install via cmd.run:

    root@saltmaster:/# salt salt37minion02t cmd.run 'apt install salt-minion -o Dpkg::Options::="--force-confold" -y'
    salt33minion02t:
        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 20220216103552911246
    ERROR: Minions returned with non-zero exit code
    root@salt37minion02t:/l# systemctl status salt-minion
    ● salt-minion.service - The Salt Minion
       Loaded: loaded (/lib/systemd/system/salt-minion.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Wed 2022-02-16 11:37:31 CET; 32min ago
         Docs: man:salt-minion(1)
               file:///usr/share/doc/salt/html/contents.html
               https://docs.saltproject.io/en/latest/contents.html
      Process: 8141 ExecStart=/usr/bin/salt-minion (code=exited, status=1/FAILURE)
     Main PID: 8141 (code=exited, status=1/FAILURE)
        Tasks: 0 (limit: 2315)
       CGroup: /system.slice/salt-minion.service
    
    Feb 16 11:37:29 salt37minion02t systemd[1]: salt-minion.service: Found left-over process 8025 (invoke-rc.d) in control group while sta
    Feb 16 11:37:29 salt37minion02t systemd[1]: This usually indicates unclean termination of a previous run, or service implementation de
    Feb 16 11:37:29 salt37minion02t systemd[1]: salt-minion.service: Found left-over process 8103 (systemctl) in control group while start
    Feb 16 11:37:29 salt37minion02t systemd[1]: This usually indicates unclean termination of a previous run, or service implementation de
    Feb 16 11:37:29 salt37minion02t systemd[1]: Starting The Salt Minion...
    Feb 16 11:37:30 salt37minion02t systemd[1]: Started The Salt Minion.

    In all cases, a simple service restart is successful:

    root@salt37minion02t:/# systemctl status salt-minion
    ● salt-minion.service - The Salt Minion
       Loaded: loaded (/lib/systemd/system/salt-minion.service; enabled; vendor preset: enabled)
       Active: active (running) since Tue 2022-02-15 11:13:54 CET; 5s ago
         Docs: man:salt-minion(1)
               file:///usr/share/doc/salt/html/contents.html
               https://docs.saltproject.io/en/latest/contents.html
     Main PID: 9706 (salt-minion)
        Tasks: 7 (limit: 2315)
       CGroup: /system.slice/salt-minion.service
               ├─9706 /usr/bin/python3 /usr/bin/salt-minion
               ├─9715 /usr/bin/python3 /usr/bin/salt-minion
               └─9717 /usr/bin/python3 /usr/bin/salt-minion
    
    Feb 15 11:13:54 salt37minion02t systemd[1]: Starting The Salt Minion...
    Feb 15 11:13:54 salt37minion02t systemd[1]: Started The Salt Minion.
  4. voidmain commented on Jun 9, 2022

    @voidmain

    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.

  5. adampav commented on Jun 30, 2022

    @adampav

    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:

        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 20220630062456951618
    

    In the minion logs there is the:

    2022-06-30 06:25:02,214 [salt.utils.process:900 ][ERROR   ][2706] An un-handled exception from the multiprocessing process 'ProcessPayload' was caught:
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/salt/utils/process.py", line 895, in wrapped_run_func
        # Any child processes, need to carry the current value of the counter(instead of
      File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
        self._target(*self._args, **self._kwargs)
      File "/usr/lib/python3/dist-packages/salt/minion.py", line 1788, in _target
        functions,
      File "/usr/lib/python3/dist-packages/salt/minion.py", line 1782, in run_func
        def _target(cls, minion_instance, opts, data, connected):
      File "/usr/lib/python3/dist-packages/salt/minion.py", line 1858, in _thread_return
        executors
      File "/usr/lib/python3/dist-packages/salt/minion.py", line 476, in gen_modules
        )
      File "/usr/lib/python3/dist-packages/salt/loader.py", line 667, in render
    salt.exceptions.LoaderError: The renderer jinja|yaml is unavailable, this error is often because the needed software is unavailable
    2022-06-30 06:25:05,017 [salt.utils.parsers:1104][WARNING ][2059] Minion received a SIGTERM. Exiting.
    
    
  6. stiobhan commented on Aug 15, 2022

    @stiobhan

    Same issue here. Is there more info needed?

  7. MemoryLeak55 commented on Sep 21, 2022

    @MemoryLeak55

    I'm experiencing the same issue with trying to upgrade from classic to onedir with this method. Same error

  8. added
    Confirmed
    and removed on Oct 11, 2022
  9. cmcmarrow commented on Oct 11, 2022

    @cmcmarrow
    Contributor

    Can confirm on Ubuntu on Salt 3003.2 But Salt 3004 Worked just fine. Will keep looking.

  10. cmcmarrow commented on Oct 11, 2022

    @cmcmarrow
    Contributor

    pkg.upgrade dist_upgrade=true hangs but I dont get a jinja error

  11. Bobo357 commented on Nov 23, 2022

    @Bobo357

    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":

    1. prereq instead of onchanges
    2. 'sleep 30 && salt-call service.restart salt-minion' instead of '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.

  12. cp-samantha commented on Jun 9, 2023

    @cp-samantha
    Author

    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.d file 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)

  13. added this to the Chlorine v3007.0 milestone on Sep 8, 2023
  14. NdK73 commented on Mar 20, 2024

    @NdK73

    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.

  15. xenadmin commented on Jul 7, 2025

    @xenadmin

    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.

  16. added
    severity-medium
    on Oct 16, 2026
  17. dwoz commented on Oct 16, 2026

    @dwoz
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Confirmedbugseverity-mediumstale

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions