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

Fatal error on upgrade from v3.3.11 -> v3.4.0 #409

Closed
davethebug opened this issue Dec 8, 2023 · 5 comments
Closed

Fatal error on upgrade from v3.3.11 -> v3.4.0 #409

davethebug opened this issue Dec 8, 2023 · 5 comments

Comments

@davethebug
Copy link

On upgrading via HACS to 3.4 the following logs prevented the wiser integration from starting. Tested on current HA OS/version and previous snapshot. (I only installed it 2 days ago!)

All help much appreciated.

Logs:
Unexpected error fetching wiser (wiser-WiserHeat0575C3) data: Illegal header value b' hG--redacted-wiser-key--e+r2--redacted--a/fqMw9/Mw/u2--redacted--q'
6 December 2023, 22:28:15 – (ERROR) Drayton Wiser Integration for Home Assistant (custom integration) - message first occurred at 6 December 2023, 22:27:54 and shows up 3 times
Illegal header value b' hG--redacted-wiser-key--e+r2--redacted--a/fqMw9/Mw/u2--redacted--q'
6 December 2023, 22:28:15 – (ERROR) Drayton Wiser Integration for Home Assistant (custom integration) - message first occurred at 6 December 2023, 22:27:54 and shows up 3 times

detailed log

2023-12-06 22:27:54.486 ERROR (MainThread) [custom_components.wiser.coordinator] Illegal header value b' hG--redacted-wiser-key--e+r2--redacted--a/fqMw9/Mw/u2--redacted--q'
2023-12-06 22:27:54.486 ERROR (MainThread) [custom_components.wiser.coordinator] Unexpected error fetching wiser (wiser-WiserHeat0575C3) data: Illegal header value b' hG--redacted-wiser-key--e+r2--redacted--a/fqMw9/Mw/u2--redacted--q'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
yield
File "/usr/local/lib/python3.11/site-packages/httpcore/_async/http11.py", line 142, in _send_request_headers
event = h11.Request(
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/h11/_events.py", line 96, in init
self, "headers", normalize_and_validate(headers, _parsed=_parsed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/h11/_headers.py", line 164, in normalize_and_validate
validate(_field_value_re, value, "Illegal header value {!r}", value)
File "/usr/local/lib/python3.11/site-packages/h11/_util.py", line 91, in validate
raise LocalProtocolError(msg)
h11._util.LocalProtocolError: Illegal header value b' hG--redacted-wiser-key--e+r2--redacted--a/fqMw9/Mw/u2--redacted--q'

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

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 66, in map_httpcore_exceptions
yield
File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 366, in handle_async_request
resp = await self._pool.handle_async_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Etc..

@msp1974
Copy link
Collaborator

msp1974 commented Dec 8, 2023

Seems it doesn't like your secret key value. Not that it is wrong but it doesn't like it.

Few questions.

  1. Presume this was working on 3.3.11?
  2. What version of HA are you on?
  3. What hub do you have?

Edit:
Not sure of best way to resolve this. Can you send me a DM on the forum with your full key so I can maybe see what chars it doesn't like and try and test with it.

Other, not so great option is to factory reset your hub as this will give a different key but will have to be setup again.

@davethebug
Copy link
Author

davethebug commented Dec 8, 2023

  1. Worked well on 3.3.11 and when I fell back to that version.
  2. Happens on 2023.11 and 2023.12 using HAOS 11.2
  3. Hub R WT724R1S0902 running 3.12.1

I left the special characters in the redaction blah+blah/blah/blah/blah - Probably useless info, but I setup the integration and copied the key in from an iPad.

@msp1974
Copy link
Collaborator

msp1974 commented Dec 8, 2023

Just doing some googling on your issue. Can you make sure there is no space at the end of the key when you pasted it.

@SteveJack34
Copy link

SteveJack34 commented Dec 10, 2023

I have the same issue. There appears to be a space at the end of the header value.
How do I remove it?
SteveJ

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

msp1974 commented Dec 11, 2023

This shounow be fixed (without editing the config files) in v3.4.1

@msp1974 msp1974 closed this as completed Dec 11, 2023
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

3 participants