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

TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.' #483

Closed
dpgh947 opened this issue May 25, 2024 · 24 comments
Labels

Comments

@dpgh947
Copy link

dpgh947 commented May 25, 2024

I keep getting these errors which I think might be related to issue 436, I put a comment on that which I thought would re-open it, but it didn't... #436 (comment)

This error originated from a custom integration.

Logger: custom_components.wiser.coordinator
Source: custom_components/wiser/coordinator.py:198
integration: Drayton Wiser Integration for Home Assistant (documentation, issues)
First occurred: 16:12:54 (8 occurrences)
Last logged: 16:41:16

Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
Unknown error fetching wiser (wiser-WiserHeat061012) data. [Errno 104] Connection reset by peer. Please report this error to the integration owner
@asantaga
Copy link
Owner

asantaga commented May 26, 2024

ive checked my logs and I dont have this error. I think these errors occur when there is a comms issue, ie unable to connect to the hub.

How often is it happening?

I'll speak to Mark and look to trapping this error (TransderEncodingError) and then print out debug messages..

@dpgh947
Copy link
Author

dpgh947 commented May 26, 2024

It's a strange one. I've seen them occasionally for a while. However, I swapped the hub yesterday, set the new one up from scratch to look (I thought) exactly like the old one, and I was getting this error every few minutes, sometimes on every poll by the integration (so every 30 secs), but other than seeing this in the log, everything in HA looked fine. Then this morning I updated the hot water schedule (just added a couple of extra "on" periods as we have guests staying this weekend), and the errors have stopped - for now anyway. Here is the end of my current log for example (it is now 10:36 as I type this, so no errors since 9:42)

2024-05-26 08:36:13.496 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
2024-05-26 08:36:50.502 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
2024-05-26 08:40:14.648 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
2024-05-26 08:44:18.349 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
2024-05-26 08:45:04.173 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
2024-05-26 08:48:54.491 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
2024-05-26 08:54:10.514 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
2024-05-26 08:55:19.537 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. ConnectionResetError(104, 'Connection reset by peer'). Please report this error to the integration owner
2024-05-26 08:55:58.700 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. [Errno 104] Connection reset by peer. Please report this error to the integration owner
2024-05-26 08:57:18.471 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
2024-05-26 09:11:17.842 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. ConnectionResetError(104, 'Connection reset by peer'). Please report this error to the integration owner
2024-05-26 09:20:27.418 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
2024-05-26 09:31:32.201 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
2024-05-26 09:33:15.319 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
2024-05-26 09:42:35.054 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. [Errno 104] Connection reset by peer. Please report this error to the integration owner

@dpgh947
Copy link
Author

dpgh947 commented May 26, 2024

Ok ignore that, it has started again an hour later.

@dpgh947
Copy link
Author

dpgh947 commented May 26, 2024

Here's another excerpt with a single error I had at 11:59 while debug was on. It seems to be retrieving all info despite the reported error...

