8000 Tradfri configuration failed in HASSIO 0.57.2 on RPi3 · Issue #10499 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tradfri configuration failed in HASSIO 0.57.2 on RPi3 #10499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gysman opened this issue Nov 10, 2017 · 28 comments
Closed

Tradfri configuration failed in HASSIO 0.57.2 on RPi3 #10499

gysman opened this issue Nov 10, 2017 · 28 comments

Comments

@gysman
Copy link
gysman commented Nov 10, 2017

Version info:
Running HASSIO 0.57.2 on Raspberry PI3

Configuring TRADFRI lights after discovery fails. No visual feedback in UI. Only when checking home-assistant.log, I see the error reported below. This is a HASSIO installation without any configuration changed, apart from setting up SSH with keys, and Samba.

Expected:
HASSIO to accept security code and lights to show up.

(I'm aware of differences in i, l, 1 and o, O, 0. The entered security code is 100% correct. The result of an incorrect and a correct code differs. See testcases below).

Testcases

  • Entering incorrect code floods home-assistant.log. Again, with NO visual feedback in UI, with the result of filling up the SD card. (many many messages per second. )
  • Entering correct code results in single error below.

Additional info
Previously, I used HASSIO on RPi2, this worked flawlessly.

I also saw #10362. This concerned 0.57.1, and was closed. The solution in that issue was: "reset hub, and re-add all lights". This is an unworkable solution. I have many lights, and would not like to have to remove everything with every new release of hassio.

Steps to reproduce:

  1. install hassio on RPi2, configure lights -> working flawlessly.
  2. shutdown RPi2.
  3. install hassio on Rpi3. configure lights -> errors. See below.

Logs:
When entering INCORRECT security code:

2017-11-10 07:52:31 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2017-11-10 07:52:31 ERROR (MainThread) [coap] Fatal DTLS error: code 20
2017-11-10 07:52:31 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2017-11-10 07:52:31 ERROR (MainThread) [coap] Fatal DTLS error: code 20
2017-11-10 07:52:31 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2017-11-10 07:52:31 ERROR (MainThread) [coap] Fatal DTLS error: code 20
2017-11-10 07:52:31 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2017-11-10 07:52:31 ERROR (MainThread) [coap] Fatal DTLS error: code 20
2017-11-10 07:52:31 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2017-11-10 07:52:31 ERROR (MainThread) [coap] Fatal DTLS error: code 20
2017-11-10 07:52:31 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2017-11-10 07:52:31 ERROR (MainThread) [coap] Fatal DTLS error: code 20
2017-11-10 07:52:31 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.
2017-11-10 07:52:31 ERROR (MainThread) [coap] Fatal DTLS error: code 20
2017-11-10 07:52:31 ERROR (MainThread) [coap] Exception CancelledError() can not be represented as errno, setting -1.

When entering CORRECT security code:

2017-11-10 07:27:55 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/tasks.py", line 179, in _step
    result = coro.send(None)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/tradfri.py", line 66, in configuration_callback
    psk = yield from api_factory.generate_psk(callback_data.get('key'))
  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 193, in generate_psk
    self._psk = yield from self.request(command)
  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 149, in request
    result = yield from self._execute(api_commands)
  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 141, in _execute
    api_command.result = _process_output(res, parse_json)
  File "/usr/lib/python3.6/site-packages/pytradfri/command.py", line 71, in result
    self._result = self._process_result(value)
  File "/usr/lib/python3.6/site-packages/pytradfri/gateway.py", line 28, in process_result
    return result[ATTR_PSK]
TypeError: 'NoneType' object is not subscriptable
@atwright147
Copy link

I'm seeing the same error

@johanvanderkuijl
Copy link

Although I'm on a virtual env on the pi3, I experience the same. Maybe the logging helps to identify the problem:

File "/srv/hass3/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 193, in generate_psk
INFO:coap:Retransmission, Message ID: 18692.

@twentynine12
Copy link
twentynine12 commented Nov 10, 2017

I'm also on a pi3 and get the same error, been having the same issues for a couple of versions now:

2017-11-10 15:35:58 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/tasks.py", line 179, in _step
    result = coro.send(None)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/tradfri.py", line 66, in configuration_callback
    psk = yield from api_factory.generate_psk(callback_data.get('key'))
  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 193, in generate_psk
    self._psk = yield from self.request(command)
  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 149, in request
    result = yield from self._execute(api_commands)
  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 141, in _execute
    api_command.result = _process_output(res, parse_json)
  File "/usr/lib/python3.6/site-packages/pytradfri/command.py", line 71, in result
    self._result = self._process_result(value)
  File "/usr/lib/python3.6/site-packages/pytradfri/gateway.py", line 28, in process_result
    return result[ATTR_PSK]
TypeError: 'NoneType' object is not subscriptable

@flowolf
Copy link
Contributor
flowolf commented Nov 11, 2017

this issue is probably caused by a reuse of the (currently hardcoded) ID.
this would be fixed by pull/10414

the current workaround is, as stated, reset and repair.
another fix would be to migrate the .tradfri_psk.conf to a new install.

hth

@gysman
Copy link
Author
gysman commented Nov 11, 2017

Tried to transfer the backed up version of .tradfri_psk.conf, but no luck. Finally surrendered. Reset the hub, and re-added all the lights and reconfigured all groups.. Configured in HASSIO, and voila, up and running again. Hopefully a once in a lifetime! :)

