Device tracker not working in 28.2

After I upgraded to 0.28.2 My device tracker seems to not be working anymore. The log posts the following error:

16-09-22 23:17:04 homeassistant.bootstrap: Error during setup of component device_tracker
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/bootstrap.py”, line 102, in _setup_component
result = component.setup(hass, config)
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 125, in setup
devices = load_config(yaml_path, hass, consider_home)
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 409, in load_config
for dev_id, device in load_yaml_config_file(path).items()]
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 409, in
for dev_id, device in load_yaml_config_file(path).items()]

Basic rebooting and reinstalling the update doesnt seem to fix the issue and I’m not sure where to go from here.

Has anyone else experienced this?

You’ve cut off the error which is either in the few lines above or below your log.

My bad, try this one:

16-09-22 23:17:04 homeassistant.bootstrap: Error during setup of component device_tracker
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/bootstrap.py”, line 102, in _setup_component
result = component.setup(hass, config)
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 125, in setup
devices = load_config(yaml_path, hass, consider_home)
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 409, in load_config
for dev_id, device in load_yaml_config_file(path).items()]
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 409, in
for dev_id, device in load_yaml_config_file(path).items()]
AttributeError: ‘NoneType’ object has no attribute ‘get’

It seems that your known_devices.yaml is not valid. By any chance, do you have a line that ends with a semicolon in there. Like hello: ?

I’ve added a pivotal story to generate a better error in the future :thumbsup:

https://www.pivotaltracker.com/story/show/131050419

2 Likes

I think the same thing happened to me after a recent update (probably 0.28). The issue was caused by a new known device which had square brackets in its name. I fixed it by putting double quotes around the name (something I always do, no matter the entity).

Thank you both for your advice!

So it appears that a new device (Apple Watch… I always figured they had some sort of wifi in them) did cause the issue because it was only defined, but non of the entities were listed or populated.

I added the MAC address, the name, and visibility and tracking options and rebooted the server. That seemed to have worked well, although it took a really long time for HA to start back up. the log file now lists this:

16-09-25 22:30:42 homeassistant.components.device_tracker: Error setting up platform nmap_tracker
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 137, in setup_platform
scanner = platform.get_scanner(hass, {DOMAIN: p_config})
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/device_tracker/nmap_tracker.py”, line 37, in get_scanner
scanner = NmapDeviceScanner(config[DOMAIN])
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/device_tracker/nmap_tracker.py”, line 68, in init
self.success_init = self._update_info()
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/util/init.py”, line 296, in wrapper
result = method(*args, **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/device_tracker/nmap_tracker.py”, line 130, in _update_info
mac = info[‘addresses’].get(‘mac’) or _arp(ipv4)
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/homeassistant/components/device_tracker/nmap_tracker.py”, line 47, in _arp
arp = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py”, line 947, in init
restore_signals, start_new_session)
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py”, line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: ‘arp’
16-09-25 22:32:32 homeassistant.core: WorkerPool:All 16 threads are busy and 49 jobs pending
16-09-25 22:32:32 homeassistant.core: WorkerPool:All 24 threads are busy and 73 jobs pending
16-09-25 22:32:32 homeassistant.core: WorkerPool:All 25 threads are busy and 76 jobs pending
16-09-25 22:32:32 homeassistant.core: WorkerPool:All 25 threads are busy and 151 jobs pending

Thoughts?

So keeping an eye on this it seems as if iCloud is the only device tracking system as it doesn’t seem to want to load NMAP (see the error above). I’ve tried reinstalling NMAP on the Mac but that doesn’t seem to solve the issue.