saltstack / saltstack/salt

[BUG] Highstate still runs explicitly disabled state files?

Open
#58,314 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Confirmed Core severity-medium State-Compiler
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description

I am trying to disable a specific state file from ever being ran with salt minion state.disable dont_run, but when I run a highstate against the same minion, the state file still runs without hesitation. It only doesn't run if I, again, call it out with salt minion state.apply dont_run, I'll get:

minion:
    Data failed to compile:
----------
    The state file "dont_run" is currently disabled, to re-enable, run state.enable dont_run.

This doesn't really make sense to me, and I can't imagine a scenario where this would be needed. If I explicitly mark a state file to be ignored it shouldn't be suddenly ok to run during a highstate.

Expected behavior

I would expect that during the highstate, the file I called out to be disabled would show up in the output as a successfully ignored state file, OR, the state file is omitted entirely in the output.

It should also not ever show up as an error, since there is no error. "Data failed to compile" is not something I would want to read when it is working as designed.

Versions Report

salt --versions-report

master

Salt Version:
           Salt: 3000.3

Dependency Versions:
           cffi: 1.14.0
       cherrypy: 5.6.0
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
         Jinja2: 2.11.1
        libgit2: 0.28.1
       M2Crypto: 0.35.2
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.6.2
   mysql-python: Not Installed
      pycparser: 2.20
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.28.0
         Python: 3.6.8 (default, Sep 26 2019, 11:57:09)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 15.3.0
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.1.4

System Versions:
           dist: redhat 7.8 Maipo
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-1062.9.1.el7.x86_64
         system: Linux
        version: Red Hat Enterprise Linux Server 7.8 Maipo

minion


Salt Version:
           Salt: 2018.3.4

Dependency Versions:
           cffi: 1.10.0
       cherrypy: 10.2.1
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: 2.0.5
      gitpython: 2.1.3
          ioflo: Not Installed
         Jinja2: 2.9.6
        libgit2: Not Installed
        libnacl: 1.6.1
       M2Crypto: Not Installed
           Mako: 1.0.6
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: 2.17
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 16:02:32) [MSC v.1900 64 bit (AMD64)]
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.3
           RAET: Not Installed
          smmap: 2.0.5
        timelib: 0.2.4
        Tornado: 4.5.1
            ZMQ: 4.1.6

System Versions:
           dist:
         locale: cp1252
        machine: AMD64
        release: 2012ServerR2
         system: Windows
        version: 2012ServerR2 6.3.9600 SP0 Multiprocessor Free

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with state.disable dont_run, then compare a highstate with an explicit state.apply dont_run using the commands and versions in the report. Trace how disabled state files are handled during highstate compilation; done means the disabled file is not run and is either omitted or reported as intentionally ignored without a compilation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.