Meraki errors

I’ve been using the Meraki device tracking platform for a while.
Since a while ago my log is filled with errors like this:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 381, in start
    resp = await self._request_handler(request)
  File "/usr/lib/python3.6/site-packages/aiohttp/web_app.py", line 322, in _handle
    resp = await handler(request)
  File "/usr/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 88, in impl
    return await handler(request)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/http/static.py", line 68, in staticresource_middleware
    return await handler(request)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 27, in real_ip_middleware
    return await handler(request)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 54, in auth_middleware
    return await handler(request)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 98, in handle
    result = await result
  File "/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/meraki.py", line 91, in post
    self._handle(request.app['hass'], data)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/meraki.py", line 98, in _handle
    lat = i["location"]["lat"]
TypeError: 'NoneType' object is not subscriptable

It seams to be working, but errors are anyoing.

Checking the code it looks like there should be a debug statement in the log that could help clarify what’s going on (assuming you have debug messages for this component enabled.) The message should have this text in it:

Meraki Data from Post:

Which should be followed by the JSON data. It looks like xxx in {"data": {"observations": xxx}} should be a valid list where each element of the list should have (at least) {"location": {"lat": <lat>, "lng": <lng>}}.

In any case, it would seem that sometimes the server isn’t responding with correct or complete data. I think this is somewhat common. I see similar issues sometimes with Life360, WeatherUnderground, etc. This meraky platform seems to have quite a bit of error checking, but apparently this is not something the platform writer was expecting.

Debug logging isn’t enabled.

logger:
  default: error
  logs:
    custom_components.emulated_roku: info
    urllib3: error

Well, if you’re interested in figuring out why you’re getting the errors, you might want to enable it, at least for this component.