Silvenga / unifi-udm-api-proxy

A compatibility shim to support accessing the new UnifiOs API.
MIT License
11 stars 5 forks source link

'Response' object has no attribute 'status' #12

Closed Veldkornet closed 4 years ago

Veldkornet commented 4 years ago

My docker container automatically updated this morning to 1.4.0, but for some reason everything stopped working...

The below is from the HomeAssistant log.

2020-03-21 13:12:07 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 123, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 492, in get
    return await self.handle(request, camera)
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 509, in handle
    image = await camera.async_camera_image()
  File "/config/custom_components/unifiprotect/camera.py", line 165, in async_camera_image
    last_image = self.upv_object.get_snapshot_image(self._camera_id)
  File "/config/custom_components/unifiprotect/unifi_protect_server.py", line 270, in get_snapshot_image
    access_key = self._get_api_access_key()
  File "/config/custom_components/unifiprotect/unifi_protect_server.py", line 97, in _get_api_access_key
    "Request failed: %s - Reason: %s" % (response.status, response.reason)
AttributeError: 'Response' object has no attribute 'status'
Silvenga commented 4 years ago

Can you try to restart Home-Assistant? I think this is related to https://github.com/Silvenga/unifi-udm-api-proxy/issues/6.

Veldkornet commented 4 years ago

I had tried that before, and it didn’t work...

However, I restarted the container now, then I noticed that there’s another update for HA (0.107.4) so I did that too, and after all if that, it all seems to be okay.

False alarm it seems 👍