@gysman
Copy link
Author
gysman commented Nov 13, 2017

Well..... this is getting annoying.... For some reason (don't know exactly how I did it, but it happened while changing the yaml files with previously backed up yaml file and restarting), I had the problem of the flooding home-assistant.log file again, resulting in an unusable homeassistant. So I re-installed the Pi3 with a fresh image and.... had to go through the very lenghty process of resetting the tradfri hub and re-adding all lights, because I had the initial error "TypeError: 'NoneType' object is not subscriptable" again, when entering the security code.

Please give me and others a fix for this. If this keeps happening, I'll be forced to leave Home Assistant, and I don't want to!

@jackiedaytonna
Copy link

Same issue here rpi3 - will try resetting g/w

@Cyberwizzard
Copy link
Cyberwizzard commented Nov 16, 2017

I have the same issue - no feedback from the GUI and the log shows:
TypeError: 'NoneType' object is not subscriptable

-When will this be fixed?-

I could of course have looked in the referenced pull request and see this:
"balloob merged commit 1e493dc into home-assistant:dev 2 days ago"

So the question is more: when will the dev branch be tagge 8000 d off again? :)

@KBrygger
Copy link

Same issue found at my setup. Even after resetting the gateway there's no way to add the security key. And log shows:

Error doing job: Task exception was never retrieved

etc.

Running Hassio on a newly installed RPi3.

Anyone know a fix?

@flowolf
Copy link
Contributor
flowolf commented Nov 18, 2017

#10630 (aka homeassistant 0.58) should fix that, will be released shortly. it has #10414 in it, which takes care of re-authentication with random IDs.
please try the new version, and report if that does/doesn't fix your issues.

@twentynine12
Copy link

A big thanks to everyone who got this fixed, working for me in 0.58.1.

@atwright147
Copy link

It's still a problem for me, sadly.

I just reinstalled Raspbian and then provisioned it with my Ansible repo: https://github.com/atwright147/raspbian-homeassistant

I am still getting the following error below. Am I missing something?

2017-11-26 16:50:38 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
    result = coro.throw(exc)
  File "/var/local/homeassistant/prod_venv/lib/python3.5/site-packages/homeassistant/core.py", line 1031, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/var/local/homeassistant/prod_venv/lib/python3.5/site-packages/homeassistant/components/configurator.py", line 224, in async_handle_service_call
    call.data.get(ATTR_FIELDS, {}))
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/var/local/homeassistant/prod_venv/lib/python3.5/site-packages/homeassistant/components/tradfri.py", line 74, in configuration_callback
    key = yield from api_factory.generate_psk(security_code)
  File "/var/local/homeassistant/prod_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 193, in generate_psk
    self._psk = yield from self.request(command)
  File "/var/local/homeassistant/prod_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 149, in request
    result = yield from self._execute(api_commands)
  File "/var/local/homeassistant/prod_venv/lib/python3.5/site-packages/pytradfri/api/aiocoap_api.py", line 141, in _execute
    api_command.result = _process_output(res, parse_json)
  File "/var/local/homeassistant/prod_venv/lib/python3.5/site-packages/pytradfri/command.py", line 71, in result
    self._result = self._process_result(value)
  File "/var/local/homeassistant/prod_venv/lib/python3.5/site-packages/pytradfri/gateway.py", line 28, in process_result
    return result[ATTR_PSK]
TypeError: 'NoneType' object is not subscriptable

@flowolf
Copy link
Contributor
flowolf commented Nov 27, 2017

@atwright147 I don't see any Tradfri config in your repo.
In case you are trying to configure the PSK in a config... don't! all you need is the gateway IP.

@atwright147
Copy link
atwright147 commented Nov 27, 2017

@flowolf I only use discovery (https://github.com/atwright147/raspbian-homeassistant/blob/master/data/config/configuration.yaml#L39)

I used to have a specific Tradfri section but discovery seemed to be able to find it, so I removed the Tradfri section.

Could using discovery be my issue?

@flowolf
Copy link
Contributor
flowolf commented Nov 27, 2017

don't think so.
maybe remove the .tradfri_psk.conf (only 0.58 and later). if wrong values are on there setup will not work.

@atwright147
Copy link
atwright147 commented Nov 27, 2017

@flowolf I do not have a .tradfri_psk.conf file.

HASS Version:

root@raspberrypi:/var/local/homeassistant/.homeassistant# cat .HA_VERSION
0.58.1

Here is my folder listing:

root@raspberrypi:/var/local/homeassistant/.homeassistant# ls -la
total 25224
drwxr-x--- 4 homeassistant homeassistant     4096 Nov 27 12:15 .
drwxr-xr-x 6 homeassistant homeassistant     4096 Nov 26 15:35 ..
-rw-r--r-- 1 homeassistant homeassistant        0 Nov 26 16:07 automations.yaml
-rw-r--r-- 1 homeassistant homeassistant     2952 Nov 26 15:36 configuration.yaml
-rw-r--r-- 1 homeassistant homeassistant        0 Nov 26 16:04 customize.yaml
drwxr-xr-x 2 homeassistant homeassistant     4096 Nov 26 16:10 deps
-rw-r--r-- 1 homeassistant homeassistant     1965 Nov 26 15:36 groups.yaml
-rw-r--r-- 1 homeassistant homeassistant        6 Nov 26 16:09 .HA_VERSION
-rw-r--r-- 1 homeassistant homeassistant     9549 Nov 27 12:09 home-assistant.log
-rw-r--r-- 1 homeassistant homeassistant 25632768 Nov 27 12:15 home-assistant_v2.db
-rw-r--r-- 1 homeassistant homeassistant     1122 Nov 26 16:11 options.xml
-rw-r--r-- 1 homeassistant homeassistant    96008 Nov 27 10:15 OZW_Log.txt
-rw-r--r-- 1 homeassistant homeassistant    32768 Nov 26 16:11 pyozw.sqlite
-rw-r--r-- 1 homeassistant homeassistant        0 Nov 26 16:09 scripts.yaml
-rw-r--r-- 1 homeassistant homeassistant      245 Nov 26 15:36 secrets.yaml
-rw-r--r-- 1 homeassistant homeassistant      190 Nov 26 15:36 security-zones.yaml
drwxr-xr-x 2 homeassistant homeassistant     4096 Nov 26 16:11 tts
-rw-r--r-- 1 homeassistant homeassistant       44 Nov 26 16:12 .uuid

Thank you for helping :)

@flowolf
Copy link
Contributor
flowolf commented Nov 27, 2017

I'd try adding the gateway explicitly with the IP.
also make sure all dependencies are up to date. (pytradfri, etc)

@atwright147
Copy link

I told discovery to ignore ikea_tradfri and added the Tradfri host specifically, but it made no difference.

@flowolf
Copy link
Contributor
flowolf commented Nov 29, 2017

Don't know what the issue could be, maybe try asking in the discord chat.

@nickschot
Copy link

Was this ever solved? I'm still seeing this with Hassio 0.60

@Cyberwizzard
Copy link
Cyberwizzard commented Dec 24, 2017 via email

@atwright147
Copy link

I just wiped the SD card and switched to HASS.io and I am still seeing the same issue. I even have a new router now :(

In HASS.io how would I go about running pytradri manually?

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@alillelund
Copy link

Still receiving errors on HA 0.64.3:
Exception CancelledError() can not be represented as errno, setting -1.
13:36 core.py (ERROR)
Fatal DTLS error: code 20
13:36 core.py (ERROR)

@alillelund
Copy link
alillelund commented Mar 4, 2018
2018-03-04 13:34:55 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall configurator.configure: configure_id=1896452784-1, fields=security_code=NTgmT4QhmJgIhzZk>
Traceback (most recent call last):

  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1010, in _event_to_service_call
    yield from service_handler.func(service_call)

  File "/usr/lib/python3.6/site-packages/homeassistant/components/configurator.py", line 224, in async_handle_service_call
    call.data.get(ATTR_FIELDS, {}))

  File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.

  File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()

  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception

  File "/usr/lib/python3.6/asyncio/tasks.py", line 182, in _step
    result = coro.throw(exc)

  File "/usr/lib/python3.6/site-packages/homeassistant/components/tradfri.py", line 70, in configuration_callback
    key = yield from api_factory.generate_psk(security_code)

  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 196, in generate_psk
    self._psk = yield from self.request(command)

  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 152, in request
    result = yield from self._execute(api_commands)

  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 142, in _execute
    _, res = yield from self._get_response(msg)

  File "/usr/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 92, in _get_response
    r = yield from pr.response

  File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.

  File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()

  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception

  File "/usr/lib/python3.6/site-packages/aiocoap/protocol.py", line 816, in _run_outer
    yield from cls._run(app_request, response, weak_observation, protocol, log, exchange_monitor_factory)

  File "/usr/lib/python3.6/site-packages/aiocoap/protocol.py", line 865, in _run
    blockresponse = yield from blockrequest.response

  File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.

  File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()

  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception

OSError: [Errno -1] No error information

@ktpx
Copy link
ktpx commented Apr 20, 2018

I have this issue as well after I reset my gateway, highly annoying as most my lights are IKEA: I dont see why we cant bypass the whole UI config, .bring back the API config setting . Im running 0.67.1

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@balloobbot
Copy link

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

0