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

cron.present: errors in crontab file, can't install. #10721

Closed
boltronics opened this issue Feb 25, 2014 · 5 comments · Fixed by #10741
Closed

cron.present: errors in crontab file, can't install. #10721

boltronics opened this issue Feb 25, 2014 · 5 comments · Fixed by #10741

Comments

@boltronics
Copy link
Contributor

I'm experiencing an issue with cron.present, which i think was triggered when switching from salt 0.17.5 to 2014.1.0 (both on master and minion).

Note: I did a search/replace on the actual script name, over the logs/output published in this report.

The state file looked like:

/path/to/my-script:
  file.managed:
    ... some stuff ...
  cron.present:
    - user: root
    - comment: |
        I have a multi-line comment
        about my script here.
    - require:
      - file: /path/to/my-script

State output:

----------
          ID: /path/to/my-script
    Function: cron.present
      Result: False
     Comment: Cron /path/to/my-script for user root failed to commit with error 
              "/tmp/tmpHWZ097":2: bad minute
              errors in crontab file, can't install.
     Changes:   
----------

Debug:

[INFO    ] Executing state file.managed for /path/to/my-script
[INFO    ] File /path/to/my-script is in the correct state
[INFO    ] Completed state [/path/to/my-script] at time 16:40:42.861982
[INFO    ] Running state [/path/to/my-script] at time 16:40:43.243929
[INFO    ] Executing state cron.present for /path/to/my-script
[INFO    ] Executing command 'crontab -l -u root' in directory '/root'
[ERROR   ] Command 'crontab -l -u root' failed with return code: 1
[ERROR   ] stderr: no crontab for root

[INFO    ] Executing command 'crontab -u root /tmp/tmpHWZ097' in directory '/root'
[ERROR   ] Command 'crontab -u root /tmp/tmpHWZ097' failed with return code: 1
[ERROR   ] stderr: "/tmp/tmpHWZ097":2: bad minute
errors in crontab file, can't install.
[ERROR   ] Cron /path/to/my-script for user root failed to commit with error 
"/tmp/tmpHWZ097":2: bad minute
errors in crontab file, can't install.
[INFO    ] Completed state [/path/to/my-script] at time 16:40:43.339807

It does not matter if I manually specify the minute field (which should be unnecessary anyway since I want this to run every minute).

# salt-call --versions-report
           Salt: 2014.1.0-1-gf5d103f
         Python: 2.7.3 (default, Jan  2 2013, 13:56:14)
         Jinja2: 2.6
       M2Crypto: 0.21.1
 msgpack-python: 0.1.10
   msgpack-pure: Not Installed
       pycrypto: 2.6
         PyYAML: 3.10
          PyZMQ: 13.1.0
            ZMQ: 3.2.3

This is on a pretty standard Debian Wheezy amd64 install, with wheezy-backports for the ZQM components.

@kiorky
Copy link
Contributor

kiorky commented Feb 25, 2014

You may have not noticed the introduction of identifier, i think that multiline comment are not supported by this new feature, and we need to provide a fix for that.

@kiorky
Copy link
Contributor

kiorky commented Feb 25, 2014

/cc @regilero

@boltronics
Copy link
Contributor Author

I did, but I thought that that was only supported in 2014.2 and up. I'm running 2014.1.0.

@kiorky
Copy link
Contributor

kiorky commented Feb 25, 2014

Yep i thought my change wouldnt go in 2014.1.0, seems you have them !

@kiorky
Copy link
Contributor

kiorky commented Feb 25, 2014

ping @basepi to cherryick and cut packages ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants