Day is out of range for month - error

I get this error every few seconds:

day is out of range for month
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1492, in _process
    if not self.__read_xml():
  File "/usr/local/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1564, in __read_xml
    self.__spawn_event(xml)
  File "/usr/local/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1632, in __spawn_event
    handler.prerun(stanza_copy)
  File "/usr/local/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 64, in prerun
    self.run(payload, True)
  File "/usr/local/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 76, in run
    self._pointer(payload)
  File "/usr/local/lib/python3.6/site-packages/sleekxmpp/features/feature_starttls/starttls.py", line 64, in _handle_starttls_proceed
    if self.xmpp.start_tls():
  File "/usr/local/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 889, in start_tls
    cert.verify(self._expected_server_name, self._der_cert)
  File "/usr/local/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py", line 133, in verify
    not_before, not_after = extract_dates(raw_cert)
  File "/usr/local/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py", line 111, in extract_dates
    not_before = datetime.strptime(not_before, '%Y%m%d%H%M%SZ')
  File "/usr/local/lib/python3.6/_strptime.py", line 565, in _strptime_datetime
    tt, fraction = _strptime(data_string, format)
  File "/usr/local/lib/python3.6/_strptime.py", line 528, in _strptime
    datetime_date(year, 1, 1).toordinal() + 1
ValueError: day is out of range for month

Yesterday we had a time change in the country I live in, could this be the issue?

Or you updated crossing the International Date Line and nobody understood Oct 32nd? Seriously, it looks like a low level Linux/Unix date conversion issue.

And how can I fix this?

Just as a test, try changing the date of the event and see if the error still occurs.

There is no certain event, the error appears every few seconds. I don’t know which event I could change. Also I wouldn’t now how to change the date of an event.

Could you be more specific? thank you!

The error code:
not_before, ‘%Y%m%d%H%M%SZ’
has me a bit concerned about the underlying code being in error… specifically the %SZ part.
My personal advise is to just wait it out a day and see if it goes away.

ok, I’ll wait, thanks!

Okay… don’t mean to beat this horse into the ground but…
I just did a low level linux prompt inquiry using the command “date +%Y%m%d%H%M%SZ” and it returned “20181029124132Z”.
Now if I modify that prompt to be “date +%Y%m%d%H%M%S%Z”
I receive “20181029125015CDT” which is what I expect.
Not a really solid return with that Z thingie hanging off the back end.
Me thinks you have a coding issue outside of your control.

Ok, so what do you think, if it does go away by itself tomorrow, will i have to back up my config an than reinstall hass.io?

Any other suggestions?

Reinstalling the code with the same error will not fix the issue you have. This is out of your control and up to the software authors to address it.

Hopefully one of the authors read this topic.

Error is still here. I get a new one every 10 seconds.

Ya ready for this then?
First, make a backup of everything.
Now go into edit on “/usr/local/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py”
Find the offending code ( %Y%m%d%H%M%SZ ) and change it to: %Y%m%d%H%M%S%Z
(note the only change is inserting a % before the Z at the end)
Save file, reboot, pray.

The thing is home assistant works, so I’m a little afraid to do that.
Only thing that doesn’t work right now is a vacuum cleaner component (ecovacs).
I don’t know if both errors have the same reason.

can’r find the cert.py file. Looks like /usr/local/lib/ is empty. even no invisible folder called python3.6

Okay… I’m stumped. You would think that an error message that pointed to a file in a specific directory would exist so it looks like this one is over my head.
Maybe someone else can help out here… anybody?

Found it here:

Disabled the ecovacs component (stopped working with 0.80.3), and the error message is gone.

Thanks for your help

I’m wondering if the day is out of range error is the source for my other issue:

I have some issues with the chronic blaming of SD card corruption due to power outage. Granted it may happen once in a while but I live on an island in the Gulf of Mexico where power outages are quite common. I don’t think a month goes by without one. Usually only about a second or two but a power disruption none the less.
I have never lost an SD card in any of my 3 PI’s here in the over 2 years they have been running 24/7.

and, from a command line as root: (console or an ssh into your PI)

sync
sync
halt

(3 commands) has been the safe way of shutting down unix for 50 years now. :slight_smile:

I have some issues with the chronic blaming of SD card corruption due to power outage.

I don’t blame it, but something must be wrong with my system.
I also tried sync sync halt once, and even this way it did not boot afterwards.

How long do I have to wait after “halt”? I waited until the green led of my pi 3B stopped blinking.

Does it autoboot if I wait to long? Or does a shutdown pi only boot after a power cut?