saltstack / saltstack/salt

[BUG] Minions do not properly report SLS rendering failure (WAS: state.sls_exists broken on Debian)

Open
#66,934 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
On both Debian 11 and 12 minions, state.sls_exists is broken. This same issue does not occur on other minions (e.g. AlmaLinux 8.x/9.x).

Setup
Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD
  • classic packaging
  • onedir packaging
  • used bootstrap to install

Steps to Reproduce the behavior
e.g.:

example top.sls:

base:
  '*':
    - foo.bar.baz

salt://foo/bar/baz/init.sls:

{% set incl_sls = sls + '.init_' +  grains['kernel'].lower() %}

{% if salt['state.sls_exists'](incl_sls) %}
include:
  - {{ incl_sls }}
{%- else %}
Unsupported Include:
  test.nop:
    - name: The kernel "{{ grains['kernel'].lower() }}" could not include "{{ incl_sls }}".
{% endif %}

salt://foo/bar/baz/init_linux.sls:

Successfully Included:
  test.nop:
    - name: 'The include worked.'

Debian, both 11 and 12, will report `The kernel "linux" could not include "foo.bar.baz.init_linux". Despite the SLS existing, even in the cache on the minion.

AlmaLinux 8 and 9 will appropriately apply the Successfully Included state.

Expected behavior
Debian to properly know that the SLS does, indeed, exist.

Screenshots
N/A

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

(Master runs 3007.1 via onedir bootstrap on AlmaLinux 9.4. The below is a minion experiencing the bug.)

Salt Version:
          Salt: 3007.1

Python Version:
        Python: 3.10.14 (main, Apr  3 2024, 21:30:09) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.16.0
      cherrypy: 18.8.0
      dateutil: 2.8.2
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.4
       libgit2: Not Installed
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.7
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 23.1
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.19.1
        pygit2: Not Installed
  python-gnupg: 0.5.2
        PyYAML: 6.0.1
         PyZMQ: 25.1.2
        relenv: 0.16.0
         smmap: Not Installed
       timelib: 0.3.0
       Tornado: 6.3.3
           ZMQ: 4.3.4

Salt Package Information:
  Package Type: onedir

System Versions:
          dist: debian 12.7 bookworm
        locale: utf-8
       machine: x86_64
       release: 6.1.0-13-amd64
        system: Linux
       version: Debian GNU/Linux 12.7 bookworm

Additional context
N/A

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

Start with the state.sls_exists entry point and reproduce the supplied example on Debian 11 or 12, then compare it with AlmaLinux 8 or 9 using the same cached SLS files. Done means Debian correctly detects foo.bar.baz.init_linux and renders the Successfully Included state; the issue does not name an implementation file or test to run.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.