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] Salt cannot apply schedule with salt-minion off/stopped #65033

Closed
2 of 9 tasks
Adam-Zvolanek opened this issue Aug 22, 2023 · 3 comments
Closed
2 of 9 tasks

[BUG] Salt cannot apply schedule with salt-minion off/stopped #65033

Adam-Zvolanek opened this issue Aug 22, 2023 · 3 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior

Comments

@Adam-Zvolanek
Copy link

Description

Setting up a schedule while the minion is not running gives an error "Failed to add job X to schedule.".

Error logging to be more verbose, specifically stating either in the docs or in the error that the minion needs to be running before a schedule can be added.

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: Amazon WorkSpaces
  • 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

  • Disable salt-minion, systemctl stop salt-minion
  • Add anything to the schedule, e.g. with salt-call schedule.add foo

Or as a state:

schedule:
  schedule.present:
    - function: state.highstate
    - job_kwargs:
        saltenv: env1
    - cron: '30 * * * 1-5'
    - splay: 900

Expected behavior

The schedule should be added, or a descriptive reasoning as to why it couldn't be added should be returned. Configure the schedule (in /etc/salt/minion.d/_schedule.conf) without requiring the minion to be running.

Versions Report

Salt Version:
          Salt: 3006.2
 
Python Version:
        Python: 3.10.12
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       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: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.13.3
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: amzn 2
        locale: utf-8
       machine: x86_64
       release: 5.15.amzn2.x86_64
        system: Linux
       version: Amazon Linux 2
@Adam-Zvolanek Adam-Zvolanek added Bug broken, incorrect, or confusing behavior needs-triage labels Aug 22, 2023
@Adam-Zvolanek Adam-Zvolanek changed the title [BUG] [BUG] Salt cannot apply schedule with salt-minion off/stopped Aug 22, 2023
@OrangeDog
Copy link
Contributor

Similar issue to #60213

@garethgreenaway
Copy link
Contributor

@Adam-Zvolanek Thanks for the report. The issue here is that the schedule state module relies on the schedule execution module which by default utilizes the event bus to add the schedule item to a running minion. With #61423 you can manage the schedule when the minion isn't running, eg. running salt-call with --local , but including offline=True when calling the module or offline: True in the state will allow you to add the jobs to the minion configuration file when the minion isn't running. I did notice that the documentation for the state module needs to be updated to include that option.

@Ch3LL
Copy link
Contributor

Ch3LL commented Sep 5, 2023

closed by #65084

@Ch3LL Ch3LL closed this as completed Sep 5, 2023
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
Projects
None yet
Development

No branches or pull requests

5 participants