Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to call config on S9 After upgrade to HA 2025.1 #466

Open
puregame opened this issue Jan 4, 2025 · 31 comments
Open

Failed to call config on S9 After upgrade to HA 2025.1 #466

puregame opened this issue Jan 4, 2025 · 31 comments

Comments

@puregame
Copy link

puregame commented Jan 4, 2025

Version of the custom_component

hass-miner version 1.1.21

Configuration

Add your logs here.

Describe the bug

After upgrading to 2025.1 hass-miner integraiton broke witht eh following debug logs. Nothing changed in the setup other than upgrading to HA 2025.1

Debug log


This error originated from a custom integration.

Logger: custom_components.miner.coordinator
Source: custom_components/miner/coordinator.py:91
integration: HASS-miner (documentation, issues)
First occurred: 8:35:59 AM (167 occurrences)
Last logged: 10:21:18 AM

Failed to call config on S9 (BOS+): 192.168.xx.xx while getting data.
Failed to call config on S9 (BOS+): 192.168.xx.xx while getting data.
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/pyasic/miners/base.py", line 525, in _get_data
    miner_data[data_name] = await function(**args_to_send)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyasic/miners/backends/braiins_os.py", line 187, in get_config
    cfg = MinerConfig.from_bosminer(toml_data)
  File "/usr/local/lib/python3.13/site-packages/pyasic/config/__init__.py", line 221, in from_bosminer
    pools=PoolConfig.from_bosminer(toml_conf),
          ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyasic/config/pools.py", line 553, in from_bosminer
    return cls(groups=[PoolGroup.from_bosminer(g) for g in toml_conf["group"]])
                       ~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/local/lib/python3.13/site-packages/pyasic/config/pools.py", line 365, in from_bosminer
    return cls(
        name=toml_group_conf["name"],
        quota=toml_group_conf.get("quota"),
        pools=[Pool.from_bosminer(p) for p in toml_group_conf["pool"]],
    )
  File "/usr/local/lib/python3.13/site-packages/pydantic/main.py", line 214, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for PoolGroup
quota
  Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.10/v/int_type

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