2024-05-26 11:58:30.935 DEBUG (MainThread) [custom_components.wiser.switch] Wiser firestick Switch switch update requested
2024-05-26 11:58:30.935 DEBUG (MainThread) [custom_components.wiser.switch] Wiser firestick Away Mode Turns Off switch update requested
2024-05-26 11:58:30.935 DEBUG (MainThread) [custom_components.wiser.select] Wiser Hot Water Mode updating
2024-05-26 11:58:30.936 DEBUG (MainThread) [custom_components.wiser.select] Wiser laptop charger Mode updating
2024-05-26 11:58:30.936 DEBUG (MainThread) [custom_components.wiser.select] Wiser firestick Mode updating
2024-05-26 11:58:30.936 DEBUG (MainThread) [custom_components.wiser.number] Wiser Away Mode Target Temperature updating
2024-05-26 11:58:30.937 DEBUG (MainThread) [custom_components.wiser.climate] Wiser Dining room updating
2024-05-26 11:59:17.375 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>.  Please report this error to the integration owner
2024-05-26 11:59:17.377 DEBUG (MainThread) [custom_components.wiser.coordinator] Finished fetching wiser (wiser-WiserHeat061012) data in 17.053 seconds (success: True)
2024-05-26 11:59:17.377 DEBUG (MainThread) [custom_components.wiser.climate] Wiser Lounge updating
2024-05-26 11:59:17.381 DEBUG (MainThread) [custom_components.wiser.climate] Wiser Bedroom updating
2024-05-26 11:59:17.385 DEBUG (MainThread) [custom_components.wiser.climate] Wiser Guest bedroom updating
2024-05-26 11:59:17.388 DEBUG (MainThread) [custom_components.wiser.climate] Wiser Theo bedroom updating
2024-05-26 11:59:17.391 DEBUG (MainThread) [custom_components.wiser.climate] Wiser Noah bedroom updating
2024-05-26 11:59:17.392 DEBUG (MainThread) [custom_components.wiser.sensor] Wiser HeatHub Signal device update requested
2024-05-26 11:59:17.392 DEBUG (MainThread) [custom_components.wiser.sensor] Wiser HeatHub Signal device state requested

For info, this is what a similar piece of log without the error looks like:

2024-05-26 12:00:18.341 DEBUG (MainThread) [custom_components.wiser.switch] Wiser laptop charger Identify switch update requested
2024-05-26 12:00:18.341 DEBUG (MainThread) [custom_components.wiser.switch] Wiser firestick Identify switch update requested
2024-05-26 12:00:18.342 DEBUG (MainThread) [custom_components.wiser.switch] Wiser laptop charger Switch switch update requested
2024-05-26 12:00:18.342 DEBUG (MainThread) [custom_components.wiser.switch] Wiser laptop charger Away Mode Turns Off switch update requested
2024-05-26 12:00:18.342 DEBUG (MainThread) [custom_components.wiser.switch] Wiser firestick Switch switch update requested
2024-05-26 12:00:18.343 DEBUG (MainThread) [custom_components.wiser.switch] Wiser firestick Away Mode Turns Off switch update requested
2024-05-26 12:00:18.343 DEBUG (MainThread) [custom_components.wiser.select] Wiser Hot Water Mode updating
2024-05-26 12:00:18.343 DEBUG (MainThread) [custom_components.wiser.select] Wiser laptop charger Mode updating
2024-05-26 12:00:18.344 DEBUG (MainThread) [custom_components.wiser.select] Wiser firestick Mode updating
2024-05-26 12:00:18.344 DEBUG (MainThread) [custom_components.wiser.number] Wiser Away Mode Target Temperature updating
2024-05-26 12:00:18.345 DEBUG (MainThread) [custom_components.wiser.climate] Wiser Dining room updating
2024-05-26 12:00:48.881 INFO (MainThread) [custom_components.wiser.coordinator] Hub update completed for WiserHeat061012
2024-05-26 12:00:48.881 DEBUG (MainThread) [custom_components.wiser.coordinator] Finished fetching wiser (wiser-WiserHeat061012) data in 0.556 seconds (success: True)
2024-05-26 12:00:48.882 DEBUG (MainThread) [custom_components.wiser.climate] Wiser Lounge updating
2024-05-26 12:00:48.884 DEBUG (MainThread) [custom_components.wiser.climate] Wiser Bedroom updating
2024-05-26 12:00:48.887 DEBUG (MainThread) [custom_components.wiser.climate] Wiser Guest bedroom updating
2024-05-26 12:00:48.890 DEBUG (MainThread) [custom_components.wiser.climate] Wiser Theo bedroom updating
2024-05-26 12:00:48.892 DEBUG (MainThread) [custom_components.wiser.climate] Wiser Noah bedroom updating
2024-05-26 12:00:48.894 DEBUG (MainThread) [custom_components.wiser.sensor] Wiser HeatHub Signal device update requested

@asantaga
Copy link
Owner

