Skip to content

[Bug]: state.requisite_in() evaluates same states too many times #68408

Open

Description

@gpernot-celeste

What happened?

Considering the following sls:

foo:
  file.managed:
    - name: /tmp/foo
    - contents: foo
    - require_in:
      - /tmp/bar
      - /tmp/baz
      - /tmp/quux
bar:
  file.managed:
    - name: /tmp/bar
    - contents: bar

baz:
  file.managed:
    - name: /tmp/baz
    - contents: baz

quux:
  file.managed:
    - name: /tmp/quux
    - contents: quux

Running a state.apply (with custom debug message in check_requisite ):

[DEBUG   ] check_requisite({'state': 'file', 'name': '/tmp/bar', '__sls__': 'test.foo', '__env__': 'base', '__id__': 'bar', 'contents': 'bar', 'order': 10001, 'require': [{'file': 'foo'}, {'file': 'foo'}, {'file': 'foo'}], 'fun': 'managed'})

[DEBUG   ] check_requisite({'state': 'file', 'name': '/tmp/baz', '__sls__': 'test.foo', '__env__': 'base', '__id__': 'baz', 'contents': 'baz', 'order': 10002, 'require': [{'file': 'foo'}, {'file': 'foo'}], 'fun': 'managed'})

[DEBUG   ] check_requisite({'state': 'file', 'name': '/tmp/quux', '__sls__': 'test.foo', '__env__': 'base', '__id__': 'quux', 'contents': 'quux', 'order': 10003, 'require': [{'file': 'foo'}], 'fun': 'managed'})

The require list run once then twice then 3 times the same state 'file': 'foo', that is not what we really want.

I believe there is a bug in requisite_in() that should uniquify extend[name][_state][ind][rkey].

Type of salt install

Official deb

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)

debian-12, debian-11

salt --versions-report output

Salt Version:
          Salt: 3006.16
 
Python Version:
        Python: 3.10.18 (main, Sep  5 2025, 22:48:51) [GCC 11.2.0]
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.10.0
  cryptography: 42.0.5
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.6
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 24.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.19.1
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.20.6
         smmap: Not Installed
       timelib: 0.3.0
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: debian 13 trixie
        locale: utf-8
       machine: x86_64
       release: 6.12.48+deb13-cloud-amd64
        system: Linux
       version: Debian GNU/Linux 13 trixie

Activity

  1. added
    bug
    on Oct 17, 2025
  2. changed the title [-][Bug]: state.requisite_in() evaluates same states too many time[/-] [+][Bug]: state.requisite_in() evaluates same states too many times[/+] on Oct 17, 2025
  3. added 2 commits that reference this issue on Oct 17, 2025
    9356b2d
    fa5de69
  4. linked a pull request that will close this issueUniquify requisite_in'd states checks. #68409on Jan 15, 2026
  5. added this to the Sulphur v3006.20 milestone on Jan 15, 2026
  6. added
    bug
    and removed
    bug
    on Jun 26, 2026
  7. added
    severity-medium
    on Oct 21, 2026
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

    bugseverity-medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions