home-assistant / supervisor

:house_with_garden: Home Assistant Supervisor
https://home-assistant.io/hassio/
Apache License 2.0
1.73k stars 630 forks source link

amd64-hassio-supervisor in docker Repeatedly restart #4803

Closed be-engineer closed 6 months ago

be-engineer commented 8 months ago

Describe the issue you are experiencing

I installed amd64-hassio-supervisor in pve docker with portnainer.
ha version is [ghcr.io/home-assistant/amd64-hassio-supervisor:latest] The container automatically restarts every few seconds,can not enter web gui at all. What can I do?

What type of installation are you running?

Home Assistant Supervised

Which operating system are you running on?

Debian

Steps to reproduce the issue

  1. Use portainer pull [ghcr.io/home-assistant/amd64-hassio-supervisor:latest]
  2. create container and start container. The container automatically restarts every few seconds,can not enter web gui at all.

Anything in the Supervisor logs that might be useful for us?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/docker/api/client.py", line 213, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
                        ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/utils/decorators.py", line 44, in inner
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/api/client.py", line 236, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/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 45, in <module>
    coresys = loop.run_until_complete(bootstrap.initialize_coresys())
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, 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.11/site-packages/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/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.11/logging/handlers.py", line 1498, 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.11/logging/handlers.py", line 1482, in prepare
    record = copy.copy(record)
             ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/copy.py", line 92, in copy
    rv = reductor(4)
         ^^^^^^^^^^^
ImportError: sys.meta_path is None, Python is likely shutting down
Call stack:
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 363, in __del__
    self._loop.call_exception_handler(context)
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1797, in call_exception_handler
    self.default_exception_handler(context)
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1771, in default_exception_handler
    logger.error('\n'.join(log_lines), exc_info=exc_info)
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1518, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1634, in _log
    self.handle(record)
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1644, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1706, 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 0x7fe72597f9d0>'
Arguments: ()
[07:27:56] WARNING: Halt Supervisor
[07:27:56] INFO: Supervisor restart after closing
s6-rc: info: service legacy-services: stopping
[07:27:56] 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

...

System Health information

Can not open ha web page

Supervisor diagnostics

No response

Additional information

No response

ArsathSally commented 8 months ago

I am getting the same error , I tried installing a repo from two months ago and the same issue persists.

iHaiduk commented 7 months ago

+1

github-actions[bot] commented 6 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.