saltstack / saltstack/salt

[BUG] `saltutil.running` Output Discrepancy

Open
#65,449 2 comments 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
The response from saltutil.running is less complete when a salt-call initiates the job than when salt initiates the job. In the case of a salt initiated job, the arg and kwarg values are included, whereas when salt-call initiates the job they are not included.

Assuming the following setup, with a single Master and two connected Minions:

salt@minionA: salt-call state.apply mystate
salt@master: salt minionB state.apply mystate

The output that saltutil.running returns will then contain different information based on how the job was started on each Minion:

salt@master: salt '*' saltutil.running
minionA:
    |_
      ----------
      fun:
          state.apply
      jid:
          20231024091633574647
      pid:
          1696644
      tgt:
          salt-call
minionB:
    |_
      ----------
      arg:
          - mystate
      fun:
          state.apply
      jid:
          20231024091626380205
      pid:
          1678400
      ret:
      tgt:
          minionB
      tgt_type:
          glob
      user:
          root

In the case of minionA, the output does not contain the expected arg value that is shown in the output for minionB.

Setup
This affects any Salt setup, from as simple a setup as a single Master and Minion

Steps to Reproduce the behavior
This can be replicated with a master and a minion by:

  1. Using salt or salt-call to run a function on the Minion that takes arguments
  2. Running saltutil.running from the Master targeting the Minion in the previous step
  3. Comparing the output from the salt and salt-call initiation of the function call

Expected behavior
The expected behaviour would be to return the same information for a job started by salt-call as a job started by salt.

Versions Report
Salt: 3005.1
Debian: Bookworm (12)

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 by tracing the saltutil.running entry point and the job metadata created by salt-call versus salt. Reproduce the comparison with a master and minion, then add or update a regression test so jobs started by salt-call report the same arg and kwarg information as jobs started by salt.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.