Blink integration stopped working and quits 2FA with unexpected error

My Blink integration stopped working all of a sudden. Trying to set it up again ends with an unexpected error after entering the verification PIN. This is what I do: I enter my credentials and receive the Blink mail afterwards. Entering the PIN just aborts the procedure with an error. This is what the log says:

Logger: homeassistant.components.blink.config_flow
Source: components/blink/config_flow.py:41
Integration: Blink (documentation, issues)
First occurred: 22:39:09 (1 occurrences)
Last logged: 22:39:09

Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/blink/config_flow.py", line 101, in async_step_2fa
    valid_token = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/blink/config_flow.py", line 41, in _send_blink_2fa_pin
    return auth.send_auth_key(blink, pin)
  File "/usr/local/lib/python3.8/site-packages/blinkpy/auth.py", line 236, in send_auth_key
    json_resp = response.json()
AttributeError: 'NoneType' object has no attribute 'json'

Logger: blinkpy.auth
Source: /usr/local/lib/python3.8/site-packages/blinkpy/auth.py:195
First occurred: 22:39:09 (1 occurrences)
Last logged: 22:39:09

Connection error. Endpoint https://rest-e001.immedia-semi.com/api/v4/account/xxxxx/client/xxxxxx/pin/verify possibly down or throttled.

I experienced similar issues from time to time in the past but setting up a fresh integration usually fixed it. But not this time.

I noticed that the integration didn’t work anymore after I moved my arm/disarm automations to node-red. While doing this I paid attention not to flood Blink’s servers with too many arm/disarm requests. Don’t know if this caused a blocking of my account? The Blink app is still working and I can control my cameras from it.

I’m pretty clueless right now and any help is much appreciated…

Home Assistant Version: core-2021 3.3, supervised on Debian

UPDATE:
I just forced a WAN IP refresh from my ISP by restarting my router and tried again to setup the Blink integration. This time I did not receive a mail from Blink with the authorization PIN and I just proceeded without it and it succeeded.

So all sensors and services are available now but the preview images are not loading. I have an automation for refreshing the preview images once an hour which is now working again as I can see it in the Blink app.

Home Assistant now generates every 5 seconds this log entry:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_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 129, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 496, in get
return await self.handle(request, camera)
File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 513, in handle
image = await camera.async_camera_image()
File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 382, in async_camera_image
return await self.hass.async_add_executor_job(self.camera_image)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/blink/camera.py", line 92, in camera_image
return self._camera.image_from_cache.content
AttributeError: 'NoneType' object has no attribute 'content'
1 Like

Ok, after upgrading Home Assistant to core-2021.3.4, deleting Blink and installing it again, everything works again as expected.

Still not sure what the root cause was… But it seems that upgrading to 2021.3.3 caused it as others also started reporting problems with Blink and 2021.3.3.

2 Likes

Thank you, did same and is working now :slight_smile:

Any tips you can share to get this fixed? I upgraded from 2021.3.2 to 2021.3.4 and have removed/readded Blink several times with various combinations of restarting core and the whole host to no avail.
I’m getting the same error:

Logger: aiohttp.server
Source: components/blink/camera.py:92
First occurred: 7:10:19 PM (11 occurrences)
Last logged: 7:10:29 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_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 129, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 496, in get
    return await self.handle(request, camera)
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 513, in handle
    image = await camera.async_camera_image()
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 382, in async_camera_image
    return await self.hass.async_add_executor_job(self.camera_image)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/blink/camera.py", line 92, in camera_image
    return self._camera.image_from_cache.content
AttributeError: 'NoneType' object has no attribute 'content'

Reinstall fixed it for me too, thanks!

Same problem with core-2021.3.4 upgrade. I deleted the Blink integration and tried to reinstall but can’t connect to my blink account. Any idea?

@smeloche same problem here. Anyone we can ping to put some fire under this?? I’m open to testing new/dev code fwiw.