Hive integration error - "Unknown error occurred."

Hi all

A week ago I migrated from HomeSeer to HA and, so far, things have been amazing.

I have 2 issues currently, one of which I was hoping to get some assistance with.

When trying to logon to the Hive integration using my username/email and password I get an error stating: “Unknown error occurred.”

I use 2FA. Following inserting my credentials, the integration then asks for my 2FA code. After this it comes up with the error. The same error appears if I disable 2FA; only this time it will come immediately after inserting username/password.

If I type the wrong credentials for username/password/2FA, I get an “incorrect login details” error, suggesting to me my credentials are correct. Moreover, I am able to login to Hive using other devices using these credentials without any issue.

I have seen similar issues with this integration highlighted on these forums - over a year ago now. Temporary workaround was to install the HACS Hive integration. This doesn’t work for me either - I just get the same error as above. Furthermore, updates in the older posts suggest that the integration was fixed, making me think this is a new issue.

The log shows an error, details as follows:

Logger: aiohttp.server
Source: components/hive/config_flow.py:108
First occurred: 10:18:06 (2 occurrences)
Last logged: 10:55:52

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 220, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 205, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 109, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 260, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 335, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/hive/config_flow.py", line 93, in async_step_2fa
    return await self.async_setup_hive_entry()
  File "/usr/src/homeassistant/homeassistant/components/hive/config_flow.py", line 108, in async_setup_hive_entry
    await self.hive_auth.device_registration("Home Assistant")
  File "/usr/local/lib/python3.9/site-packages/apyhiveapi/api/hive_auth_async.py", line 460, in device_registration
    await self.confirm_device(device_name)
  File "/usr/local/lib/python3.9/site-packages/apyhiveapi/api/hive_auth_async.py", line 480, in confirm_device
    result = await self.loop.run_in_executor(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 391, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 705, in _make_api_call
    http, parsed_response = self._make_request(
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 725, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 104, in make_request
    return self._send_request(request_dict, operation_model)
  File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 134, in _send_request
    request = self.create_request(request_dict, operation_model)
  File "/usr/local/lib/python3.9/site-packages/botocore/endpoint.py", line 117, in create_request
    self._event_emitter.emit(event_name, request=request,
  File "/usr/local/lib/python3.9/site-packages/botocore/hooks.py", line 357, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/hooks.py", line 228, in emit
    return self._emit(event_name, kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/hooks.py", line 211, in _emit
    response = handler(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/signers.py", line 93, in handler
    return self.sign(operation_name, request)
  File "/usr/local/lib/python3.9/site-packages/botocore/signers.py", line 165, in sign
    auth.add_auth(request)
  File "/usr/local/lib/python3.9/site-packages/botocore/auth.py", line 378, in add_auth
    raise NoCredentialsError()
botocore.exceptions.NoCredentialsError: Unable to locate credentials

My setup:
HA OS installed on ESXi - 2 vCPUs, 30gb HDD and 4gb RAM - updated to latest version (core 22.6.5, sv 22.5.3 and os 8.1)
My integrations include BMW, deconz, google cast, HACS, printer, harmony hub, phones (companion app), twinkly and unifi.

Any help would be appreciated. Many thanks in advance.

2022-06-14

This error was resolved in the 22.6.6 core update

1 Like

Hi there
I seem to be having exactly the same problem - same ‘Unknown Error Occurred’ on trying to enter the 2FA code - but am already on 2022.6.7 core.
Any thoughts anyone?
Many thanks

There seemed to be an issue with gmail earlier this year, so I changed the email address associated with my Hive account, and got it working again. But a month or so ago the Hive integration stopped working again:
I reinstalled the integration.
I restarted the pi running HA.
Still no joy.
Error logs indicate it’s a problem trying to REFRESH_TOKEN, invalid type for AuthParameters.
Is this the same problem that the 22.6.6 core update addresses?

Just updated to the latest version of Hive integration and all is fixed - installed and working - thanks!

Can I ask, how did you update to the latest version of the integration if it’s built in to Home Assistant now?

I’m using -

Home Assistant 2022.7.0
Supervisor 2022.07.0
Operating System 8.2
Frontend 20220706.0 - latest

I’m not 100% sure - I think I had originally installed mine from HACS, and I just went to ‘give it another go’ yesterday and reinstall when it came up with a warning that there was a newer version available, and did I want to update. I did, and it all fell into place.
Sorry I can’t be more specific!

No problem, I think I still had some old integration parts left over, had a cleanup and a reboot, it detected it again automatically and this time added successfully. Thanks!