core
core copied to clipboard
aiohttp.server message="Bad status line 'Invalid method encountered'"
The problem
After upgrade to newest 2022.6.7 i see this error at logs
What version of Home Assistant Core has the issue?
2022.6.7
What was the last working version of Home Assistant Core?
i dont remember
What type of installation are you running?
Home Assistant OS
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Logger: aiohttp.server
Source: /usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py:405
First occurred: 03:36:42 (3 occurrences)
Last logged: 08:20:30
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
Additional information
No response
I have the same issue after upgrading my containerized HA from 2022.5.2 to 2022.6.7
Error I'm seeing:
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
This happens upon startup since the upgrade. Using old container fortunately worked okay
Not an issue in my case.
After searching on the internet I came to conclusion that one of my devices in LAN is trying to connect to :8123 port using HTTPS.
I've reviewed all phones and tablets and turned out it was my sons device.
This was coincidence that it happened after upgrade.
Having the same error and occors 18 times, but not every day:
Logger: aiohttp.server Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:405 First occurred: 2 augustus 2022 om 16:48:11 (18 occurrences) Last logged: 05:36:10
Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
Running on RPI4 - core-2022.7.3 - Home Assistant OS 8.4
I see the same error accompanied by another one before it.
2022-08-13 06:41:11.153 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadHttpMessage: 400, message='Pause on PRI/Upgrade'
2022-08-13 06:45:03.774 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
I have changed IP address of my HA instance to test the possibility of the reason tomhash2 gave that some device is trying to connect to HA instance using HTTPS and port 8123. Since I still this these errors, the HTTPS and port 8123 is not the reason in my case.
I see the same error accompanied by another one before it.
2022-08-13 06:41:11.153 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadHttpMessage: 400, message='Pause on PRI/Upgrade' 2022-08-13 06:45:03.774 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
I have changed IP address of my HA instance to test the possibility of the reason tomhash2 gave that some device is trying to connect to HA instance using HTTPS and port 8123. Since I still this these errors, the HTTPS and port 8123 is not the reason in my case.
UPDATE: I did grep for my IP address in the config directory and found one auth token that was using https on my old IP address:8123.
grep result:
.storage/auth:462: "client_id": "https://192.168.1.108:8123/"
I opened config/.storage/auth file, went to this auth entry, found the device ID and searched for that again in the config directory. It was from my Galaxy watch. I have removed the auth token now.
Might be helpful for people to search for devices using HTTPS for port 8123 to reach HA instance.
BUT, in my case, I didn't change the IP address on my watch after I changed my HA IP. So, the watch couldn't have pinged my new IP with HTTPS and port 8123. So the aiohttp errors I got today morning (posted in the quoted message) are definitely not from my watch pinging 8123 using HTTPS.
I will report back if I see the errors again.
I see the same error accompanied by another one before it.
2022-08-13 06:41:11.153 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadHttpMessage: 400, message='Pause on PRI/Upgrade' 2022-08-13 06:45:03.774 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
I have changed IP address of my HA instance to test the possibility of the reason tomhash2 gave that some device is trying to connect to HA instance using HTTPS and port 8123. Since I still this these errors, the HTTPS and port 8123 is not the reason in my case.
UPDATE: I did grep for my IP address in the config directory and found one auth token that was using https on my old IP address:8123.
grep result:
.storage/auth:462: "client_id": "https://192.168.1.108:8123/"
I opened config/.storage/auth file, went to this auth entry, found the device ID and searched for that again in the config directory. It was from my Galaxy watch. I have removed the auth token now.
Might be helpful for people to search for devices using HTTPS for port 8123 to reach HA instance.
BUT, in my case, I didn't change the IP address on my watch after I changed my HA IP. So, the watch couldn't have pinged my new IP with HTTPS and port 8123. So the aiohttp errors I got today morning (posted in the quoted message) are definitely not from my watch pinging 8123 using HTTPS.
I will report back if I see the errors again.
Saw the same error messages again. So what I did above didn't solve it.
2022-08-13 23:33:53.827 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-08-13 23:33:55.044 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadHttpMessage: 400, message='Pause on PRI/Upgrade'
Any progress on this issue? I´ve got the error more than once (see above).
Logger: aiohttp.server
Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:405
First occurred: 2:13:21 PM (959 occurrences)
Last logged: 2:14:59 PM
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
Is there I could do to present more details?
I'm facing same issue. Please help
Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: 2022-11-15 13:59:07.202 ERROR (MainThread) [aiohttp.server] Error handling request Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: Traceback (most recent call last): Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: messages, upgraded, tail = self._request_parser.feed_data(data) Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'" Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: 2022-11-15 13:59:07.699 ERROR (MainThread) [aiohttp.server] Error handling request Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: Traceback (most recent call last): Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: messages, upgraded, tail = self._request_parser.feed_data(data) Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'" Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: 2022-11-15 13:59:07.732 ERROR (MainThread) [aiohttp.server] Error handling request Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: Traceback (most recent call last): Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: messages, upgraded, tail = self._request_parser.feed_data(data) Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'" Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: 2022-11-15 13:59:07.766 ERROR (MainThread) [aiohttp.server] Error handling request Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: Traceback (most recent call last): Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: messages, upgraded, tail = self._request_parser.feed_data(data) Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'" Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: 2022-11-15 13:59:07.795 ERROR (MainThread) [aiohttp.server] Error handling request Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: Traceback (most recent call last): Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: messages, upgraded, tail = self._request_parser.feed_data(data) Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'" Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: 2022-11-15 13:59:07.826 ERROR (MainThread) [aiohttp.server] Error handling request Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: Traceback (most recent call last): Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: messages, upgraded, tail = self._request_parser.feed_data(data) Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data Nov 15 13:59:07 NUC11PAHi7 homeassistant[6196]: aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
Same issue here, any updates on this?
I have a feeling it relates back to Nginx, which I'm using to reverse-proxy to my HA instance. I don't have any issues (I don't think) from the app on iOS, but when using Firefox on my laptop it can take ages to load HA through the reverse proxy and I see the same errors others are reporting...
Hi.
I have similar error in my case after update HA 2022.12. My environment: HA Core (docker version).
This is the log:
2022-12-16 13:08:27.734 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
In log have 9 occurrences
Thanks
Same issue here for me!
Logger: aiohttp.server
Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:405
First occurred: 11:43:34 AM (5 occurrences)
Last logged: 11:44:11 AM
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
Same issue:
HA 2023.01.1
Logger: aiohttp.server Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:405 First occurred: 16:42:05 (1 occurrences) Last logged: 16:42:05 Error handling request
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
Same here: 2023-01-23 00:14:23.930 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
Similar here, message is different: Logger: aiohttp.server Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:405 First occurred: 3:22:08 PM (1 occurrences) Last logged: 3:22:08 PM Error handling request
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadHttpMessage: 400, message='Pause on PRI/Upgrade'
Same here:
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 332, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
#87861
Logger: aiohttp.server
Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:405
First occurred: 12:21:51 (12175 occurrences)
Last logged: 19:25:40
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
Getting the same issues, and have isolated it down to my iOS home companion app remote accessing the HA instance, via external URL. Accessing the HA instance via internal URL has no issues.
In my case, I am accessing it remotely via http (unsecured) via duckdns, and with my router port forwarding 8123 to the HA device.
In my case, I am accessing it remotely via https (secured) via duckdns, and with my router port forwarding 8123 to the HA device
To add on, I get the same error as long I’m using external URL functionality. Used an internal IP on the external URL section, via wifi.
Double-check the URL you're using in your request. Make sure it's correctly formatted and that there are no extra characters or spaces. Ensure the URL scheme (http/https) is correct for the API you're using. I had a similar problem, I specified the port to a URL, but it was not necessary.
I found out that such errors occur when the https://about.censys.io/ service sends requests like: 167.94.138.126 [28/Apr/2023:01:49:57 +0000] "GET / HTTP/1.1" 404 172 "-" "Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys. io/)" On their official website, you can see from which ip addresses this happens and block them on the server->> https://support.censys.io/hc/en-us/articles/360043177092-Opt-Out-of-Data-Collection
I found out that such errors occur when the https://about.censys.io/ service sends requests like: 167.94.138.126 [28/Apr/2023:01:49:57 +0000] "GET / HTTP/1.1" 404 172 "-" "Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys. io/)" On their official website, you can see from which ip addresses this happens and block them on the server->> https://support.censys.io/hc/en-us/articles/360043177092-Opt-Out-of-Data-Collection
But I don't have censys service !!!
Same here, using NGINX Home Assistant SSL proxy 3.5.0 2023.6.1 Home Assistant OS 10.2
Same Problem here
I did a fresh install of HAOS 10.3 with 2023.6 and then immediately installed the Let's Encrypt add-on and issued a wildcard SSL cert. When I restart HA and attempt to access HA via HTTPS it fails, and I see the error in this thread in the log.
guys, have a same problem
my HA works in docker
by typing docker logs homeassistant
i see:
2023-06-30 00:41:32.471 ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 172.28.0.1
the ip 172.28.0.1 is my docker network. I just added this net to trusted proxy and it all work fine now. I also usng https with duckdns. Hope my solution will help you
My nginx.conf with reverse proxy on it
server {
server_name homeassistant.bla.bla;
proxy_ssl_server_name on;
location / {
proxy_ssl_name $host;
proxy_pass http://localhost:8123; #HA is on 80 port, docker listen 8123
proxy_set_header Host $host;
proxy_pass_header Authorization;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $remote_addr;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/homeassistant.bla.bla/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/homeassistant.bla.bla/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server { if ($host = homeassistant.bla.bla) { return 301 http://$host:8123$request_uri; } # managed by Certbot server_name homeassistant.bla.bla; listen 80; return 404; # managed by Certbot }
This may be related to this issue: https://github.com/aio-libs/aiohttp/issues/7208
Basically, if the request does not set content-length, aiohttp server returns 400 with Invalid method encountered
.
It happens to me right now when calling Google Translate TTS.
Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 332, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message: Bad status line "Invalid method encountered:\n\n b'\\x16\\x03\\x01\\x02'\n ^"
Same issue on my side:
2023-10-08 17:02:25.552 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 332, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message: Bad status line "Invalid method encountered:\n\n b'\\x16\\x03\\x01\\x02'\n ^"