shepherd: cron-string->calendar-event does not accept "*/15 * * * *"

  • Done
  • quality assurance status badge
Details
3 participants
  • 45mg
  • Ludovic Courtès
  • Tomas Volf
Owner
unassigned
Submitted by
Tomas Volf
Severity
normal

Debbugs page

Tomas Volf wrote 1 months ago
(address . bug-guix@gnu.org)
87r04qfsw3.fsf@wolfsden.cz
Hello,

when I try to configure a timer based on my legacy crontab file, I get
the following error:

Toggle snippet (20 lines)
$ guix shell guile shepherd guile-fibers -- guile -c '(use-modules (shepherd service timer)) (cron-string->calendar-event "*/15 * * * *")'
Backtrace:
In ice-9/boot-9.scm:
1752:10 5 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
4 (apply-smob/0 #<thunk 7f5d9c401300>)
In ice-9/boot-9.scm:
724:2 3 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
619:8 2 (_ #(#(#<directory (guile-user) 7f5d9c404c80>)))
In ice-9/command-line.scm:
185:19 1 (_ #<input: string 7f5d9c3fe850>)
In unknown file:
0 (eval (cron-string->calendar-event "*/15 * * * *") #<di…>)

ERROR: In procedure eval:
ERROR:
1. &message: "\"*/15 * * * *\": invalid minutes cron field"

It seems to work with 0-59/15, so there possibly is some bug in handling
the *.

Tomas

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
-----BEGIN PGP SIGNATURE-----

iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmeVYPwOHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/wanW6xAAi9xv6SMlpAntw5pYq/9lWF8eaPqf5BAHj9fI
FLsSEgO0EK1Z7xLP4vrz+zvjGL/5ZRavgdjI9x9lPkfQyauidnWpufFlbnlPI6+y
USCGW/+XQvXuhIZSOGpRns0FNWFz/XIUQWRBItp7Hb56PFmwguVxhypAqrQypJgS
lv+QrnaUP0WfjXldMi5amrPI6MNi+WQqtVT0aRN2Ry22LxXiYXG/r4pllhLHuaRb
fIjpK0Uk9IXNXMZQj8wbDgbJ9ovF2BnGxf9llbClV1fGOaajap2DtnpHFeZ43HcB
yl7ZpLZLeV6HubeinGGJuQzZMN3NyhxGD0Dvth033x6COvgsHlw84eXJOGH9GNyj
MVL418SRJ91tym7r+Wv31gufU8QRTTcX8tqppS6tevwzhdYOeBQuc5nQI75Dfk45
IVU+BREl2lQ1S96B9c4dPrws1a7Z4N3SeumZ0DJaZ9d8M10VsmGZW6tJk7Sa55JP
eET8TFU0zae7iCNkfezUXUM6VSFHloAPTH6qrtq67hsdRr6gTgJi6i2+kjV5ZkAc
+kejWC58iTTHE7vxGlh+C4ZPik4lseh0J5uIIfUWwI5vXxtVmhBNe3argH2n3HRs
2XW6mVYlgAAWzMy1TiXjSx8qNAipZ7XzfAgB8RJILXYVYNqM2K1nNGJpvc+iUBMt
kS4dPQM=
=e57j
-----END PGP SIGNATURE-----

45mg wrote 1 months ago
87plk9iyty.fsf@gmail.com
Tomas Volf <~@wolfsden.cz> writes:

Toggle quote (8 lines)
> ERROR: In procedure eval:
> ERROR:
> 1. &message: "\"*/15 * * * *\": invalid minutes cron field"
> --8<---------------cut here---------------end--------------->8---
>
> It seems to work with 0-59/15, so there possibly is some bug in handling
> the *.

I get a similar error with `(cron-string->calendar-event "* * * * *")`
in a `shepherd-service`:

Toggle snippet (7 lines)
$ sudo guix system reconfigure config.scm
...
guix system: warning: exception caught while executing 'eval' on service 'root':
Throw to key `%exception' with args `("#<&message message: \"calendar-event: hours: 24: value out of range (0-23)\">")'.


but '* 0-23 * * *' works.
45mg wrote 1 months ago
87msfdiygd.fsf@gmail.com
45mg <45mg.writes@gmail.com> writes:

Toggle quote (1 lines)
> I get a similar error with `(cron-string->calendar-event "* * * * *")`
[...]
Toggle quote (2 lines)
> but '* 0-23 * * *' works.

Oh, nevermind, you already opened a separate bug for this:
Ludovic Courtès wrote 1 months ago
(name . Tomas Volf)(address . ~@wolfsden.cz)(address . 75843-done@debbugs.gnu.org)
87jza4a2mf.fsf@gnu.org
Hello,

Tomas Volf <~@wolfsden.cz> skribis:

Toggle quote (2 lines)
> $ guix shell guile shepherd guile-fibers -- guile -c '(use-modules (shepherd service timer)) (cron-string->calendar-event "*/15 * * * *")'

[...]

Toggle quote (2 lines)
> 1. &message: "\"*/15 * * * *\": invalid minutes cron field"

Fixed in 6f3860e492e078c5579e2117b04742252be81562.

Toggle quote (3 lines)
> It seems to work with 0-59/15, so there possibly is some bug in handling
> the *.

Yup, that’s a good workaround until 1.0.2 is out (presumably in the
coming days).

Thanks,
Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 75843@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 75843
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help