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

Error message: The length of the provided data is not a multiple of the block length #78

Closed
ranrinc opened this issue Oct 13, 2020 · 18 comments
Labels
bug Something isn't working

Comments

@ranrinc
Copy link

ranrinc commented Oct 13, 2020

I got this error messages which not sure why, also disable for the device on tuya integrations. Still got this messages during the startup, unsure what happen:

    raise ValueError("Config entry has already been setup!"),
ValueError: Config entry has already been setup!,
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry,
    return await hass.data[DOMAIN].async_setup_entry(entry),
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 67, in async_setup_entry,
    result = await component.async_setup_entry(hass, self)  # type: ignore,
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup,
Traceback (most recent call last):,
2020-10-13 14:38:59 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry AC Front Guest Room for sensor,
Failed to update status of device [xxx.xxx.xxx.xxx]: [The length of the provided data is not a multiple of the block length.]
@postlund
Copy link
Collaborator

Not sure about the config entry error, do you have any feeling of it is related? The other error is obviously some padding error. Is this reproducible for you? We need debug logs to go further.

@postlund postlund added the bug Something isn't working label Oct 14, 2020
@ranrinc
Copy link
Author

ranrinc commented Oct 16, 2020

Not sure about the config entry error, do you have any feeling of it is related? The other error is obviously some padding error. Is this reproducible for you? We need debug logs to go further.

What do you need.. cause that error always come up upon reboot HA on my portainer error logs

@postlund
Copy link
Collaborator

I'm not sure how to debug the config entry error, not much to go on. But you can enable debug logs for localtuya for the other one:

logger:
  default: warning
  logs:
    custom_components.localtuya:debug

@postlund
Copy link
Collaborator

I think I have reproduced the latter error myself, will try to fix it tonight. Will keep you posted.

@postlund
Copy link
Collaborator

@ranrinc I created a more "detailed" issued for the config flow error in #94. The other issue should probably be fixed by #92, which is now merged to master. Maybe you can try out master and see if the error disappears?

@postlund postlund changed the title error messages Error message: The length of the provided data is not a multiple of the block length Oct 19, 2020
@ranrinc
Copy link
Author

ranrinc commented Oct 19, 2020

@postlund I just replace the current with new master, however I'm still seing this error

2020-10-19 17:09:01 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry AC Daikin Plug for sensor,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup,
    result = await component.async_setup_entry(hass, self)  # type: ignore,
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 67, in async_setup_entry,
    return await hass.data[DOMAIN].async_setup_entry(entry),
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry,
    raise ValueError("Config entry has already been setup!"),
ValueError: Config entry has already been setup!,
2020-10-19 17:09:01 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry AC Daikin Plug for sensor,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup,
    result = await component.async_setup_entry(hass, self)  # type: ignore,
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 67, in async_setup_entry,
    return await hass.data[DOMAIN].async_setup_entry(entry),
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry,
    raise ValueError("Config entry has already been setup!"),
ValueError: Config entry has already been setup!,
2020-10-19 17:09:02 WARNING (MainThread) [homeassistant.components.threshold.binary_sensor] State is not numerical,

I will add logger tonight so I can give you a better informations. Thanks bro.. for all the help

@postlund
Copy link
Collaborator

Yeah, I will deal with the config entry stuff in the other issue. But great that the "block length" issue got resolved 👍

@postlund
Copy link
Collaborator

Does the config entry error appear at every startup of home assistant? My initial thought was that it appears if the config has changed between the already stored config entry and YAML.

@ranrinc
Copy link
Author

ranrinc commented Oct 19, 2020

I try reboot a couple of time.. still getting the same messages

@postlund
Copy link
Collaborator

@ranrinc Found the issue (explains in #94). Please try #100 and let me know if it works.

@ranrinc
Copy link
Author

ranrinc commented Oct 20, 2020

@ranrinc Found the issue (explains in #94). Please try #100 and let me know if it works.

Well, currently my other plugs is broken so I only add single plugs. However, since all my other tuya devices are running tuya integration will this causing the error?

@postlund
Copy link
Collaborator

@ranrinc I don't know for sure if the regular integration causes any problems, but I wouldn't be surprised if it did. So I recommend disabling it when testing.

@ranrinc
Copy link
Author

ranrinc commented Oct 25, 2020

@postlund Finally today I remove tuya integration and change all into localtuya. So far its working however my power outlets which have 5 swich both come back with many error. Unsure what is the problem.

2020-10-25 17:57:54 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Family Room Outlet (YAML) for switch,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup,
    result = await component.async_setup_entry(hass, self)  # type: ignore,
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 73, in async_setup_entry,
    return await hass.data[DOMAIN].async_setup_entry(entry),
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry,
    raise ValueError("Config entry has already been setup!"),
ValueError: Config entry has already been setup!,
2020-10-25 17:57:54 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Family Room Outlet (YAML) for switch,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup,
    result = await component.async_setup_entry(hass, self)  # type: ignore,
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 73, in async_setup_entry,
    return await hass.data[DOMAIN].async_setup_entry(entry),
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry,
    raise ValueError("Config entry has already been setup!"),
ValueError: Config entry has already been setup!,
2020-10-25 17:57:54 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Family Room Outlet (YAML) for switch,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup,
    result = await component.async_setup_entry(hass, self)  # type: ignore,
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 73, in async_setup_entry,
    return await hass.data[DOMAIN].async_setup_entry(entry),
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry,
    raise ValueError("Config entry has already been setup!"),
ValueError: Config entry has already been setup!,
2020-10-25 17:57:54 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Family Room Outlet (YAML) for switch,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup,
    result = await component.async_setup_entry(hass, self)  # type: ignore,
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 73, in async_setup_entry,
    return await hass.data[DOMAIN].async_setup_entry(entry),
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry,
    raise ValueError("Config entry has already been setup!"),
ValueError: Config entry has already been setup!,
2020-10-25 17:57:54 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Mom Room Outlet (YAML) for switch,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup,
    result = await component.async_setup_entry(hass, self)  # type: ignore,
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 73, in async_setup_entry,
    return await hass.data[DOMAIN].async_setup_entry(entry),
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry,
    raise ValueError("Config entry has already been setup!"),
ValueError: Config entry has already been setup!,
2020-10-25 17:57:54 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Mom Room Outlet (YAML) for switch,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup,
    result = await component.async_setup_entry(hass, self)  # type: ignore,
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 73, in async_setup_entry,
    return await hass.data[DOMAIN].async_setup_entry(entry),
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry,
    raise ValueError("Config entry has already been setup!"),
ValueError: Config entry has already been setup!,
2020-10-25 17:57:54 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Mom Room Outlet (YAML) for switch,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup,
    result = await component.async_setup_entry(hass, self)  # type: ignore,
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 73, in async_setup_entry,
    return await hass.data[DOMAIN].async_setup_entry(entry),
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry,
    raise ValueError("Config entry has already been setup!"),
ValueError: Config entry has already been setup!,
2020-10-25 17:57:54 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Mom Room Outlet (YAML) for switch,
Traceback (most recent call last):,
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup,
    result = await component.async_setup_entry(hass, self)  # type: ignore,
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 73, in async_setup_entry,
    return await hass.data[DOMAIN].async_setup_entry(entry),
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry,
    raise ValueError("Config entry has already been setup!"),
ValueError: Config entry has already been setup!,

Furthermore need help in setting the light bulb, is there a detail yaml? Thanks in advance

@postlund
Copy link
Collaborator

@ranrinc Yeah, that's a bug in current version. It's fixed on master, so if you check out master instead you should not see those errors anymore.

@postlund
Copy link
Collaborator

Did you manage to test with master?

@ranrinc
Copy link
Author

ranrinc commented Nov 1, 2020

Did you manage to test with master?

I have not yet to test on master.. I though should wait till it being update for release?

@ranrinc
Copy link
Author

ranrinc commented Nov 4, 2020

Did you manage to test with master?

Finally have time to test it and yes all the error is now gone... Hope this will get release very soon.

@postlund
Copy link
Collaborator

@ranrinc Thanks for verifying! Will close the issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants