『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 1547|回复: 3

[技术探讨] web_protocol.py 报错产生大量日志

[复制链接]

34

主题

312

帖子

1452

积分

金牌会员

Rank: 6Rank: 6

积分
1452
金钱
1140
HASS币
0
发表于 2022-6-9 10:45:12 | 显示全部楼层 |阅读模式
本帖最后由 hcfong2020 于 2022-6-9 10:49 编辑

容器里面报错的提示
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'"
2022-06-09 10:46:00 ERROR (MainThread) [aiohttp.server] 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'"
2022-06-09 10:46:00 ERROR (MainThread) [aiohttp.server] 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

最近在homeassistant日志文件中出现大量的web_protocol.py文件的报错,在网上也查询不到是什么问题。有哪位大神也遇到过,有没有解决方法?

./var/lib/docker/overlay2/ca562c096c9f936d10eb5bbf2bef6ed2192c4277c0cf9ccb5dac420e96781fd3/diff/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py./var/lib/docker/overlay2/517f51c684b1fe1a59eed328e023d4b201fe5bc186e1d4aeba9d783c894875ed/merged/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py./var/lib/docker/overlay2/28ea32e6a07a6b246f2fd8fd31838a23d9a5816cdb97ce99a94d33d853bb7fd5/diff/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py./var/lib/docker/overlay2/5a684e1f623cf214a4f4c6fb2058ecf8c0c0df3c00d3b384a9c4d2231dc02417/diff/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py./var/lib/docker/overlay2/0094989d098f72519ad310d2520192630834cc44c876bf5210202b5fdc44a5f8/merged/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py
以上是docker里面用到web_protocol.py文件的地方。感觉是aiohttp出问题了。

Requirement already satisfied: aiohttp in /usr/local/lib/python3.9/site-packages (3.8.1)Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.9/site-packages (from aiohttp) (21.2.0)Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /usr/local/lib/python3.9/site-packages (from aiohttp) (2.0.12)Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.9/site-packages (from aiohttp) (1.3.0)Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.9/site-packages (from aiohttp) (1.7.2)Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.9/site-packages (from aiohttp) (4.0.2)Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.9/site-packages (from aiohttp) (1.2.0)Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.9/site-packages (from aiohttp) (6.0.2)Requirement already satisfied: idna>=2.0 in /usr/local/lib/python3.9/site-packages (from yarl<2.0,>=1.0->aiohttp) (3.3)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

尝试了在容器里面直接安装 aiohttp,出现上面的提示。

网络上有一个类似的错误,不过看不懂他是怎么解决的!





回复

使用道具 举报

34

主题

312

帖子

1452

积分

金牌会员

Rank: 6Rank: 6

积分
1452
金钱
1140
HASS币
0
 楼主| 发表于 2022-6-9 13:24:33 来自手机 | 显示全部楼层
已解决参考https://www.jakehu.me/2020/home-assistant/
回复

使用道具 举报

8

主题

366

帖子

3987

积分

论坛元老

Rank: 8Rank: 8

积分
3987
金钱
3621
HASS币
10
发表于 2022-6-9 20:27:00 | 显示全部楼层
好像base_url弃用了吧?大概记得什么时候见过的
回复

使用道具 举报

34

主题

312

帖子

1452

积分

金牌会员

Rank: 6Rank: 6

积分
1452
金钱
1140
HASS币
0
 楼主| 发表于 2022-6-11 09:23:31 来自手机 | 显示全部楼层
s2233 发表于 2022-6-9 20:27
好像base_url弃用了吧?大概记得什么时候见过的

https://bbs.hassbian.com/thread-3913-1-1.html 解决思路可以参考这个!主要原因还是我的nodered里面存在之前设置的https访问的节点。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-28 20:54 , Processed in 0.050004 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表