Traceback (most recent call last):
  File "/config/custom_components/miner/coordinator.py", line 91, in _async_update_data
    miner_data = await self.miner.get_data(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<13 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pyasic/miners/base.py", line 568, in get_data
    gathered_data = await self._get_data(
                    ^^^^^^^^^^^^^^^^^^^^^
        allow_warning=allow_warning, include=include, exclude=exclude
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pyasic/miners/base.py", line 527, in _get_data
    raise APIError(
        f"Failed to call {data_name} on {self} while getting data."
    ) from e
pyasic.errors.APIError: Failed to call config on S9 (BOS+): 192.168.xx.xx while getting data.

@puregame
Copy link
Author

puregame commented Jan 4, 2025

Issue solved, my miners had nothing in the "pool groups" > "Quota" > "Value" field. Added an integer of 1 to each and the integration works.

image

@puregame puregame closed this as completed Jan 4, 2025
@b-rowan
Copy link
Collaborator

b-rowan commented Jan 4, 2025

Interesting. That might still be a bug, I'll have to look at it on an S9...

@86codyharris
Copy link

I've got the same issue with new miners on my system (S9&T19) S19j's unaffected although i was experiencing this problem before upgrading to 2025.1 and the problem still exists with 2025.1.

@86codyharris
Copy link

86codyharris commented Jan 4, 2025

My S19j's are on an older Braiins version 24.09-plus. One of my S9's i still working Braiins version 21.09.3-plus. The S9 that isn't working is version 22.08.1-plus. And the T19 that isn't working is on Braiins 24.09.1-plus, I've also tried latest release with no luck.

@86codyharris
Copy link

This error originated from a custom integration.

Logger: custom_components.miner.coordinator
Source: custom_components/miner/coordinator.py:91
integration: HASS-miner (documentation, issues)
First occurred: 11:29:00 AM (10 occurrences)
Last logged: 11:30:20 AM

Failed to call config on T19 (BOS+): 192.168.1.240 while getting data.
Failed to call config on S9 (BOS+): 192.168.1.182 while getting data.
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/pyasic/miners/base.py", line 525, in _get_data
miner_data[data_name] = await function(**args_to_send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/pyasic/miners/backends/braiins_os.py", line 800, in get_config
return MinerConfig.from_boser(grpc_conf)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/pyasic/config/init.py", line 230, in from_boser
return cls(
pools=PoolConfig.from_boser(grpc_miner_conf),
...<2 lines>...
temperature=TemperatureConfig.from_boser(grpc_miner_conf),
)
File "/usr/local/lib/python3.13/site-packages/pydantic/main.py", line 214, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 3 validation errors for MinerConfig
fan_mode.FanModeNormal
Input should be a valid dictionary or instance of FanModeNormal [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.10/v/model_type
fan_mode.FanModeManual
Input should be a valid dictionary or instance of FanModeManual [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.10/v/model_type
fan_mode.FanModeImmersion
Input should be a valid dictionary or instance of FanModeImmersion [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.10/v/model_type

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

Traceback (most recent call last):
File "/config/custom_components/miner/coordinator.py", line 91, in _async_update_data
miner_data = await self.miner.get_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^
...<13 lines>...
)
^
File "/usr/local/lib/python3.13/site-packages/pyasic/miners/base.py", line 568, in get_data
gathered_data = await self._get_data(
^^^^^^^^^^^^^^^^^^^^^
allow_warning=allow_warning, include=include, exclude=exclude
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/site-packages/pyasic/miners/base.py", line 527, in _get_data
raise APIError(
f"Failed to call {data_name} on {self} while getting data."
) from e
pyasic.errors.APIError: Failed to call config on T19 (BOS+): 192.168.1.240 while getting data.

@b-rowan b-rowan reopened this Jan 4, 2025
@b-rowan
Copy link
Collaborator

b-rowan commented Jan 4, 2025

@86codyharris Can you try updating to hass-miner v1.1.21? I feel like I fixed that bug a while ago in pyasic, but possible im worng...

@b-rowan
Copy link
Collaborator

b-rowan commented Jan 4, 2025

Nevermind, its a new bug. Should be fixed with 1.1.22rc1, try the beta out.

@86codyharris
Copy link

I don't know how to push an update in hass-miner. I've got the zip file from GitHub, but don't know how to install

@b-rowan
Copy link
Collaborator

b-rowan commented Jan 4, 2025

You should be able to do it though hacs, click reinstall and click allow beta versions

@Ben-in-Chicago
Copy link

Also have the same issue, but the latest version of HACS isn't showing as available to install either.

@b-rowan
Copy link
Collaborator

b-rowan commented Jan 6, 2025

Also have the same issue, but the latest version of HACS isn't showing as available to install either.

Shouldn't need to update HACS, go into the HACS sidebar menu, click miner, dots top left, update information, redownload, click allow beta versions, select v1.1.22rc1, install.

@Ben-in-Chicago
Copy link

HACS isn't available right now to do that. For some reason, it broke on mine with the 2025.1 upgrade:

image

@86codyharris
Copy link

86codyharris commented Jan 7, 2025

I updated HA Core to 2025.1.1 this morning(hass-miner v1.1.22rc1) and everything broke.

I reverted back to HA Core 2025.1.0 and hass-miner v1.1.20 and my three main miners are back online

@b-rowan
Copy link
Collaborator

b-rowan commented Jan 7, 2025

Can you send the result of ssh root@MINER_IP "cat /etc/bosminer.toml" @Duffy2222? Want to see if I can figure out what part of the config is failing, I haven't had this issue with my S9...

Just run that command in command prompt or terminal or whatever.

@Duffy2222
Copy link

Can you send the result of ssh root@MINER_IP "cat /etc/bosminer.toml" @Duffy2222? Want to see if I can figure out what part of the config is failing, I haven't had this issue with my S9...

Thanks, @b-rowan.
I deleted my post, because I solved the issue by myself.
Seeing the log posted here, the URL for help has highlighted and then I saw my fault.
I needed to set a value in 'Quota' for pool groups in my miner configuration.
It was showing the value '1' but this was geyed out.
By editing the pool-groups, setting a quota to '1' the issue was solved for me:
grafik

@b-rowan
Copy link
Collaborator

b-rowan commented Jan 7, 2025

Ok cool. I'll see if I can replicate that and then I can fix it. Should prevent it in the future.

@b-rowan
Copy link
Collaborator

b-rowan commented Jan 7, 2025

Can you send the result of ssh root@MINER_IP "cat /etc/bosminer.toml" @Duffy2222? Want to see if I can figure out what part of the config is failing, I haven't had this issue with my S9...

Thanks, @b-rowan. I deleted my post, because I solved the issue by myself. Seeing the log posted here, the URL for help has highlighted and then I saw my fault. I needed to set a value in 'Quota' for pool groups in my miner configuration. It was showing the value '1' but this was geyed out. By editing the pool-groups, setting a quota to '1' the issue was solved for me: grafik

This should be fixed in 1.1.22rc2, so hopefully no more issues there.

@b-rowan
Copy link
Collaborator

b-rowan commented Jan 7, 2025

I updated HA Core to 2025.1.1 this morning(hass-miner v1.1.22rc1) and everything broke.

I reverted back to HA Core 2025.1.0 and hass-miner v1.1.20 and my three main miners are back online

Going to test latest hass in dev environment and see what I can find.

@Duffy2222
Copy link

Duffy2222 commented Jan 7, 2025

Can you send the result of ssh root@MINER_IP "cat /etc/bosminer.toml" @Duffy2222? Want to see if I can figure out what part of the config is failing, I haven't had this issue with my S9...

Thanks, @b-rowan. I deleted my post, because I solved the issue by myself. Seeing the log posted here, the URL for help has highlighted and then I saw my fault. I needed to set a value in 'Quota' for pool groups in my miner configuration. It was showing the value '1' but this was geyed out. By editing the pool-groups, setting a quota to '1' the issue was solved for me: grafik

This should be fixed in 1.1.22rc2, so hopefully no more issues there.

@b-rowan : this wasn't fixed by just installing 1.1.22rc2. It's only running by additionally setting the value of 'quota' in the pool group config of my miner to '1'.
Or maybe both needs to be done to get it running. ;-)
Many thanks for your support here!

@Ben-in-Chicago
Copy link

FYI my S9 has been set to Quota 1 for 'a long time'. I'm using HACS 2.0.1 and HASS-miner 1.1.20. As I'm using Home Assistant Green, I cannot figure out how to update the versions as HAOS does not show any new updates available (as it normally does).

@neutrino220
Copy link

neutrino220 commented Jan 8, 2025

Miner: v1.1.22rc2
HA Version: 2025.1.1
Pool Group Name: Default, Mode: Quota, Value: 1 is set but HASS-Miner Integration is already not working.

It worked with v1.1.21 and HA Version: 2025.1.1 for about 20 Hours after entering Value 1.
But this morning i've tried to start my Miner and all Pool Configuration was deleted from my S9.

After reconfigureing Pool-Group and Pool URL's, the S9 starts Mining but Homeassistant cannot load the HASS-Miner Integration.

No I've tried v1.1.22rc2 but it is not working too.


Dieser Fehler stammt von einer benutzerdefinierten Integration

Logger: custom_components.miner.coordinator
Quelle: custom_components/miner/coordinator.py:97
Integration: Miner (Dokumentation, Probleme)
Erstmals aufgetreten: 13:45:45 (3 Vorkommnisse)
Zuletzt protokolliert: 13:46:02

Failed to call config on S9 (BOS+): 10.220.0.140 while getting data.
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/pyasic/miners/base.py", line 525, in _get_data
miner_data[data_name] = await function(**args_to_send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/pyasic/miners/backends/braiins_os.py", line 187, in get_config
cfg = MinerConfig.from_bosminer(toml_data)
File "/usr/local/lib/python3.13/site-packages/pyasic/config/init.py", line 220, in from_bosminer
return cls(
pools=PoolConfig.from_bosminer(toml_conf),
...<2 lines>...
temperature=TemperatureConfig.from_bosminer(toml_conf),
)
File "/usr/local/lib/python3.13/site-packages/pydantic/main.py", line 214, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 8 validation errors for MinerConfig
mining_mode.MiningModeNormal
Input should be a valid dictionary or instance of MiningModeNormal [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.10/v/model_type
mining_mode.MiningModeHPM
Input should be a valid dictionary or instance of MiningModeHPM [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.10/v/model_type
mining_mode.MiningModeLPM
Input should be a valid dictionary or instance of MiningModeLPM [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.10/v/model_type
mining_mode.MiningModeSleep
Input should be a valid dictionary or instance of MiningModeSleep [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.10/v/model_type
mining_mode.MiningModeManual
Input should be a valid dictionary or instance of MiningModeManual [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.10/v/model_type
mining_mode.MiningModePowerTune
Input should be a valid dictionary or instance of MiningModePowerTune [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.10/v/model_type
mining_mode.MiningModeHashrateTune
Input should be a valid dictionary or instance of MiningModeHashrateTune [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.10/v/model_type
mining_mode.MiningModePreset
Input should be a valid dictionary or instance of MiningModePreset [type=model_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.10/v/model_type

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

Traceback (most recent call last):
File "/config/custom_components/miner/coordinator.py", line 97, in _async_update_data
miner_data = await self.miner.get_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^
...<13 lines>...
)
^
File "/usr/local/lib/python3.13/site-packages/pyasic/miners/base.py", line 568, in get_data
gathered_data = await self._get_data(
^^^^^^^^^^^^^^^^^^^^^
allow_warning=allow_warning, include=include, exclude=exclude
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/site-packages/pyasic/miners/base.py", line 527, in _get_data
raise APIError(
f"Failed to call {data_name} on {self} while getting data."
) from e
pyasic.errors.APIError: Failed to call config on S9 (BOS+): 10.220.0.140 while getting data.

@neutrino220
Copy link

neutrino220 commented Jan 8, 2025

Can you send the result of ssh root@MINER_IP "cat /etc/bosminer.toml" @Duffy2222? Want to see if I can figure out what part of the config is failing, I haven't had this issue with my S9...

Just run that command in command prompt or terminal or whatever.

Here it is:

cat /etc/bosminer.toml

[format]
version = '2.0'
model = 'Antminer S9'
generator = 'BOSer (boser-openwrt 0.1.0-26ba61b9)'
timestamp = 1736341485

[[group]]
name = 'Default'
quota = 1

[[group.pool]]
enabled = true
url = 'stratum2+tcp://MYSTRATUM2/SOMEID'
user = 'user.worker'
password = 'somepassword'

[[group.pool]]
enabled = true
url = 'stratum+tcp://MYSTRATUM:1234'
user = 'user.worker'
password = 'somepassword'

[autotuning]
enabled = true
power_target = 400

@Haifisch999
Copy link

Hey,

I had the same problem with the "Quota" split.
I had set a 1 for “Quota” and also a “Fixed share ratio” in another group. In this combination it no longer works, I have now set everything via "Quota" and then the addon runs again.

@b-rowan
Copy link
Collaborator

b-rowan commented Jan 8, 2025

Hey,

I had the same problem with the "Quota" split. I had set a 1 for “Quota” and also a “Fixed share ratio” in another group. In this combination it no longer works, I have now set everything via "Quota" and then the addon runs again.

AFAIU these should not be combined anyway, not sure if it i implemented on the backend properly (especially on a device as old as the S9, latest BOS+ version is 22.08.1). Quota takes sum(quota) and will then divide out by the quota of any given group, where fixed share ration will output as a % directly.

@neutrino220
Copy link

Can anyone share his (anonymized) /etc/bosminer.toml please?
I think mine is corrupted or something important for HA-Miner is missing. A file from a S9 with BOS+ will be great

@b-rowan
Copy link
Collaborator

b-rowan commented Jan 8, 2025

[temp_control]
mode = "auto"

[fan_control]
min_fans = 1

[autotuning]
enabled = true
mode = "power_target"
power_target = 900

[[group]]
name = "group1"
quota = 1

[[group.pool]]
url = "stratum+tcp://ca.stratum.braiins.com:3333"
user = "USER"
password = "x"

[[group.pool]]
url = "stratum+tcp://us-east.stratum.braiins.com:3333"
user = "USER"
password = "x"

[[group.pool]]
url = "stratum+tcp://stratum.braiins.com:3333"
user = "USER"
password = "x"

@neutrino220
Copy link

[temp_control]
mode = "auto"

[fan_control]
min_fans = 1

[autotuning]
enabled = true
mode = "power_target"
power_target = 900

[[group]]
name = "group1"
quota = 1

[[group.pool]]
url = "stratum+tcp://ca.stratum.braiins.com:3333"
user = "USER"
password = "x"

[[group.pool]]
url = "stratum+tcp://us-east.stratum.braiins.com:3333"
user = "USER"
password = "x"

[[group.pool]]
url = "stratum+tcp://stratum.braiins.com:3333"
user = "USER"
password = "x"

Thanks you so much, now im Back!

I don't now which parameter was the problem but now it's connected to HA-Miner

@b-rowan
Copy link
Collaborator

b-rowan commented Jan 8, 2025

This is because pyasic cannot get the config on an offline or not responding miner. I should probably integrate checks that will refuse to set the miner config unless the machine has a valid config returned from data. It seems like your miner failed to get config or returned an invalid config, and then pyasic tried to apply changes to it, which removed most of what you had configured...

@neutrino220
Copy link

This is because pyasic cannot get the config on an offline or not responding miner. I should probably integrate checks that will refuse to set the miner config unless the machine has a valid config returned from data. It seems like your miner failed to get config or returned an invalid config, and then pyasic tried to apply changes to it, which removed most of what you had configured...

Thanks for explaining this.
A error-handling would be great and i hope you integrate a error-message that tells me what's missing or what to do to make the configuration compatible.

@Ben-in-Chicago
Copy link

Can you send the result of ssh root@MINER_IP "cat /etc/bosminer.toml" @Duffy2222? Want to see if I can figure out what part of the config is failing, I haven't had this issue with my S9...

Thanks, @b-rowan. I deleted my post, because I solved the issue by myself. Seeing the log posted here, the URL for help has highlighted and then I saw my fault. I needed to set a value in 'Quota' for pool groups in my miner configuration. It was showing the value '1' but this was geyed out. By editing the pool-groups, setting a quota to '1' the issue was solved for me: grafik

This should be fixed in 1.1.22rc2, so hopefully no more issues there.

Greetings! I finally got my HACS updated again to the latest version. I then installed the 1.1.22rc2 and the latest version 1.1.24, and the S9 is still not recognized. However, the Braiins Mini Miner does now work which it didn't previously. [cheers emoji]

@b-rowan
Copy link
Collaborator

b-rowan commented Jan 21, 2025

Good to hear. That means the pyasic changes got the mini miner added.

Biggest thing with the S9s is to make sure all config fields are filled in and that you have given it the right web and SSH passwords.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants