sucks
sucks copied to clipboard
sleekxmpp.basexmpp ERROR day is out of range for month
- Login works
- Server used: eu
- any further command throws the following error
sleekxmpp.basexmpp WARNING fulljid property deprecated. Use boundjid.resource
sleekxmpp.basexmpp ERROR day is out of range for month
Traceback (most recent call last):
File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1492, in _process
if not self.__read_xml():
File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1564, in __read_xml
self.__spawn_event(xml)
File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1632, in __spawn_event
handler.prerun(stanza_copy)
File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 64, in prerun
self.run(payload, True)
File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 76, in run
self._pointer(payload)
File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/features/feature_starttls/starttls.py", line 64, in _handle_starttls_proceed
if self.xmpp.start_tls():
File "/home/bernhard/.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 "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py", line 133, in verify
not_before, not_after = extract_dates(raw_cert)
File "/home/bernhard/.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/lib/python3.6/_strptime.py", line 565, in _strptime_datetime
tt, fraction = _strptime(data_string, format)
File "/usr/lib/python3.6/_strptime.py", line 528, in _strptime
datetime_date(year, 1, 1).toordinal() + 1
ValueError: day is out of range for month
Look at my post here: https://github.com/home-assistant/home-assistant/issues/16186
Can be fixed, but perhaps you will run in to other issues later, like I did.
More to the point, it seems that this issue is upstream in sleekXMPP: https://github.com/fritzy/SleekXMPP/issues/478
Considering how long that issue has been open, we may need to figure out a workaround here.
Any updates on this one? I got the same error and wonder if there is a fix for it.
Also finding the same error
Same issue of the OP in Home Assistant 0.81.2
Same issue here running hassio 0.81.6
If I fix the date out of range error via https://github.com/fritzy/SleekXMPP/issues/478#issuecomment-367328327, I get this error instead:
2018-11-10 20:56:07 INFO (read_thread) [sleekxmpp.xmlstream.xmlstream] Negotiating TLS
2018-11-10 20:56:07 INFO (read_thread) [sleekxmpp.xmlstream.xmlstream] Using SSL version: TLSv1
2018-11-10 20:56:07 ERROR (read_thread) [sleekxmpp.xmlstream.xmlstream] Connection error.
2018-11-10 20:56:07 ERROR (read_thread) [sleekxmpp.basexmpp] <TagSet object at 0x7f44641cdba8 tags 0:32:16> not in asn1Spec: <OctetString schema object at 0x7f43d05314a8 tagSet <TagSet object at 0x7f446417c908 tags 0:0:4> encoding iso-8859-1>
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 140, in verify
cert_names = extract_names(raw_cert)
File "/usr/local/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py", line 73, in extract_names
asn1Spec=OctetString())[0]
File "/usr/local/lib/python3.6/site-packages/pyasn1/codec/ber/decoder.py", line 1318, in __call__
'%s not in asn1Spec: %r' % (tagSet, asn1Spec)
pyasn1.error.PyAsn1Error: <TagSet object at 0x7f44641cdba8 tags 0:32:16> not in asn1Spec: <OctetString schema object at 0x7f43d05314a8 tagSet <TagSet object at 0x7f446417c908 tags 0:0:4> encoding iso-8859-1>
2018-11-10 20:56:07 INFO (read_thread) [sleekxmpp.xmlstream.xmlstream] Waiting for </stream:stream> from server
@kmlucy Just bought one of these off Amazon on sale and I'm getting the same error after I tried the fix from that thread. For now I've just removed the component from my configuration.yaml because it's a bit chatty in the Home Assistant logs and it delays reboots. Looking forward to seeing how this develops.
Line 111
not_before = datetime.strptime(not_before, '%Y%m%d%H%M%SZ')
Replaced with...
try:
not_before = datetime.strptime(not_before, '%Y%m%d%H%M%SZ')
except ValueError:
not_before = datetime.strptime(not_before, '%y%m%d%H%M%SZ')
Line 115
not_after = datetime.strptime(not_after, '%Y%m%d%H%M%SZ')
Replaced with...
try:
not_after = datetime.strptime(not_after, '%Y%m%d%H%M%SZ')
except ValueError:
not_after = datetime.strptime(not_after, '%y%m%d%H%M%SZ')
@alagarath I actually ended up just reverting to the previous dependencies, which fixed the problem for the moment. It's not a long term solution, but it fixes the issue for the moment: https://github.com/home-assistant/home-assistant/issues/18054#issuecomment-438657231
@kmlucy That worked for me! Long live workarounds! I'll keep my eyes peeled for this issue to be closed and then I'll revert back to the latest dependencies.
Would be nice if the working (latest) dependencies will be reported in this topic by the first one who see's it working.
Seeing this on 0.82.1
@kmlucy Just bought one of these off Amazon on sale and I'm getting the same error after I tried the fix from that thread. For now I've just removed the component from my configuration.yaml because it's a bit chatty in the Home Assistant logs and it delays reboots. Looking forward to seeing how this develops.
Line 111
not_before = datetime.strptime(not_before, '%Y%m%d%H%M%SZ')
Replaced with...
try: not_before = datetime.strptime(not_before, '%Y%m%d%H%M%SZ') except ValueError: not_before = datetime.strptime(not_before, '%y%m%d%H%M%SZ')
Line 115
not_after = datetime.strptime(not_after, '%Y%m%d%H%M%SZ')
Replaced with...
try: not_after = datetime.strptime(not_after, '%Y%m%d%H%M%SZ') except ValueError: not_after = datetime.strptime(not_after, '%y%m%d%H%M%SZ')
Hey, did you managed to get it working ?
The good news is that it appears that @fritzy is active again on SleekXMPP as two commits were put in today. I just left a note on the open issue over there with a hopeful prod.
If we can't get a new version of SleekXMPP then we can simply pin sucks to use 1.3.2 to fix this issue.
@marlonalkan Yes, but only by rolling back to the previous dependencies mentioned by kmlucy.
I ran the following in my docker container terminal from the link kmlucy posted
RUN pip uninstall -y pyasn1 pyasn1-modules sleekxmpp slixmpp && pip install pyasn1==0.3.7 pyasn1 modules==0.1.5 sleekxmpp==1.3.2 dnspython3==1.15.0
I've read the workarounds you guys posted, but it seems to me its for non-hass.io versions of HA. Has anyone found success adopting the workaround in Hass.io?
I'm in the same boat. How do we work around this for HASSIO?
I would imagine it's using the same sort of dependencies somewhere in the virtual directory for hassio. Unfortunately I have no experience with hassio atm
Thanks alagarth. Appreciate the quick response. We will have to see what comes about with SleekXMPP.
Is this a BUG with the sleekxmpp or is the ecovac addon using an outdated or depreciated method within sleekxmpp?
For what it's worth, I do a clean download-and-build with this code every day to run my vacuum. I don't get this error ever. So I believe this is something specific to HomeAssistant users. I'm happy to take a patch that fixes the problem, though.
@wpietri With your setup, what version of sleekxmpp do you use?
Looking at the logs from the last nightly build, I see this: Successfully installed atomicwrites-1.2.1 attrs-18.2.0 certifi-2018.11.29 chardet-3.0.4 click-7.0 coverage-4.5.2 idna-2.7 more-itertools-4.3.0 pathlib2-2.3.3 pluggy-0.8.0 pprintpp-0.4.0 py-1.7.0 pycountry-18.12.8 pycountry-convert-0.7.2 pycryptodome-3.7.2 pytest-4.0.1 pytest-cov-2.6.0 pytest-mock-1.10.0 repoze.lru-0.7 requests-2.20.1 scandir-1.9.0 six-1.11.0 sleekxmpp-1.3.3 stringcase-1.2.0 sucks-0.9.3 urllib3-1.24.1
Home Assistant has moved from sleekxmpp to slixmpp==1.4.1. I believe this is where the problems comes from. I, and others, have been able to get it working again by reverting to sleekxmpp temporarily.
@wpietri: The issue is related to the way timestamps are coming from or being sent to the XMPP server. I find it entirely likely that this could be an issue experienced differently on different combinations of OS and hardware. On my dev machine, sucks works fine via Home Assistant, but on my production Raspberry Pi, it does not. :(
If you look at the comments on the issue in SleekXMPP you can some other users outside of Home Assistant that have been experiencing this issue: https://github.com/fritzy/SleekXMPP/issues/478
The second comment has a person experiencing it on only one out of a pool of servers, so there's something weird going on.
There are a bunch more people reporting having the issue here in a pull request that was rejected: https://github.com/fritzy/SleekXMPP/issues/461
I don't know enough about XMPP to make an authoritative call here, which is the only reason I haven't pinned sucks to XMPP 1.3.2 (before the issue was introduced.)
Wow! What a community!
I was digging around @fritzy/SleekXMPP some this AM and I saw the same thing. I really wish I could contribute here, but I'm not a developer. I do know scripting languages though and currently learning Python.
I do want to say thank you for the time and effort to put this addon together.
rschoolm
Home Assistant has moved from sleekxmpp to slixmpp==1.4.1
@kmlucy Can you link me to where discussion on this suspicion is taking place? I'd like to dig in on why slixmpp might be affecting what SleekXMPP is doing.
https://github.com/home-assistant/home-assistant/issues/18054
I had problems starting from 0.81.0, which corresponds to when they switched. By manually reverting, I was able to get everything working again.
This PR seems to be the change that triggered this for me: https://github.com/home-assistant/home-assistant/pull/17283
I'm using HassIO and I don't know how to go back to 1.3.2 or 1.3.1... can someone point me on how to do it?
i did some digging and noticed that the xmpp is a pretty minor part of this library...
can someone with better python chops just swap the xmpp library to one that works?