Skip to content

[Bug]: minion-driven RPM upgrade: %pre systemctl stop deadlocks, then SIGKILLs the job driving the upgrade - orchestrated minion upgrades cannot work #69656

Closed

Description

@TeddyAndrieux

What happened?

Upgrading salt-minion through Salt, using exactly the pattern documented in the FAQ entry "What is the best way to restart a Salt Minion daemon using Salt after upgrade?", gets the state run that drives the upgrade SIGKILLed. The job's return is lost forever (this is not a client timeout: the job process itself is killed), so any orchestration that upgrades minions through Salt necessarily reports a failure and loses control of the run. There is currently no way to drive a minion RPM upgrade from a state run or an orchestrate and get a result back.

Setup

Two Rocky 9 nodes: one salt-master 3006.26, one salt-minion 3006.26 (official onedir RPMs).

[root@ip-10-160-101-251 rocky]# rpm -q salt salt-minion salt-master
salt-3006.26-0.x86_64
salt-minion-3006.26-0.x86_64
package salt-master is not installed

[root@ip-10-160-101-251 rocky]# systemctl show salt-minion -p KillMode -p Type -p MainPID -p TimeoutStopUSec
Type=notify
TimeoutStopUSec=1min 30s
MainPID=22049
KillMode=mixed

[root@ip-10-160-101-251 rocky]# systemd-cgls -u salt-minion.service
Unit salt-minion.service (/system.slice/salt-minion.service):
├─22049 /opt/saltstack/salt/bin/python3.10 /usr/bin/salt-minion
└─22057 /opt/saltstack/salt/bin/python3.10 /usr/bin/salt-minion MultiMinionProcessManager MinionProcessManager

upgrade.sls, verbatim from the FAQ:

Upgrade Salt Minion:
  pkg.installed:
    - name: salt-minion
    - version: 3006.27

Restart Salt Minion:
  cmd.run:
    - name: 'salt-call --local service.restart salt-minion'
    - bg: True
    - onchanges:
       - pkg: Upgrade Salt Minion
# salt 'ip-10-160-101-251.eu-north-1.compute.internal' state.sls upgrade
ip-10-160-101-251.eu-north-1.compute.internal:
    Minion did not return. [No response]
ERROR: Minions returned with non-zero exit code

Raising the client timeout does not change the outcome: the job is killed (see below), so the return can never arrive.

What actually happens

  1. The job (PID 22129, forked from the minion child 22057) runs pkg.installed; yumpkg wraps dnf in systemd-run --scope, so dnf itself runs outside the salt-minion.service cgroup.
  2. The %pre scriptlet of the incoming RPM runs a blocking systemctl stop salt-minion.service (13:19:36 below).
  3. Deadlock: systemctl stop waits for the unit's processes to exit (with KillMode=mixed that includes the job, not just the main process); the minion child waits for its running job; the job waits for dnf; dnf waits for %pre (the systemctl stop itself). systemctl status during that window:
     Active: deactivating (stop-sigterm) since Thu 2026-07-02 13:19:36 UTC; 1min 21s ago
   Main PID: 22049 (python3.10)
     CGroup: /system.slice/salt-minion.service
             ├─22049 /opt/saltstack/salt/bin/python3.10 /usr/bin/salt-minion
             ├─22057 ".../salt-minion MultiMinionProcessManager MinionProcessManager"
             └─22129 ".../salt-minion ... ProcessPayload(jid=20260702131927992215) Minion._thread_return"
  1. After TimeoutStopSec (90s), systemd SIGKILLs the whole cgroup - including PID 22129, the job driving the upgrade:
Jul 02 13:19:36 ... systemd[1]: Stopping The Salt Minion...
Jul 02 13:19:41 ... salt-minion[22057]: [WARNING ] Minion received a SIGTERM. Exiting.
Jul 02 13:19:41 ... salt-minion[22057]: The Salt Minion is shutdown. Minion received a SIGTERM. Exited.
Jul 02 13:21:06 ... systemd[1]: salt-minion.service: State 'stop-sigterm' timed out. Killing.
Jul 02 13:21:06 ... systemd[1]: salt-minion.service: Killing process 22049 (python3.10) with signal SIGKILL.
Jul 02 13:21:06 ... systemd[1]: salt-minion.service: Killing process 22057 (/opt/saltstack/) with signal SIGKILL.
Jul 02 13:21:06 ... systemd[1]: salt-minion.service: Killing process 22129 (/opt/saltstack/) with signal SIGKILL.
Jul 02 13:21:06 ... systemd[1]: salt-minion.service: Killing process 22131 (ZMQbg/Reaper) with signal SIGKILL.
Jul 02 13:21:06 ... systemd[1]: salt-minion.service: Killing process 22132 (ZMQbg/IO/0) with signal SIGKILL.
Jul 02 13:21:06 ... systemd[1]: salt-minion.service: Main process exited, code=killed, status=9/KILL
Jul 02 13:21:06 ... systemd[1]: salt-minion.service: Failed with result 'timeout'.
Jul 02 13:21:06 ... systemd[1]: Stopped The Salt Minion.
Jul 02 13:21:18 ... systemd[1]: Starting The Salt Minion...
Jul 02 13:21:18 ... systemd[1]: Started The Salt Minion.
  1. dnf, orphaned in its transient scope, resumes and completes the transaction; the new 3006.27 %posttrans then starts the new minion (13:21:18, i.e. after ~100s of minion downtime):
