Skip to content
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

Task exception in device tracker #27257

Closed
AbDhops opened this issue Oct 6, 2019 · 12 comments · Fixed by #30210
Closed

Task exception in device tracker #27257

AbDhops opened this issue Oct 6, 2019 · 12 comments · Fixed by #30210

Comments

@AbDhops
Copy link

AbDhops commented Oct 6, 2019

Home Assistant release with the issue:
99.1

Last working Home Assistant release (if known):
Unknown

Operating environment (Hass.io/Docker/Windows/etc.): Docker

Integration: https://www.home-assistant.io/integrations/device_tracker/

Description of problem:
Several warnings in Home Assistant log file "Error doing job: Task exception was never retrieved"

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

- platform: fritz
  host: !secret fritz_add
  username: !secret ha_fritz_ID
  password: !secret ha_fritz_PW
  interval_seconds: 10
  consider_home: 180
  new_device_defaults:
    track_new_devices: true

Traceback (if applicable):

2019-10-06 15:19:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py", line 164, in async_device_tracker_scan
    found_devices = await scanner.async_scan_devices()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/fritz/device_tracker.py", line 69, in scan_devices
    self._update_info()
  File "/usr/src/homeassistant/homeassistant/components/fritz/device_tracker.py", line 89, in _update_info
    self.last_results = self.fritz_box.get_hosts_info()
  File "/usr/local/lib/python3.7/site-packages/fritzconnection/fritzhosts.py", line 80, in get_hosts_info
    'ip': host['NewIPAddress'],
KeyError: 'NewIPAddress'

Additional information:

@mayank-budhiraja

This comment has been minimized.

@AbDhops
Copy link
Author

AbDhops commented Oct 26, 2019

Issue also exist in 0.100.2

@AbDhops
Copy link
Author

AbDhops commented Nov 1, 2019

Issue also exist in Home Assistant 0.101.1

@veloc1ty
Copy link

veloc1ty commented Nov 5, 2019

Issue exists in 0.101.2 as well

Has anyone found a workaround for this yet?

@Martinvdm
Copy link

same issue, only when starting HA as it look likes

@mammuth
Copy link
Contributor

mammuth commented Nov 17, 2019

The used version of the underlying library fritzconnection was recently updated which might have reintroduced this issue? According to the references issue this problem isn't new but seems to have been reappeared recently?

I just checked it, the library was updated after this issue was created. So it might be unrelated. (#27699)

@AbDhops
Copy link
Author

AbDhops commented Nov 19, 2019

If it helps, I am using FritzConnection version 0.8.4....

@Pirol62
Copy link

Pirol62 commented Nov 25, 2019

After having no problems in 101.x the error reappered massive after the update on 102.1

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py", line 164, in async_device_tracker_scan
    found_devices = await scanner.async_scan_devices()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/fritz/device_tracker.py", line 68, in scan_devices
    self._update_info()
  File "/usr/src/homeassistant/homeassistant/components/fritz/device_tracker.py", line 88, in _update_info
    self.last_results = self.fritz_box.get_hosts_info()
  File "/usr/local/lib/python3.7/site-packages/fritzconnection/fritzhosts.py", line 73, in get_hosts_info
    'ip': host['NewIPAddress'],
KeyError: 'NewIPAddress'

69 Times since 00:42
I did not restart HA at that time, was sleeping ;-)

Btw: my wife's got a new phone last week. I activated device tracking for it.

@basdelfos
Copy link
Contributor

I had the same issue with my main HA instance reporting this 'NewIPAddress' error.
Today I managed to replicate the error in a HA dev environment. After upgrading the fritzconnection component to version 1.0.1 the error doesn't occur any more. Seems that in one of the latest version of this component this issue has been fixed.

I will post a PR in the coming day with the fix. Some imports has to be fixed as the component's project structure changed between versions.

@AbDhops
Copy link
Author

AbDhops commented Dec 26, 2019

It seems updating to new fritzconnection does resolve the problem. We shall raise the bug (or move this one) to update the docker image.

@AbDhops
Copy link
Author

AbDhops commented Dec 27, 2019

Bad news... over the night, issue occurred more many times... So updating the fritzconnection, doesn't resolve the issue for me.

2019-12-27 10:41:35 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py", line 164, in async_device_tracker_scan
    found_devices = await scanner.async_scan_devices()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/fritz/device_tracker.py", line 68, in scan_devices
    self._update_info()
  File "/usr/src/homeassistant/homeassistant/components/fritz/device_tracker.py", line 88, in _update_info
    self.last_results = self.fritz_box.get_hosts_info()
  File "/usr/local/lib/python3.7/site-packages/fritzconnection/fritzhosts.py", line 73, in get_hosts_info
    'ip': host['NewIPAddress'],
KeyError: 'NewIPAddress'

@AbDhops
Copy link
Author

AbDhops commented Dec 30, 2019

is there any way, to disable these errors (using configuration) from the log file ? I made below configuration but without help...

logger:
  default: error
  logs:
    fritzconnection: fatal

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

Successfully merging a pull request may close this issue.

8 participants