- 积分
- 356
- 金钱
- 296
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
中级会员
- 积分
- 356
- 金钱
- 296
- HASS币
- 0
|
这是docker 版本启动[color=rgb(0 134 201/var(--tw-text-opacity))]ghcr.io/home-assistant/armv7-hassio-supervisor:2024.03.0,
运行时候的日志:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/docker/api/client.py", line 213, in _retrieve_server_version
return self.version(api_version=False)["ApiVersion"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/docker/api/daemon.py", line 181, in version
return self._result(self._get(url), json=True)
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/docker/utils/decorators.py", line 44, in inner
return f(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/docker/api/client.py", line 236, in _get
return self.get(url, **self._set_request_timeout(kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 602, in get
return self.request("GET", url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 501, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/src/supervisor/supervisor/__main__.py", line 52, in <module>
coresys = loop.run_until_complete(bootstrap.initialize_coresys())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 685, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/bootstrap.py", line 59, in initialize_coresys
coresys.docker = DockerAPI(coresys)
^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/docker/manager.py", line 107, in __init__
self.docker: DockerClient = DockerClient(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/docker/client.py", line 45, in __init__
self.api = APIClient(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/docker/api/client.py", line 197, in __init__
self._version = self._retrieve_server_version()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/docker/api/client.py", line 220, in _retrieve_server_version
raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
--- Logging error ---
Traceback (most recent call last):
File "/usr/local/lib/python3.12/logging/handlers.py", line 1497, in emit
self.enqueue(self.prepare(record))
^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/utils/logging.py", line 20, in prepare
record = super().prepare(record)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/logging/handlers.py", line 1481, in prepare
record = copy.copy(record)
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/copy.py", line 87, in copy
rv = reductor(4)
^^^^^^^^^^^
ImportError: sys.meta_path is None, Python is likely shutting down
Call stack:
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 367, in __del__
self._loop.call_exception_handler(context)
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1845, in call_exception_handler
self.default_exception_handler(context)
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1819, in default_exception_handler
logger.error('\n'.join(log_lines), exc_info=exc_info)
File "/usr/local/lib/python3.12/logging/__init__.py", line 1568, in error
self._log(ERROR, msg, args, **kwargs)
File "/usr/local/lib/python3.12/logging/__init__.py", line 1684, in _log
self.handle(record)
File "/usr/local/lib/python3.12/logging/__init__.py", line 1700, in handle
self.callHandlers(record)
File "/usr/local/lib/python3.12/logging/__init__.py", line 1762, in callHandlers
hdlr.handle(record)
File "/usr/src/supervisor/supervisor/utils/logging.py", line 38, in handle
self.emit(record)
Message: 'Unclosed client session\nclient_session: <aiohttp.client.ClientSession object at 0xb319a6c0>'
Arguments: ()
[13:31:04] WARNING: Halt Supervisor
[13:31:04] INFO: Supervisor restart after closing
s6-rc: info: service legacy-services: stopping
[13:31:04] INFO: Watchdog restart after closing
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
用AI分析代码的内容:这段日志和代码追踪主要描述了在使用Docker API时遇到的问题,以及随后的系统服务停止过程。下面是对日志和代码追踪的详细解释:
代码追踪解释:
初始错误: 在尝试初始化Docker API客户端时,DockerClient 类中的 _retrieve_server_version 方法抛出了一个异常。这个方法试图获取Docker服务器的API版本,但是失败了。
异常原因: 异常是 requests.exceptions.ConnectionError,具体错误是 ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))。这通常意味着在尝试建立连接时,某些文件或资源无法找到。这可能是因为Docker守护进程没有运行,或者连接时指定的路径不存在。
异常传播: 这个异常随后被 docker.errors.DockerException 包装并再次抛出。这是因为在 DockerClient 的初始化过程中,它依赖于 _retrieve_server_version 来确认Docker服务器的状态,但由于上述错误,这个过程失败了。
Supervisor 启动失败: 由于Docker API无法初始化,Supervisor(一个常用于管理容器和服务的系统)在尝试初始化其Docker管理部分时失败了。Supervisor 的启动过程在 initialize_coresys 方法中遇到错误,并导致整个启动过程中断。
日志解释:
日志错误: 在日志中,首先看到的是一个与上述代码追踪相关的错误,表明在获取服务器API版本时发生了错误。
日志警告和信息: 随后,系统开始记录一系列关于服务停止的信息和警告。s6-rc(一个Unix init系统的替代品)正在停止一系列服务,如 legacy-services、legacy-cont-init 和 fix-attrs。这些服务可能是 Supervisor 的一部分,或者由它管理。
Supervisor 重启: 在停止服务之后,日志记录了一个 Supervisor 重启的警告和信息。这表明系统尝试在错误之后清理环境,并重新启动 Supervisor 以尝试再次初始化。
总结:
代码追踪和日志表明,在尝试初始化Docker API客户端时,由于无法连接到Docker服务器或找不到相关文件,导致了一个连接错误。这个错误中断了 Supervisor 的启动过程,并导致了一系列服务的停止。最后,系统尝试重启 Supervisor 以恢复服务。解决这个问题可能需要检查Docker服务是否正在运行,以及相关的文件路径是否正确。
求指教,是什么依赖没安装,还是这个版本就限制在armbian里安装
|
|