[root@ip-10-160-101-251 rocky]# ps -ef | grep -i salt
root       22244       1  3 13:21 ?        00:00:00 /opt/saltstack/salt/bin/python3.11 /usr/bin/salt-minion
root       22263   22244  5 13:21 ?        00:00:00 /opt/saltstack/salt/bin/python3.11 /usr/bin/salt-minion MultiMinionProcessManager MinionProcessManager

Damage

  • Orchestrated minion upgrades cannot work at all: the state run is SIGKILLed mid-flight, its return never reaches the master, and the Restart Salt Minion state from the FAQ pattern never executes. Any orchestrate / batch / automation driving the upgrade sees Minion did not return and has lost control of the node, whatever its timeout settings.
  • The minion is down for the whole ~100s window. When the target is 3006.26 or earlier the minion stays down afterwards (%posttrans only ran try-restart, a no-op after the %pre stop - that was [Bug]: upgrading to 3006.26 stops a running minion, with no recovery #69605); with 3006.27 the new %posttrans start brings it back as a side effect.
  • The dnf transaction history is left unfinalized:
[root@ip-10-160-101-251 rocky]# dnf history info last
Transaction ID : 20
Begin time     : Thu 02 Jul 2026 01:19:33 PM UTC
End time       : Thu 01 Jan 1970 12:00:00 AM UTC (-1782998373 seconds)
End rpmdb      :  **
Return-Code    : Failure: 1
Command Line   : -y --best --allowerasing install salt-minion-3006.27
Packages Altered:
 ** Upgrade  salt-minion-3006.27-0.x86_64 @salt-repo-3006-lts
 ** Upgraded salt-minion-3006.26-0.x86_64 @@System
 ** Upgrade  salt-3006.27-0.x86_64        @salt-repo-3006-lts
 ** Upgraded salt-3006.26-0.x86_64        @@System

Where this comes from

  • The blocking systemctl stop in %pre minion is not new in 3006.27: it has been in the spec since at least 3006.10 (it prevents the ownership-restoration chowns from racing a live minion). Any minion-driven RPM upgrade since then is affected; we reproduced the same failure upgrading 3006.25 -> 3006.26.
  • 3006.27 (fix for [Bug]: upgrading to 3006.26 stops a running minion, with no recovery #69605) added a marker in %pre and an unconditional systemctl start in %posttrans, which is why the minion comes back up when upgrading to 3006.27, while it stayed down with earlier targets. It does not change the deadlock or the SIGKILL of the job.

Documentation note

The FAQ entry rewritten in 3006.27 (#69545) states that the shipped unit sets KillMode=process and that the scriptlets only run try-restart, so "the in-flight state run survives" and "no special FAQ workaround is needed for an upgrade triggered by pkg.installed". Neither matches the actual packaging: the RPM ships KillMode=mixed (see systemctl show above) and %pre does a hard blocking stop with a start in %posttrans.

Related: #69605

Type of salt install

Official rpm

Major version

3006.x

What supported OS are you seeing the problem on? Can select multiple. (If bug appears on an unsupported OS, please open a GitHub Discussion instead)

rockylinux-9

salt --versions-report output

Salt Version:
          Salt: 3006.26
 
Python Version:
        Python: 3.10.20 (main, Jun 11 2026, 02:19:33) [GCC 11.2.0]
 
Dependency Versions:
          cffi: 2.0.0
      cherrypy: 18.10.0
  cryptography: 47.0.0
      dateutil: 2.9.0.post0
     docker-py: Not Installed
         gitdb: 4.0.12
     gitpython: Not Installed
        Jinja2: 3.1.6
       libgit2: Not Installed
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.1.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 24.0
     pycparser: 3.00
      pycrypto: Not Installed
  pycryptodome: 3.23.0
        pygit2: Not Installed
  python-gnupg: 0.5.6
        PyYAML: 6.0.3
         PyZMQ: 27.1.0
        relenv: 0.22.14
         smmap: 5.0.2
       timelib: 0.3.0
       Tornado: 6.5.5
           ZMQ: 4.3.5
 
System Versions:
          dist: rocky 9.8 Blue Onyx
        locale: utf-8
       machine: x86_64
       release: 5.14.0-687.15.1.el9_8.x86_64
        system: Linux
       version: Rocky Linux 9.8 Blue Onyx

Activity

  1. added
    bug
    on Jul 2, 2026
  2. added this to the Sulphur v3006.28 milestone on Jul 2, 2026
  3. added 2 commits that reference this issue on Jul 3, 2026
    77df594
    0ef4421
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions