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

Integration Stopped Loading 3.4.1 #418

Closed
colingandrews opened this issue Dec 23, 2023 · 18 comments
Closed

Integration Stopped Loading 3.4.1 #418

colingandrews opened this issue Dec 23, 2023 · 18 comments

Comments

@colingandrews
Copy link

Hi,

I started getting log messages like:

json.decoder.JSONDecodeError: Invalid control character at: line 1 column 1655 (char 1654)
2023-12-22 18:45:37.353 DEBUG (MainThread) [custom_components.wiser.coordinator] Finished fetching wiser (wiser-WiserHeat050CCB) data in 0.137 seconds (success: False)
2023-12-22 18:46:57.786 ERROR (MainThread) [custom_components.wiser.coordinator] Invalid control character at: line 1 column 1655 (char 1654)
2023-12-22 18:46:57.786 ERROR (MainThread) [custom_components.wiser.coordinator] Unexpected error fetching wiser (wiser-WiserHeat050CCB) data: Invalid control character at: line 1 column 1655 (char 1654)

I completely removed the integration and started over, the device is Discovered by HA but when I try to submit the configuration with the Secret (obtained again and has not changed) I get an 'Unknown Error Occurred' message.

I am seeing the following Core Error in the Log, not sure if it is related...

Error handling request
20:25:38 – (ERROR) /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py - message first occurred at 20:20:45 and shows up 2 times

Any suggestions?

Thanks,
Colin

@msp1974
Copy link
Collaborator

msp1974 commented Dec 23, 2023

Can you confirm versions..HA etc.
What is the core error message relating to web_protocol.py?

What changes have you made recently in either HA or Wiser that may have started this happening? Not seen this error before.

@colingandrews
Copy link
Author

Core 2023.12.3
Supervisor 2023.12.0
Operating System 11.2
Frontend 20231208.2

The core error message relating to web_protocol.py appears when I try to configure the Wiser Integration.

I hadn't made any changes for a while and was running Wiser 3.4.0. When the problem occurred I saw and installed the update to 3.4.1 and restarted the Wiser Hub. It only worked again for a short time, but I was unable to get the integration to load again.

Here is the full log:

Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421
First occurred: 08:52:57 (1 occurrences)
Last logged: 08:52:57

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, 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 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 233, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
result = await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wiser/config_flow.py", line 167, in async_step_zeroconf_confirm
validated = await validate_input(self.hass, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wiser/config_flow.py", line 66, in validate_input
await wiserhub.read_hub_data()
File "/usr/local/lib/python3.11/site-packages/aioWiserHeatAPI/wiserhub.py", line 126, in read_hub_data
await self._build_objects()
File "/usr/local/lib/python3.11/site-packages/aioWiserHeatAPI/wiserhub.py", line 143, in _build_objects
self._network_data = await self._wiser_rest_controller._get_hub_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioWiserHeatAPI/rest_controller.py", line 164, in _get_hub_data
return await self._do_hub_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioWiserHeatAPI/rest_controller.py", line 122, in _do_hub_action
return json.loads(response)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Invalid control character at: line 1 column 1443 (char 1442)

@spangingpan
Copy link

I have the same issue since 18th Dec, I've only just noticed as my temp gauges were all greyed out.
When I downgraded back to 3.3.11 it started working.

Let me know what other details might help you.
HA versions:
Core 2023.12.3
Supervisor 2023.12.0
Operating System 11.2
Frontend 20231208.2

@msp1974
Copy link
Collaborator

msp1974 commented Dec 24, 2023

Can you confirm your hub firmware version. Need to work out what is different. I am running HAOS on bare metal with same versions.

@spangingpan
Copy link

My Wiser app shows the Hub with firmware of 3.14.0.
My HA is the HAOS on vmware VM.

@spangingpan
Copy link

I get these errors still, but it's collecting the data without issue:
2023-12-24 09:23:41.760 WARNING (MainThread) [custom_components.wiser.coordinator] Response error trying to communicate with Wiser Hub 192.168.10.XX for url http://192.168.10.XX:80/data/v2/domain/. Error is 400, message="Data after Connection: close:\n\n b'0'\n ^", url=URL('http://192.168.10.XX:80/data/v2/domain/')

@msp1974
Copy link
Collaborator

msp1974 commented Dec 24, 2023

OK. Can you try something for me. There is a new version of the api that this integration uses but I need you to force the integration to use it.

In homeassistant/custom_components/wiser you will find manifest.json.

In there there is a requirements line that lists aiowiserheatapi. Can you set the version to 1.5.2 and restart HA. This will need to be with v3.4.1, so update to this version first.

@spangingpan
Copy link

Updated, set the new version and restarted.
This is the log output:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data
return await self.update_method()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wiser/coordinator.py", line 159, in async_update_data
raise ex
File "/config/custom_components/wiser/coordinator.py", line 137, in async_update_data
await self.wiserhub.read_hub_data()
File "/usr/local/lib/python3.11/site-packages/aioWiserHeatAPI/wiserhub.py", line 126, in read_hub_data
await self._build_objects()
File "/usr/local/lib/python3.11/site-packages/aioWiserHeatAPI/wiserhub.py", line 143, in _build_objects
self._network_data = await self._wiser_rest_controller._get_hub_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioWiserHeatAPI/rest_controller.py", line 164, in _get_hub_data
return await self._do_hub_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioWiserHeatAPI/rest_controller.py", line 118, in _do_hub_action
return json.loads(response)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Invalid control character at: line 1 column 860 (char 859)
2023-12-24 11:26:40.958 ERROR (MainThread) [custom_components.wiser.coordinator] Invalid control character at: line 1 column 860 (char 859)
2023-12-24 11:26:40.958 ERROR (MainThread) [custom_components.wiser.coordinator] Unexpected error fetching wiser (wiser-WiserHeat02828E) data: Invalid control character at: line 1 column 860 (char 859)

@msp1974
Copy link
Collaborator

msp1974 commented Dec 24, 2023

Hmm, OK so same issue. I'll have to look further.

@mark3267
Copy link

Same issue here for me..... although it may randomly start every now and again. Started when I went to 3.4.1

Running HA Green

Core
2023.12.3

Supervisor
2023.12.0

Operating System
11.2

Frontend
20231208.2

Error Message
json.decoder.JSONDecodeError: Invalid control character at: line 1 column 1022 (char 1021)

Thanks

@msp1974
Copy link
Collaborator

msp1974 commented Dec 24, 2023

@spangingpan - can you try forcing the aiowiserheatapi to v1.5.3 (on integration version 3.4.1). I have added a function to remove all control characters. Not seeing this issue on my setup so hard to test. If this works, I will release a v3.4.2 with this version of api.

UH, scrap that for now. Need to modify it to work with v3.4.1.

@msp1974
Copy link
Collaborator

msp1974 commented Dec 24, 2023

@spangingpan . Can you force v1.5.4 of aiowiserheatapi. Thanks

@colingandrews
Copy link
Author

colingandrews commented Dec 24, 2023 via email

@mark3267
Copy link

@spangingpan . Can you force v1.5.4 of aiowiserheatapi. Thanks

Done..... Fixed!!!! Thank you

@msp1974
Copy link
Collaborator

msp1974 commented Dec 24, 2023

Great thanks @mark3267. I will leave this open for those with the issue for now, with the temp fix of updating manifest.json to use 1.5.4 of aiowiserheatapi and issue an update to the integration after Santa has been!

@msp1974 msp1974 mentioned this issue Dec 27, 2023
@msp1974
Copy link
Collaborator

msp1974 commented Dec 27, 2023

Ok. v3.4.2 just released with this fix in it. Also made clearer HA2023.12 and above is now needed in integration info. Closing this issue.

@msp1974 msp1974 closed this as completed Dec 27, 2023
@spangingpan
Copy link

Thanks Mark for the quick fix, I was away for Christmas so couldn't give much feedback until today.

@colingandrews
Copy link
Author

colingandrews commented Dec 27, 2023 via email

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

4 participants