Core: HTML5 Push Notifications Broken in 0.87.1

Created on 12 Feb 2019  路  7Comments  路  Source: home-assistant/core

Home Assistant release with the issue:0.87.1
Last working Home Assistant release (if known):0.87.0
Operating environment (Hass.io/Docker/Windows/etc.):Docker
Please provide details about your environment.
Component/platform:HTML5 Push Notifications
Please add the link to the documentation at https://www.home-assistant.io/components/ of the component/platform in question.
https://www.home-assistant.io/components/notify.html5/

Following upgrade to 0.87.1 HTML5 notification stopped working. Test calling from dev tools generates "failed to call........"

See associated log:

2019-02-12 13:20:22 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.22893546415328] Error handling message: {'type': 'call_service', 'domain': 'notify', 'service': 'html5_juan_samsung_phone', 'service_data': {'message': 'test'}, 'id': 119}
 Traceback (most recent call last):
 File "/usr/src/app/homeassistant/components/websocket_api/decorators.py", line 17, in _handle_async_response await func(hass, connection, msg)
 File "/usr/src/app/homeassistant/components/websocket_api/commands.py", line 148, in handle_call_service connection.context(msg))
 File "/usr/src/app/homeassistant/core.py", line 1130, in async_call self._execute_service(handler, service_call))
 File "/usr/src/app/homeassistant/core.py", line 1152, in _execute_service await handler.func(service_call)
 File "/usr/src/app/homeassistant/components/notify/__init__.py", line 117, in async_notify_message await notify_service.async_send_message(**kwargs)
 File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs)
 File "/usr/src/app/homeassistant/components/notify/html5.py", line 451, in send_message self._push_message(payload, **kwargs)
 File "/usr/src/app/homeassistant/components/notify/html5.py", line 498, in _push_message json.dumps(payload), gcm_key=gcm_key, ttl='86400'
 File "/usr/local/lib/python3.6/site-packages/pywebpush/__init__.py", line 256, in send encoded = self.encode(data)
 File "/usr/local/lib/python3.6/site-packages/pywebpush/__init__.py", line 184, in encode version=content_encoding)
 File "/usr/local/lib/python3.6/site-packages/http_ece/__init__.py", line 375, in encrypt keyid=keyid, keylabel=keylabel)
 File "/usr/local/lib/python3.6/site-packages/http_ece/__init__.py", line 113, in derive_key keylabel=keylabel)
 File "/usr/local/lib/python3.6/site-packages/http_ece/__init__.py", line 78, in derive_dh pubkey = ec.EllipticCurvePublicKey.from_encoded_point(
 AttributeError: type object 'EllipticCurvePublicKey' has no attribute 'from_encoded_point'
html5 problem in dependency

Most helpful comment

Please try to manual upgrade cryptography via pip install cryptography==2.5

All 7 comments

Might be caused by web-push-libs/pywebpush#101

HA pinned cryptography==2.3.1 this from_encoded_point method moved to EllipticCurvePublicKey class at cryptography>=2.5

Please try to manual upgrade cryptography via pip install cryptography==2.5

That fixes the issue for me (same environment as @juan11perez )

I confirm manual upgrade cryptography via pip install cryptography==2.5 also fixes it for me.

It'd be great to have a fix for this in the "latest" Docker image, though. "rc" seems to already have moved on.

It'd be great to have a fix for this in the "latest" Docker image, though. "rc" seems to already have moved on.

You can fix the current image yourself:

docker exec -i -t <home assistant container name> /bin/bash
pip install cryptography==2.5
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sh0rez picture sh0rez  路  3Comments

aweb-01 picture aweb-01  路  3Comments

i-am-shodan picture i-am-shodan  路  3Comments

missedtheapex picture missedtheapex  路  3Comments

Elmardus picture Elmardus  路  3Comments