Did a bit of research and the R&D indicates not a network problem but a async io conflict condition (Somethings already runnnig etc. ), I dont think its "breaking" as such, just missing data sync.. We'll work on it.. problem is reproducing it.... will ask @msp1974

@msp1974
Copy link
Collaborator

msp1974 commented May 26, 2024

Can i just confirm versions of HA and integration? Thx

@dpgh947
Copy link
Author

dpgh947 commented May 26, 2024

HA 2024.5.5, integration 3.4.7

@msp1974
Copy link
Collaborator

msp1974 commented May 26, 2024

Ok thx. Let me have a look. I have an idea.

@dpgh947
Copy link
Author

dpgh947 commented May 28, 2024

Just for info - I have, as mentioned, replaced my wiser hub this weekend. So I have seen this error on 2 different hubs, and on both of those with it connected to either my Deco mesh wifi, or direct to my Plusnet hub two router. So my feeling is this has been brought on by a recent HA update, but I cannot say when I started seeing these errors - last 2-3 weeks probably... I have completely reset my wiser account and the new hub and re-installed from scratch again today (for an unrelated problem) and I am again seeing these errors.

@msp1974
Copy link
Collaborator

msp1974 commented Jun 8, 2024

Just to say, not ignoring this but have been following this issue which i think is the problem. So far, no solution.

aio-libs/aiohttp#4581

@dpgh947
Copy link
Author

dpgh947 commented Jun 14, 2024

I have no idea why, but soon after my last update a couple of weeks ago, these errors just stopped, not even when I did any updates or rebooted etc. but just completely randomly at about 6:15 one evening it just stopped. Not had any since.

@asantaga
Copy link
Owner

@msp1974 Did u add anything to the last release?

@msp1974
Copy link
Collaborator

msp1974 commented Jun 30, 2024

No, nothing done. Strange.

@dpgh947
Copy link
Author

dpgh947 commented Jul 2, 2024

Well, after weeks of nothing, I had another of these errors at 2:25am this morning. Just one, nothing happens at that time, nothing else in the logs around then. There was another "connection reset by peer" error an hour earlier.

2024-07-02 01:26:15.344 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. [Errno 104] Connection reset by peer. Please report this error to the integration owner
2024-07-02 02:25:52.287 ERROR (MainThread) [custom_components.wiser.coordinator] Unknown error fetching wiser (wiser-WiserHeat061012) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner

@rob1303-hub
Copy link

rob1303-hub commented Jul 9, 2024

First - thank you for your integration, it is very much appreciated.

Not sure if this is the right place to come in. However I have been receiving these errors for quite a while (sorry didn't record when they started).
I get a lot of them (as you can see 620 in the last 24 hours).
The don't appear to impact the control of the system.
I normally just clear the logs each day. This is the current log:


Logger: custom_components.wiser.coordinator
Source: custom_components/wiser/coordinator.py:198
integration: Drayton Wiser Integration for Home Assistant (documentation, issues)
First occurred: July 8, 2024 at 21:39:18 (620 occurrences)
Last logged: 21:29:26

Unknown error fetching wiser (wiser-WiserHeat03DF38) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
Unknown error fetching wiser (wiser-WiserHeat03DF38) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. ConnectionResetError(104, 'Connection reset by peer'). Please report this error to the integration owner
Unknown error fetching wiser (wiser-WiserHeat03DF38) data. Server disconnected. Please report this error to the integration owner
Unknown error fetching wiser (wiser-WiserHeat03DF38) data. [Errno 104] Connection reset by peer. Please report this error to the integration owner

Happy to help chase down any information needed.

My install:
Integration version: 3.4.7
HA Core version: 2024.6.4
HA Supervisor: 2024.06.2
Operating System 12.4

@msp1974
Copy link
Collaborator

msp1974 commented Sep 8, 2024

So, the issue i was tracking in aiohttp was closed a couple of weeks ago with the issue apparently fixed in 3.10.5 of aiohttp. This was updated in HA2024.8.3. Are you still seeing the errors after updating to this version or higher?

@msp1974 msp1974 added the Core HA label Sep 8, 2024
@dpgh947
Copy link
Author

dpgh947 commented Sep 8, 2024

I was seeing these very seldom, and I haven't seen it for quite some time now, I couldn't say if it was since that level but sounds likely. Thanks for your efforts.

@BJarkowski
Copy link

BJarkowski commented Sep 11, 2024

I've updated my Home Assistant to version 2024.9.1 and I started to face these issues:
Unknown error fetching wiser (wiser-WiserHeat0477F3) data. [Errno 104] Connection reset by peer. Please report this error to the integration owner
Unknown error fetching wiser (wiser-WiserHeat0477F3) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. ConnectionResetError(104, 'Connection reset by peer'). Please report this error to the integration owner
Unknown error fetching wiser (wiser-WiserHeat0477F3) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
Unknown error fetching wiser (wiser-WiserHeat0477F3) data. Server disconnected. Please report this error to the integration owner

I also see in my logs this issue related to aiohttp:
Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:433
First occurred: 12:04:59 (3 occurrences)
Last logged: 15:15:42

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 362, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "aiohttp/_http_parser.pyx", line 563, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message:
Invalid method encountered:

b'\x16\x03\x01'
  ^

It doesn't look like anything functionality gets broken, just lots of messages in logs.
Thanks!

@rob1303-hub
Copy link

@msp1974 - thank you for continuing to work on this.

Sorry for delay in replying.

These issues are still occurring:
This error originated from a custom integration.

Source: custom_components/wiser/coordinator.py:198
integration: Drayton Wiser Integration for Home Assistant (documentation, issues)
First occurred: September 13, 2024 at 18:44:11 (15 occurrences)
Last logged: 10:55:21

Unknown error fetching wiser (wiser-WiserHeat03DF38) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
Unknown error fetching wiser (wiser-WiserHeat03DF38) data. Server disconnected. Please report this error to the integration owner
Unknown error fetching wiser (wiser-WiserHeat03DF38) data. [Errno 104] Connection reset by peer. Please report this error to the integration owner
Unknown error fetching wiser (wiser-WiserHeat03DF38) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. ConnectionResetError(104, 'Connection reset by peer'). Please report this error to the integration owner```

@orangelizard
Copy link

@msp1974 - Thank you kindly for your continued work.
I am also getting this error.

This error originated from a custom integration.

Logger: custom_components.wiser.coordinator
Source: custom_components/wiser/coordinator.py:198
integration: Drayton Wiser Integration for Home Assistant (documentation, issues)
First occurred: 11:30:55 (12 occurrences)
Last logged: 11:54:43

Unknown error fetching wiser (wiser-WiserHeat053FBE) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. Please report this error to the integration owner
Unknown error fetching wiser (wiser-WiserHeat053FBE) data. [Errno 104] Connection reset by peer. Please report this error to the integration owner
Unknown error fetching wiser (wiser-WiserHeat053FBE) data. Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>. ConnectionResetError(104, 'Connection reset by peer'). Please report this error to the integration owner

@msp1974
Copy link
Collaborator

msp1974 commented Nov 15, 2024

Ok, in v3.4.11 we improved handling of response not completed messages. This does not stop the issue of the hub dropping off wifi and therefore updates failing but will retry the request if it gets a response error before failing.

Is anybody still seeing these messages?

@enthalpie91
Copy link

hi
not me

@dpgh947
Copy link
Author

dpgh947 commented Nov 15, 2024

I was getting these a lot a few months ago, very seldom more recently. I've had one in the past couple of weeks, couldn't say when exactly or what version I was on at the time... I will keep an eye on it now.

@msp1974
Copy link
Collaborator

msp1974 commented Dec 3, 2024

Will close as no further feedback that it is not resolved.

@msp1974 msp1974 closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants