Page MenuHomeVyOS Platform

"reboot at" command together with date does not work / weird error message on wrong input
Closed, ResolvedPublicBUG

Description

[email protected]:~$ reboot at 00:00 date
Possible completions:
  <DDMMYYYY>    Reboot at a specific date
  <DD/MM/YYYY>
  <DD.MM.YYYY>
  <DD:MM:YYYY>


[email protected]:~$ reboot at 00:00 date 2021-09-02
Invalid time "00:00". The valid format is HH:MM
[email protected]:~$ reboot at 00:00 date 2021-09-09
Invalid time "00:00". The valid format is HH:MM
[email protected]:~$ reboot at 00:00 date 2021-09-31
Invalid time "00:00". The valid format is HH:MM
[email protected]:~$ reboot at 00:00 date 31092021
Invalid time "00:00". The valid format is HH:MM

Also when the reboot date is in the past, VyOS 1.3.0-rc6 will have problems as we try to reboot at a negative number.

Also note this

[email protected]:~$ reboot at 00:00 date 2021-09-31
Invalid time "00:00". The valid format is HH:MM`

September has no 31 days - strptime() knows this:

>>> datetime.strptime('2021-09-31', "%Y-%m-%d")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.9/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/lib/python3.9/_strptime.py", line 534, in _strptime
    julian = datetime_date(year, month, day).toordinal() - \
ValueError: day is out of range for month

Details

Difficulty level
Unknown (require assessment)
Version
1.3.0-rc6 1.4-rolling
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Related Objects

Mentioned In
1.2.9

Event Timeline

c-po removed erkin as the assignee of this task.
c-po created this task.
c-po added a subscriber: erkin.
c-po renamed this task from "reboot at" command together with date does not work to "reboot at" command together with date does not work / weird error message.Sep 26 2021, 8:54 AM
c-po renamed this task from "reboot at" command together with date does not work / weird error message to "reboot at" command together with date does not work / weird error message on wrong input.
c-po updated the task description. (Show Details)
c-po changed Version from 1.2.8 1.3.0-rc6 1.4-rolling to 1.3.0-rc6 1.4-rolling.

The issue even with 00:00 format

vyos@r12-lts:~$ reboot at 00:00 
Invalid time "00:00". The valid format is HH:MM
vyos@r12-lts:~$ 
vyos@r12-lts:~$ reboot at 00:01
Shutting down at Sat 2021-10-30 00:01:00 EEST (reboot)...
vyos@r12-lts:~$ 


vyos@r12-lts:~$ reboot at 00:00 date 23:11:2021
Invalid time "00:00". The valid format is HH:MM
vyos@r12-lts:~$ 
vyos@r12-lts:~$ 
vyos@r12-lts:~$ reboot at 00:01 date 23:11:2021
Shutting down at Mon 2021-11-22 23:01:35 EET (reboot)...
vyos@r12-lts:~$
Viacheslav changed the task status from Open to In progress.Oct 29 2021, 4:54 PM
Viacheslav claimed this task.
Viacheslav edited projects, added VyOS 1.2 Crux (VyOS 1.2.9); removed VyOS 1.2 Crux.