Schnitzel/hass-miner

After HA Update to 11.5 doesn't load entity

Closed this issue · 2 comments

I can not load the miner entity after I update the whole HA System.

I updated to the lateat haas miner version 1.1.2 (somehow can not download older versions for testing, it does install everytime 1.1.2)

Here is the logfile:

2024-02-14 20:42:30.809 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up miner platform for sensor
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 117, in send_command
    raise e
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 111, in send_command
    return (await endpoint(message, metadata=metadata)).to_pydict()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/proto/braiins/bos/v1/__init__.py", line 1956, in get_active_performance_mode
    return await self._unary_unary(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/betterproto/grpc/grpclib_client.py", line 85, in _unary_unary
    response = await stream.recv_message()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/grpclib/client.py", line 425, in recv_message
    await self.recv_initial_metadata()
  File "/usr/local/lib/python3.12/site-packages/grpclib/client.py", line 393, in recv_initial_metadata
    self._raise_for_grpc_status(status, message, details)
  File "/usr/local/lib/python3.12/site-packages/grpclib/client.py", line 345, in _raise_for_grpc_status
    raise GRPCError(status, message, details)
grpclib.exceptions.GRPCError: (<Status.UNIMPLEMENTED: 12>, None, None)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/miner/coordinator.py", line 76, in _async_update_data
    miner_data = await self.miner.get_data(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/miners/base.py", line 474, in get_data
    gathered_data = await self._get_data(
                    ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/miners/base.py", line 403, in _get_data
    web_command_data = await web_command_task
                       ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 84, in multicommand
    await asyncio.gather(*list(tasks.values()))
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 378, in get_active_performance_mode
    return await self.send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 119, in send_command
    raise APIError(f"gRPC command failed - {endpoint}") from e
pyasic.errors.APIError: gRPC command failed - <bound method PerformanceServiceStub.get_active_performance_mode of <pyasic.web.braiins_os.boser.BOSMinerGRPCStub object at 0x7fa8107e89b0>>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/miner/coordinator.py", line 92, in _async_update_data
    raise UpdateFailed("API Error") from err
homeassistant.helpers.update_coordinator.UpdateFailed: API Error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/miner/sensor.py", line 133, in async_setup_entry
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 285, in async_config_entry_first_refresh
    raise ex
homeassistant.exceptions.ConfigEntryNotReady: API Error
2024-02-14 20:42:30.864 ERROR (MainThread) [homeassistant.components.switch] Error while setting up miner platform for switch
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 117, in send_command
    raise e
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 111, in send_command
    return (await endpoint(message, metadata=metadata)).to_pydict()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/proto/braiins/bos/v1/__init__.py", line 1956, in get_active_performance_mode
    return await self._unary_unary(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/betterproto/grpc/grpclib_client.py", line 85, in _unary_unary
    response = await stream.recv_message()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/grpclib/client.py", line 425, in recv_message
    await self.recv_initial_metadata()
  File "/usr/local/lib/python3.12/site-packages/grpclib/client.py", line 393, in recv_initial_metadata
    self._raise_for_grpc_status(status, message, details)
  File "/usr/local/lib/python3.12/site-packages/grpclib/client.py", line 345, in _raise_for_grpc_status
    raise GRPCError(status, message, details)
grpclib.exceptions.GRPCError: (<Status.UNIMPLEMENTED: 12>, None, None)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/miner/coordinator.py", line 76, in _async_update_data
    miner_data = await self.miner.get_data(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/miners/base.py", line 474, in get_data
    gathered_data = await self._get_data(
                    ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/miners/base.py", line 403, in _get_data
    web_command_data = await web_command_task
                       ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 84, in multicommand
    await asyncio.gather(*list(tasks.values()))
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 378, in get_active_performance_mode
    return await self.send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 119, in send_command
    raise APIError(f"gRPC command failed - {endpoint}") from e
pyasic.errors.APIError: gRPC command failed - <bound method PerformanceServiceStub.get_active_performance_mode of <pyasic.web.braiins_os.boser.BOSMinerGRPCStub object at 0x7fa8107e9610>>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/miner/coordinator.py", line 92, in _async_update_data
    raise UpdateFailed("API Error") from err
homeassistant.helpers.update_coordinator.UpdateFailed: API Error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/miner/switch.py", line 44, in async_setup_entry
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 285, in async_config_entry_first_refresh
    raise ex
homeassistant.exceptions.ConfigEntryNotReady: API Error
2024-02-14 20:42:30.897 ERROR (MainThread) [homeassistant.components.number] Error while setting up miner platform for number
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 117, in send_command
    raise e
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 111, in send_command
    return (await endpoint(message, metadata=metadata)).to_pydict()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/proto/braiins/bos/v1/__init__.py", line 1956, in get_active_performance_mode
    return await self._unary_unary(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/betterproto/grpc/grpclib_client.py", line 85, in _unary_unary
    response = await stream.recv_message()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/grpclib/client.py", line 425, in recv_message
    await self.recv_initial_metadata()
  File "/usr/local/lib/python3.12/site-packages/grpclib/client.py", line 393, in recv_initial_metadata
    self._raise_for_grpc_status(status, message, details)
  File "/usr/local/lib/python3.12/site-packages/grpclib/client.py", line 345, in _raise_for_grpc_status
    raise GRPCError(status, message, details)
grpclib.exceptions.GRPCError: (<Status.UNIMPLEMENTED: 12>, None, None)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/miner/coordinator.py", line 76, in _async_update_data
    miner_data = await self.miner.get_data(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/miners/base.py", line 474, in get_data
    gathered_data = await self._get_data(
                    ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/miners/base.py", line 403, in _get_data
    web_command_data = await web_command_task
                       ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 84, in multicommand
    await asyncio.gather(*list(tasks.values()))
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 378, in get_active_performance_mode
    return await self.send_command(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyasic/web/braiins_os/boser.py", line 119, in send_command
    raise APIError(f"gRPC command failed - {endpoint}") from e
pyasic.errors.APIError: gRPC command failed - <bound method PerformanceServiceStub.get_active_performance_mode of <pyasic.web.braiins_os.boser.BOSMinerGRPCStub object at 0x7fa810804ec0>>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/miner/coordinator.py", line 92, in _async_update_data
    raise UpdateFailed("API Error") from err
homeassistant.helpers.update_coordinator.UpdateFailed: API Error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/miner/number.py", line 29, in async_setup_entry
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 285, in async_config_entry_first_refresh
    raise ex
homeassistant.exceptions.ConfigEntryNotReady: API Error

miner

Please update your miner to the most recent version of braiins OS+, it seems like it's having issues with one of the endpoints. Try again once it's on the latest version, and if the issue persists I will recompile the gRPC proto files.

omg, yes thats it. Thank you!