Skip to content

[Bug]: list_jobs with search_target fails if targets is not iterable #68780

Open

Description

@nychef

What happened?

There are execution and state failures that can leave Target as something other than a string or list in the job cache. salt.runners.jobs line 334 iterates across the targets in the job but doesn't check if the target is iterable. If line 334 in jobs.py was changed from targets = ret[item]["Target"] to targets = ret[item]["Target"] if hasattr(ret[item]["Target"], '__iter__') else [] it would resolve this issue

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)

opensuse-leap-15.5, rhel-8

salt --versions-report output

Salt Version:
                  Salt: 3006.21

Python Version:
                Python: 3.10.19 (main, Feb  5 2026, 07:05:38) [GCC 11.2.0]

Dependency Versions:
                  cffi: 2.0.0
              cherrypy: 18.10.0
          cryptography: 42.0.5
              dateutil: 2.8.1
             docker-py: Not Installed
                 gitdb: 4.0.12
             gitpython: 3.1.45
                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.22.3
                 smmap: 5.0.2
               timelib: 0.3.0
               Tornado: 4.5.3
                   ZMQ: 4.3.4

Salt Extensions:
 saltext.elasticsearch: 1.2.3

System Versions:
                  dist: opensuse-leap 15.6
                locale: utf-8
               machine: x86_64
               release: 6.4.0-150600.23.84-default
                system: Linux
               version: openSUSE Leap 15.6

Activity

  1. added
    bug
    on Mar 4, 2026
  2. changed the title [-][Bug]: list_jobs with search_target fails if targets is none[/-] [+][Bug]: list_jobs with search_target fails if targets is not iterable[/+] on Mar 4, 2026
  3. added a commit that references this issue on Mar 28, 2026
    945e742
  4. added a commit that references this issue on Apr 21, 2026
    ed84164
  5. added 3 commits that reference this issue on Jun 26, 2026
    0dc478e
    2eec40c
    1b4be8e
  6. added this to the Potassium v3009.0 milestone on Jun 26, 2026
  7. added
    severity-low
    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-low

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions