找回密码
 立即注册
查看: 87|回复: 10

[技术探讨] 自动化新建 或者 修改 保存 还是报500错误,大家找到方法....

[复制链接]

51

主题

263

回帖

1548

积分

金牌会员

积分
1548
金钱
1234
HASS币
50
发表于 2025-3-27 15:44:31 | 显示全部楼层 |阅读模式
上个月 升级后 自动化新建 或者 修改 保存 就报500错误,不能保存,只有在core提示更新后,重启的短暂时间可以保存,前天Operating System 提示更新,现在是15.0的版本了,自动化还是报500错误,大家找到解决办法没有??


试过把自动化名称改成拼音,还是不管用。
回复

使用道具 举报

62

主题

287

回帖

5787

积分

元老级技术达人

积分
5787
金钱
5423
HASS币
100
发表于 2025-3-27 16:38:48 | 显示全部楼层
没有日志老衲只能给你算上一卦了
回复

使用道具 举报

jjcs 手机认证

51

主题

1918

回帖

7759

积分

论坛元老

积分
7759
金钱
5780
HASS币
40
发表于 2025-3-27 18:25:27 | 显示全部楼层
235939097-6798da58-24fd-44cc-9970-c8d2f9609704.jpg
折腾精神永存,感恩感谢论坛每一位愿意分享和帮助过我的大佬,论坛有你更精彩
回复

使用道具 举报

51

主题

263

回帖

1548

积分

金牌会员

积分
1548
金钱
1234
HASS币
50
 楼主| 发表于 2025-3-27 18:48:24 | 显示全部楼层
ryanh7 发表于 2025-3-27 16:38
没有日志老衲只能给你算上一卦了

是不是 这个 日志
回复

使用道具 举报

51

主题

263

回帖

1548

积分

金牌会员

积分
1548
金钱
1234
HASS币
50
 楼主| 发表于 2025-3-27 18:52:40 | 显示全部楼层
日志记录器: aiohttp.server
来源: /usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py:451
首次出现: 2025年3月26日 13:46:18 (24 次总计出现)
上次记录: 18:51:05

Error handling request from 192.168.3.127
Error handling request from 192.168.3.92
Error handling request from 192.168.3.90
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 973, in get
    return await self.handle(request, camera)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 991, in handle
    image = await _async_get_image(
            ^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 205, in _async_get_image
    else await camera.async_camera_image(width=width, height=height)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/camera.py", line 253, in async_camera_image
    return await self._coordinator.client.async_get_snapshot(self._channel_number)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/client.py", line 75, in async_get_snapshot
    return await self.get_bytes(url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/client.py", line 780, in get_bytes
    response.raise_for_status()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status
    raise ClientResponseError(
    ...<5 lines>...
    )
aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url='http://192.168.3.224/cgi-bin/snapshot.cgi?channel=1'
回复

使用道具 举报

51

主题

263

回帖

1548

积分

金牌会员

积分
1548
金钱
1234
HASS币
50
 楼主| 发表于 2025-3-27 18:54:49 | 显示全部楼层
日志记录器: aiohttp.server
来源: /usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py:451
首次出现: 18:08:52 (102 次总计出现)
上次记录: 18:54:13

Error handling request from 192.168.3.127
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/view.py", line 134, in post
    await hass.async_add_executor_job(_write, path, current)
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/config/view.py", line 251, in _write
    write_utf8_file_atomic(path, contents)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/file.py", line 39, in write_utf8_file_atomic
    fdesc.write(utf8_data)
    ~~~~~~~~~~~^^^^^^^^^^^
UnicodeEncodeError: 'ascii' codec can't encode characters in position 31-36: ordinal not in range(128)
回复

使用道具 举报

62

主题

287

回帖

5787

积分

元老级技术达人

积分
5787
金钱
5423
HASS币
100
发表于 2025-3-27 20:37:23 | 显示全部楼层
tanbobo 发表于 2025-3-27 18:54
日志记录器: aiohttp.server
来源: /usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py:451 ...

这个错误不知道是不是和你的500错误同时出现的,不知道是否相关。但这个错误很可能是由于系统环境的语言设置不正确(未设置utf-8),导致配置模块写入utf8的配置文件的时候错误地尝试使用ascii编码,从而引发错误。由于不清楚你的安装方式,建议往设置utf8的系统语言环境方向尝试。
回复

使用道具 举报

51

主题

263

回帖

1548

积分

金牌会员

积分
1548
金钱
1234
HASS币
50
 楼主| 发表于 2025-3-27 21:13:26 | 显示全部楼层
ryanh7 发表于 2025-3-27 20:37
这个错误不知道是不是和你的500错误同时出现的,不知道是否相关。但这个错误很可能是由于系统环境的语言 ...

pve 虚拟机 冬瓜 系统 以前都是正常的 就是 升级 后才出现的这个问题
回复

使用道具 举报

51

主题

263

回帖

1548

积分

金牌会员

积分
1548
金钱
1234
HASS币
50
 楼主| 发表于 2025-3-27 21:19:00 | 显示全部楼层
ryanh7 发表于 2025-3-27 20:37
这个错误不知道是不是和你的500错误同时出现的,不知道是否相关。但这个错误很可能是由于系统环境的语言 ...

请教大神 如何设置 已经一个多月了。这个错误是和500错误同时出现的。
回复

使用道具 举报

51

主题

263

回帖

1548

积分

金牌会员

积分
1548
金钱
1234
HASS币
50
 楼主| 发表于 2025-3-27 21:58:45 | 显示全部楼层
automations.yaml  configuration.yaml 把这两个另存为 utf-8 重启了 好像好了
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-5-1 09:37 , Processed in 1.232660 second(s), 25 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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