Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Master job scheduler using when fails #62858

Closed
2 tasks done
lkubb opened this issue Oct 11, 2022 · 0 comments · Fixed by #62859
Closed
2 tasks done

[BUG] Master job scheduler using when fails #62858

lkubb opened this issue Oct 11, 2022 · 0 comments · Fixed by #62859
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt needs-triage

Comments

@lkubb
Copy link
Contributor

lkubb commented Oct 11, 2022

Description
Scheduling jobs on the master using "when" fails. This is caused by

salt/salt/utils/schedule.py

Lines 1066 to 1068 in 45ead10

elif (
"whens" in self.opts["grains"] and i in self.opts["grains"]["whens"]
):
assuming opts["grains"] exists, which is only true on a minion.

Setup

# master config
schedule:
  highstate:
    function: state.orchestrate
    args:
      - orch.sys.salt.highstate
    when:
      - 4:00am

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

  • on-prem machine
  • VM (KVM)

Steps to Reproduce the behavior

  1. install python-dateutil
  2. set the time appropriately
  3. watch the master log

Expected behavior
Job is executed.

Screenshots

Exception 'grains' occurred in scheduled job

(The error description could be much better imho).

Versions Report

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

Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.8.2
     docker-py: Not Installed
         gitdb: 2.0.5
     gitpython: 2.1.9
        Jinja2: 2.11.3
       libgit2: Not Installed
      M2Crypto: 0.38.0
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: 3.10.1
  pycryptodome: 3.14.1
        pygit2: Not Installed
        Python: 3.8.12 (default, Sep 26 2021, 13:12:50)
  python-gnupg: Not Installed
        PyYAML: 5.3.1
         PyZMQ: 18.0.1
         smmap: 2.0.3
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: openbsd 7.0
        locale: utf-8
       machine: amd64
       release: 7.0
        system: OpenBSD
       version: OpenBSD 7.0

Additional context
PR incoming.

@lkubb lkubb added Bug broken, incorrect, or confusing behavior needs-triage labels Oct 11, 2022
@OrangeDog OrangeDog added the Core relates to code central or existential to Salt label Oct 11, 2022
@lkubb lkubb changed the title [BUG] Master job scheduler using when fails [BUG] Master job scheduler using when fails Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt needs-triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants