Skip to content

minion upgrade occasionally fails with The renderer "yaml_jinja" is not available #49834

Closed

Description

@grinapo

Description of Issue/Question

Upgrading salt-minion from 2016.11.2 to 2018.3.2 have always been failing a bit randomly (~50%), with high probability the minion entering a running but non-responding state, logging

2018-09-28 18:17:23,128 [salt.utils.parsers                                   ][WARNING ][165127] Minion received a SIGTERM. Exiting.
2018-09-28 18:17:31,900 [salt.template                                                  ][ERROR   ][172291] The renderer "yaml_jinja" is not available
2018-09-28 18:17:31,900 [salt.loader                                                    ][CRITICAL][172291] The renderer yaml_jinja is unavailable, this error is often because the needed software is unavailable
2018-09-28 18:17:31,900 [salt.minion                                                    ][WARNING ][172291] The minion function caused an exception

Simply restarting the minion resolves the problem (and magically making yaml_jinja present again). (But the restart takes a visibly longer time, like 30 seconds.) I have tried to install python3 jinja and yaml before upgrading minion (it's just hand-waving since the package does that anyway) but didn't help.

(Tried to search issues, found nothing relevant.)

Setup

Debian jessie and stretch mixed; master is either 2016.11 or 2018.3, both fails the same. (2018 is from the official salt repo, 2016 is from Debian repo.)

Multimaster, but I don't think it's relevant.
(As a sidenote upgrade "always" fail when ipv6:True and the masters only have ipv4 addresses. It's been working before but I'm not sure whether it's a bug or a feature.)

Minion config:

/etc/salt/minion.d/proxy.conf:proxy_host: proxy.x.y
/etc/salt/minion.d/proxy.conf:proxy_port: 3128
/etc/salt/minion.d/_schedule.conf:schedule:
/etc/salt/minion.d/_schedule.conf:  __mine_interval: {enabled: true, function: mine.update, jid_include: true, maxrunning: 2,
/etc/salt/minion.d/_schedule.conf:    minutes: 60, return_job: false}
/etc/salt/minion.d/l.conf:master: 
/etc/salt/minion.d/l.conf:  - salt2.x.y
/etc/salt/minion.d/l.conf:  - salt1.x.y
/etc/salt/minion.d/l.conf:master_tries: -1
/etc/salt/minion.d/l.conf:#damnyou# ipv6:true 
/etc/salt/minion.d/l.conf:grains:
/etc/salt/minion.d/l.conf:  roles:
/etc/salt/minion.d/l.conf:    - default_config
/etc/salt/minion.d/l.conf:    - ct
/etc/salt/minion.d/l.conf:    - no_default_users
/etc/salt/minion.d/l.conf:  cluster: hackworth

Steps to Reproduce Issue

{% if pillar['salt-official-latest'] is defined %}
update-salt-official-latest:
  pkg.latest:
    - pkgs:
      - salt-minion
      - salt-common
    - cache_valid_time: 600
    - install_recommends: True
    - only_upgrade: True
    - require:
      - pkg: salt-required-other-pkgs

restart-when-updated-official:
  service.running:
    - name: salt-minion
    - watch: 
      - pkg: update-salt-official-latest
{% endif %}   

# salt require these
salt-required-other-pkgs:
  pkg.latest:
    - pkgs:
{% if pillar['salt-official-latest'] is defined %}
      - python3-jinja2
      - python3-yaml
      - python3-apt
{% else %}
      - python-apt
{% endif %}      

Versions Report

Source:

Salt Version:
           Salt: 2016.11.2
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.5.3
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.3
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.0
   msgpack-pure: Not Installed
 msgpack-python: 0.4.2
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.9 (default, Jun 29 2016, 13:08:31)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.4.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.4.1
            ZMQ: 4.0.5
 
System Versions:
           dist: debian 8.9 
        machine: x86_64
        release: 4.4.35-1-pve
         system: Linux
        version: debian 8.9 

Target:

Salt Version:
           Salt: 2018.3.2
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.5.3
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.9.4
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.5.3 (default, Jan 19 2017, 14:11:04)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.4.3
            ZMQ: 4.2.1
 
System Versions:
           dist: debian 9.3 
         locale: UTF-8
        machine: x86_64
        release: 4.4.35-1-pve
         system: Linux
        version: debian 9.3 

Activity

  1. gtmanfred commented on Oct 1, 2018

    @gtmanfred
    Contributor

    I am unable to replicate this.

    If you run into this issue again, can you check the process list and make sure there aren't any extra salt minions running?

    My suspicion is that the old minion wasn't entirely killed off before the 2018.3 minion was started.

  2. added
    needs-more-info
    on Oct 1, 2018
  3. added this to the Blocked milestone on Oct 1, 2018
  4. grinapo commented on Oct 1, 2018

    @grinapo
    Author

    I am pretty sure there was, or at least it has a high probability. Most of the time I had to 'pkill' salt-minions, regardless of who their parent was. Your suggestion also consistent with the magical appearance of the missing lib.

    Then my problem could be rephrased as "how to stop minion from multiplying when upgrading"?
    (I guess most of them runs under SysV init, and some possibly under systemd [where I was careless not to get rid of it for good].) I remember there were lots of magic going on about making the minion upgrade to work but I seem to be at loss about the Ultimate Solution™.

  5. gtmanfred commented on Oct 1, 2018

    @gtmanfred
    Contributor

    Well, you are on debian 9, so you would be using systemd.

    We have moved over to using KillMode=process in more recent versions of salt, and the old version may not have handled all of the signal handling correctly.

    If you run into this again in future upgrades let us know, but it shouldn't happen again

    Thanks,
    Daniel

  6. grinapo commented on Oct 1, 2018

    @grinapo
    Author

    I apologise for disagreeing but no, I would not be using systemd as long as I am able not to. Debian would use systemd by default, but it doesn't forbid you to use SysV (or, in fact, anything else). It is prefectly valid to eredicate systemd (only libsystemd0 is present, as well as sysv-rc, sysvinit-core and sysvinit-utils, along with their dependencies; systemd is purged).

    I don't remember whether salt-minion would hard-depend on systemd, but if it was it would be a very inconvenient bug (of the wishlist kind I guess). Do I have to use the old double-fork trick then, along with carefully killing the old instances?

  7. gtmanfred commented on Oct 1, 2018

    @gtmanfred
    Contributor

    That is probably the problem then.

    Our debian packages are packaged expecting to have systemd on debian, so the restarts probably didn't take place when the package was updated, so you were running salt 2016.11, with 2018.3 code on the filesystem.

    @dmurphy18 can you take a look at this?

    Thanks,
    Daniel

  8. added
    Packaging
    and removed
    needs-more-info
    on Oct 1, 2018
  9. modified the milestones: Blocked, Approved on Oct 1, 2018
  10. dmurphy18 commented on Apr 8, 2019

    @dmurphy18
    Contributor

    @grinapo Apologies for the delay in getting to this issue, mining my GitHub issues when I saw this old one.
    Is this still an issue for you, given that all of the major Linux OS distribution have migrated to using systemd. Noting that the original Debian 8.9 -> 9.3 upgrade could have the complication of SysV init migrate to systemd, with Debian 8 having been recently moved to archive and presumably about to become old_old_stable soon.

  11. self-assigned this
    on Apr 8, 2019
  12. grinapo commented on Apr 9, 2019

    @grinapo
    Author

    @dmurphy18 I don't quite understand the specific point of your reply.

    Debian fresh installs uses systemd by default, but it absolutely does not mean that people have to infect their sytems with that PITA, in fact installing upstart, sysvinit or possibly anything else is as simple as... installing them (they are part of Debian official), and purging all systemd-related packages for new installs; for old upgrades it's not even there, fortunately.

    If saltstack want to decide not to support SysV init then it should be probably well documented and published, and I strongly hope this isn't the case, since it would require people to fabricate startup scripts for salt every time, and lot of states and modules had to be forked. Awful lot of people are free from systemd, and not without reasons, dropping them in silence isn't proper I would say.

  13. dmurphy18 commented on Apr 9, 2019

    @dmurphy18
    Contributor

    @grinapo I was asking if this is still an issue for you given that Debian 8 is about done, and the previous comments are about 6 months old, and there is no escaping systemd (without difficulty) in Debian 9.

    Understand from your comment that you are not a fan of systemd.

    Was not stating that 'SaltStack had decided not to support SysV init', in any fashion, since it is needed for other OS's, for example: Solaris and AIX.

  14. 22 remaining items

  15. removed this from the Blocked milestone on May 18, 2021
  16. grinapo commented on May 18, 2021

    @grinapo
    Author

    @sagetherage: Same often (but not always?) happen in the recent versions.

    (A little bit off the track is to mention that minion is really bad in starting recently, especially around upgrades, but not exclusively. Even debug level log does not offer a hint: it hangs pretty early somewhere before actually firing up the queueing lib and its networking. I have to try to trace it... when it happens, just trace is rather verbose so cannot be set on normal minions.)

  17. changed the title [-]minion upgrade from 2016.x to 2018.x fails with The renderer "yaml_jinja" is not available[/-] [+]minion upgrade occasionally fails with The renderer "yaml_jinja" is not available[/+] on May 18, 2021
  18. self-assigned this
    on May 18, 2021
  19. dmurphy18 commented on May 18, 2021

    @dmurphy18
    Contributor

    @grinapo Back working on this issue for you. @Sage was referring to 2016 and 2018 are EOL and no longer under support. I am trying to duplicate this on Debian 10 (current up to date), with upgrading from Salt 3002 to 3003.

    Wondering if you are using Debian 9 or 10, and still have systemd disabled and using sysvinit-core, sysv-rc and init. Trying to duplicate exact conditions that you are experiencing, and if you can detail again the exact method used to disable systemd, it would be much appreciated.

    Note: have been unable to duplicate using SysV init and CLI apt upgrade salt-minion with the sources updated to point to latest version when running Salt 3002.

    Also another point I just noticed, whose Salt is installed, by accident I have Debian 10's version of Salt 2018.3.4 when it should have been Salt 3002 from the Salt Project (new name due to VMware purchasing SaltStack but same stuff).

    After upgrading from the Debian Salt 2018.3.4 to Salt 3002.6, via editing source.list and CLI apt update and apt upgrade salt-minion, that the salt-minion failed to restart, and lost the connection to the salt-master (probably due to pki keys suddenly being different). Deleting the keys on the master and restarting the minion /etc/init.d/salt-minion restart and re-accepting the keys worked fine.

    Subsequent upgrade from Salt Project's Salt 3002.6 to 3003 encountered no problems.

    root@tdeb10:/home/david# apt-cache policy salt-minion
    salt-minion:
      Installed: 3003+ds-1
      Candidate: 3003+ds-1
      Version table:
     *** 3003+ds-1 500
            500 https://repo.saltproject.io/py3/debian/10/amd64/3003 buster/main amd64 Packages
            100 /var/lib/dpkg/status
         2018.3.4+dfsg1-6+deb10u2 500
            500 http://deb.debian.org/debian buster/main amd64 Packages
            500 http://security.debian.org/debian-security buster/updates/main amd64 Packages
    root@tdeb10:/home/david# 
    

    Not saying Debian Salt version is the issue here, but thought I'd mention it in passing since it caught me out, and in Debian 9, the Debian Salt version used to be in /usr/local/bin, rather than Debian 10 where it is in /usr/bin, same as Salt Project Salt (been away working on Salt native minions)

  20. dmurphy18 commented on May 19, 2021

    @dmurphy18
    Contributor

    BTW: Will be trying this on Devuan 3.1 tomorrow

  21. dmurphy18 commented on May 19, 2021

    @dmurphy18
    Contributor

    Devuan 3.1 Beowulf had no issue with the upgrade and it uses /etc/init.d/salt-minion exclusively with no trace of systemd. So no issue seen with Debian 10 or Devuan 3.1 using SysV init.

    Will need exact details of your environment in order to try reproducing the issue you are experiencing.

  22. added
    cannot-reproduce
    needs-more-info
    and removed
    Confirmed
    on May 19, 2021
  23. added this to the Blocked milestone on May 19, 2021
  24. sagetherage commented on Jul 19, 2021

    @sagetherage
    Contributor

    @grinapo we are unable to replicate this issue, if you are seeing it on newer versions or upgrading please open a new issue and complete the issue template, thank you!

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

Metadata

Metadata

Labels

bugcannot-reproduceneeds-more-info

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions