Updating core keeps failing with 'unknown error': check supervisor logs

Hi,

Hopefully somebody can help me out. I can’t update my home assistant core to the latest version ( core-2021.5.5 ). Currently on core-2021.5.0

The supervisor keeps throwing strange logs which don’t make any sense to me.

21-05-21 20:44:54 ERROR (SyncWorker_7) [supervisor.docker.interface] Can't install homeassistant/raspberrypi4-homeassistant:2021.5.5 -> 404 Client Error for http+docker://localhost/v1.40/images/homeassistant/raspberrypi4-homeassistant:2021.5.5/json: Not Found ("no such image: homeassistant/raspberrypi4-homeassistant:2021.5.5: No such image: homeassistant/raspberrypi4-homeassistant:2021.5.5").
21-05-21 20:44:54 WARNING (MainThread) [supervisor.homeassistant.core] Updating Home Assistant image failed
21-05-21 20:44:54 INFO (MainThread) [supervisor.resolution.module] Create new issue IssueType.UPDATE_FAILED - ContextType.CORE / None
21-05-21 20:46:02 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-3660' coro=<Scheduler._run_task.<locals>._wrap_task() done, defined at /usr/src/supervisor/supervisor/misc/scheduler.py:58> exception=TypeError('an integer is required (got type str)')>



  File "/usr/src/supervisor/supervisor/addons/addon.py", line 479, in watchdog_application
    return await self.sys_run_in_executor(check_port, self.ip_address, port)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 43, in check_port
    result = sock.connect_ex((str(address), port))
TypeError: an integer is required (got type str)
21-05-21 01:42:33 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-7898938' coro=<Scheduler._run_task.<locals>._wrap_task() done, defined at /usr/src/supervisor/supervisor/misc/scheduler.py:58> exception=TypeError('an integer is required (got type str)')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/misc/scheduler.py", line 62, in _wrap_task
    await task.coro_callback()
  File "/usr/src/supervisor/supervisor/misc/tasks.py", line 416, in _watchdog_addon_application
    if addon.in_progress or await addon.watchdog_application():
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 479, in watchdog_application
    return await self.sys_run_in_executor(check_port, self.ip_address, port)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 43, in check_port
    result = sock.connect_ex((str(address), port))
TypeError: an integer is required (got type str)
21-05-21 01:44:33 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-7899709' coro=<Scheduler._run_task.<locals>._wrap_task() done, defined at /usr/src/supervisor/supervisor/misc/scheduler.py:58> exception=TypeError('an integer is required (got type str)')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/misc/scheduler.py", line 62, in _wrap_task
    await task.coro_callback()
  File "/usr/src/supervisor/supervisor/misc/tasks.py", line 416, in _watchdog_addon_application
    if addon.in_progress or await addon.watchdog_application():
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 479, in watchdog_application
    return await self.sys_run_in_executor(check_port, self.ip_address, port)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 43, in check_port
    result = sock.connect_ex((str(address), port))
TypeError: an integer is required (got type str)
21-05-21 20:15:35 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-57390' coro=<Scheduler._run_task.<locals>._wrap_task() done, defined at /usr/src/supervisor/supervisor/misc/scheduler.py:58> exception=TypeError('an integer is required (got type str)')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/misc/scheduler.py", line 62, in _wrap_task
    await task.coro_callback()
  File "/usr/src/supervisor/supervisor/misc/tasks.py", line 416, in _watchdog_addon_application
    if addon.in_progress or await addon.watchdog_application():
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 479, in watchdog_application
    return await self.sys_run_in_executor(check_port, self.ip_address, port)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 43, in check_port
    result = sock.connect_ex((str(address), port))
TypeError: an integer is required (got type str)
21-05-21 20:17:35 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-58259' coro=<Scheduler._run_task.<locals>._wrap_task() done, defined at /usr/src/supervisor/supervisor/misc/scheduler.py:58> exception=TypeError('an integer is required (got type str)')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/misc/scheduler.py", line 62, in _wrap_task
    await task.coro_callback()
  File "/usr/src/supervisor/supervisor/misc/tasks.py", line 416, in _watchdog_addon_application
    if addon.in_progress or await addon.watchdog_application():
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 479, in watchdog_application
    return await self.sys_run_in_executor(check_port, self.ip_address, port)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 43, in check_port
    result = sock.connect_ex((str(address), port))
TypeError: an integer is required (got type str)
21-05-21 20:19:10 ERROR (SyncWorker_7) [supervisor.docker.interface] Can't install homeassistant/raspberrypi4-homeassistant:2021.5.5 -> 404 Client Error for http+docker://localhost/v1.40/images/homeassistant/raspberrypi4-homeassistant:2021.5.5/json: Not Found ("no such image: homeassistant/raspberrypi4-homeassistant:2021.5.5: No such image: homeassistant/raspberrypi4-homeassistant:2021.5.5").
21-05-21 20:19:10 WARNING (MainThread) [supervisor.homeassistant.core] Updating Home Assistant image failed
21-05-21 20:19:35 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-59108' coro=<Scheduler._run_task.<locals>._wrap_task() done, defined at /usr/src/supervisor/supervisor/misc/scheduler.py:58> exception=TypeError('an integer is required (got type str)')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/misc/scheduler.py", line 62, in _wrap_task
    await task.coro_callback()
  File "/usr/src/supervisor/supervisor/misc/tasks.py", line 416, in _watchdog_addon_application
    if addon.in_progress or await addon.watchdog_application():
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 479, in watchdog_application
    return await self.sys_run_in_executor(check_port, self.ip_address, port)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 43, in check_port
    result = sock.connect_ex((str(address), port))
TypeError: an integer is required (got type str)

Does someone know what these errors mean? My system is pretty unstable also, it is working ‘sort-of’ but alot of error messages appear in the home assistant logbook about the recoder also :

Database connection invalidated: Error executing query: (MySQLdb._exceptions.OperationalError) (2013, 'Lost connection to MySQL server during query') [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)] [parameters: ('state_changed', '{}', 'LOCAL', datetime.datetime(2021, 5, 21, 19, 51, 32, 199601, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 5, 21, 19, 51, 32, 199601, tzinfo=datetime.timezone.utc), '281eab5be4b0af5515c05a83b809de93', None, None)] (Background on this error at: http://sqlalche.me/e/14/e3q8). (retrying in 3 seconds)
22:27:36 – (FOUT) Recorder - bericht kwam voor het eerst om 20:06:19 en verschijnt 2350 keer
SQLAlchemyError error processing event <Event time_changed[L]: now=2021-05-21T21:56:13.000771+02:00>: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on 'core-mariadb' (115)") (Background on this error at: http://sqlalche.me/e/14/e3q8) (Background on this error at: http://sqlalche.me/e/14/7s2a)
22:27:36 – (FOUT) Recorder - bericht kwam voor het eerst om 20:06:22 en verschijnt 2349 keer
Unhandled database error while processing event <Event time_changed[L]: now=2021-05-21T21:54:14.001899+02:00>: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on 'core-mariadb' (115)") (Background on this error at: http://sqlalche.me/e/14/e3q8)
22:27:24 – (FOUT) Recorder - bericht kwam voor het eerst om 20:08:56 en verschijnt 26 keer
Update for sensor.average_weekly_outside_temperature fails
22:27:24 – (FOUT) components/recorder/util.py - bericht kwam voor het eerst om 20:06:24 en verschijnt 374 keer
Error executing query: Can't reconnect until invalid transaction is rolled back. (Background on this error at: http://sqlalche.me/e/14/8s2b)
22:27:24 – (FOUT) Recorder - bericht kwam voor het eerst om 20:02:21 en verschijnt 571 keer
Error executing query: Can't reconnect until invalid transaction is rolled back. (Background on this error at: http://sqlalche.me/e/14/8s2b)
22:27:24 – (FOUT) Recorder - bericht kwam voor het eerst om 20:02:21 en verschijnt 1816 keer
Error handling request
22:27:19 – (FOUT) components/recorder/util.py - bericht kwam voor het eerst om 20:02:21 en verschijnt 35 keer
socket.send() raised exception.
22:24:44 – (WAARSCHUWING) /usr/local/lib/python3.8/asyncio/selector_events.py - bericht kwam voor het eerst om 22:24:44 en verschijnt 4 keer
Cannot poll Toon using url: http://192.168.178.16:10080/hdrv_zwave?action=getDevices.json
22:21:57 – (FOUT) toon_smartmeter (aangepaste integratie)
Update for sensor.average_daily_inside_temperature fails
22:21:26 – (FOUT) components/recorder/util.py - bericht kwam voor het eerst om 20:06:24 en verschijnt 12 keer
Update for sensor.average_daily_outside_temperature fails
22:19:54 – (FOUT) components/recorder/util.py - bericht kwam voor het eerst om 20:06:53 en verschijnt 133 keer
Error handling request
22:19:39 – (FOUT) components/recorder/util.py - bericht kwam voor het eerst om 20:02:21 en verschijnt 16 keer
Failed to to call /core/update - Unknown error, see supervisor
22:19:10 – (FOUT) Home Assistant Supervisor - bericht kwam voor het eerst om 20:06:18 en verschijnt 6 keer
Timeout on /supervisor/stats request
22:18:24 – (FOUT) Home Assistant Supervisor - bericht kwam voor het eerst om 22:17:23 en verschijnt 2 keer
[2762864264] Client unable to keep up with pending messages. Stayed over 512 for 5 seconds
22:15:17 – (FOUT) Home Assistant WebSocket API - bericht kwam voor het eerst om 21:20:37 en verschijnt 4 keer
Exception during reset or similar
22:06:23 – (FOUT) /usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py
Can't connect to ESPHome API for servotest (192.168.178.49): Error connecting to ('192.168.178.49', 6053): [Errno 113] Connect call failed ('192.168.178.49', 6053)
22:06:02 – (WAARSCHUWING) ESPHome - bericht kwam voor het eerst om 19:50:56 en verschijnt 4 keer
Hal aan: Already running
21:29:52 – (WAARSCHUWING) Automatisering
Unable to find referenced entities light.eettafel
21:27:24 – (WAARSCHUWING) helpers/service.py
Error handling request
20:51:43 – (FOUT) components/recorder/util.py
Updating average sensor took longer than the scheduled update interval 0:00:30
20:17:52 – (WAARSCHUWING) Sensor - bericht kwam voor het eerst om 19:51:52 en verschijnt 17 keer
Update of sensor.average_weekly_inside_temperature is taking over 10 seconds
20:14:32 – (WAARSCHUWING) helpers/entity.py - bericht kwam voor het eerst om 19:51:23 en verschijnt 4 keer
Timeout fetching light data
19:52:16 – (FOUT) Philips Hue
Timeout fetching sensor data
19:52:16 – (FOUT) Philips Hue
Error doing job: Task exception was never retrieved
19:51:48 – (FOUT) components/google_assistant/http.py - bericht kwam voor het eerst om 19:51:09 en verschijnt 2 keer
TemplateError('ZeroDivisionError: float division by zero') while processing template 'Template("{{(states('sensor.daily_gas')|float / states('sensor.graaddag')|float)| round(2)}}")' for attribute '_state' in entity 'sensor.graaddag_kuub'
19:51:09 – (FOUT) Template - bericht kwam voor het eerst om 19:51:09 en verschijnt 2 keer
Error while processing template: Template("{{(states('sensor.daily_gas')|float / states('sensor.graaddag')|float)| round(2)}}")
19:51:09 – (FOUT) helpers/template.py - bericht kwam voor het eerst om 19:51:09 en verschijnt 2 keer
Config entry 'Canon TS700 series' for ipp integration not ready yet: Invalid response from API: Error occurred while communicating with IPP server.; Retrying in background
19:51:00 – (WAARSCHUWING) config_entries.py - bericht kwam voor het eerst om 19:50:53 en verschijnt 2 keer
Received message for unregistered webhook fa090944953d27eaa20aee013a980e22da8e4630bc393ae8acc57c071eb0a06d from 89.220.146.76
19:50:50 – (WAARSCHUWING) Webhook - bericht kwam voor het eerst om 19:50:50 en verschijnt 12 keer
You are using a custom integration miio2 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
19:50:50 – (WAARSCHUWING) loader.py - bericht kwam voor het eerst om 19:50:45 en verschijnt 5 keer
No 'version' key in the manifest file for custom integration 'miio2'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'miio2'
19:50:50 – (FOUT) loader.py - bericht kwam voor het eerst om 19:50:45 en verschijnt 2 keer
Ended unfinished session (id=252 from 2021-05-20 08:13:48)
19:50:40 – (WAARSCHUWING) Recorder

I have not changed anything noticeably when these errors start to happen.

1 Like

I´m not sure if the error really prevents the update, or if something else is wrong. Since I´m on core-2021.5.5 I get the same error message. The message appears every 2 minutes and spams my log. No clue how to fix it.

21-05-22 08:50:46 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-25178' coro=<Scheduler._run_task.<locals>._wrap_task() done, defined at /usr/src/supervisor/supervisor/misc/scheduler.py:58> exception=TypeError('an integer is required (got type str)')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/misc/scheduler.py", line 62, in _wrap_task
    await task.coro_callback()
  File "/usr/src/supervisor/supervisor/misc/tasks.py", line 416, in _watchdog_addon_application
    if addon.in_progress or await addon.watchdog_application():
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 479, in watchdog_application
    return await self.sys_run_in_executor(check_port, self.ip_address, port)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 43, in check_port
    result = sock.connect_ex((str(address), port))
TypeError: an integer is required (got type str)

I see exactly the same error after last supervisor update. However, the system seems to work still

Same issue here and I’m not sure what’s causing it either.

Same error message here on the RPi. Also have HA running in a VM with the same version of Supervisor, but there the error message does not appear.

Same error here. Did you update MQTT addon perhaps?

I’ve noticed that not being able to update + the unstable system is related to a worn out SD-card. I’ve migrated( fresh install ) my whole HA to a SSD setup. After that I was able to do all the neccesary updates, and everything is stable again.

However these errors still occur in the log :

21-05-25 08:52:38 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-1294743' coro=<Scheduler._run_task.<locals>._wrap_task() done, defined at /usr/src/supervisor/supervisor/misc/scheduler.py:58> exception=TypeError('an integer is required (got type str)')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/misc/scheduler.py", line 62, in _wrap_task
    await task.coro_callback()
  File "/usr/src/supervisor/supervisor/misc/tasks.py", line 416, in _watchdog_addon_application
    if addon.in_progress or await addon.watchdog_application():
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 479, in watchdog_application
    return await self.sys_run_in_executor(check_port, self.ip_address, port)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 43, in check_port
    result = sock.connect_ex((str(address), port))
TypeError: an integer is required (got type str)
21-05-25 08:54:38 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-1295265' coro=<Scheduler._run_task.<locals>._wrap_task() done, defined at /usr/src/supervisor/supervisor/misc/scheduler.py:58> exception=TypeError('an integer is required (got type str)')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/misc/scheduler.py", line 62, in _wrap_task
    await task.coro_callback()
  File "/usr/src/supervisor/supervisor/misc/tasks.py", line 416, in _watchdog_addon_application
    if addon.in_progress or await addon.watchdog_application():
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 479, in watchdog_application
    return await self.sys_run_in_executor(check_port, self.ip_address, port)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 43, in check_port
    result = sock.connect_ex((str(address), port))
TypeError: an integer is required (got type str)

Same problem here.
I have a SSD installed on a Pi-4.
I have no idea how to solve this…

HI,
same here without any clue on what is causing

21-05-28 00:40:48 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-40044' coro=<Scheduler._run_task.<locals>._wrap_task() done, defined at /usr/src/supervisor/supervisor/misc/scheduler.py:58> exception=TypeError('an integer is required (got type str)')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/misc/scheduler.py", line 62, in _wrap_task
    await task.coro_callback()
  File "/usr/src/supervisor/supervisor/misc/tasks.py", line 416, in _watchdog_addon_application
    if addon.in_progress or await addon.watchdog_application():
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 479, in watchdog_application
    return await self.sys_run_in_executor(check_port, self.ip_address, port)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 43, in check_port
    result = sock.connect_ex((str(address), port))
TypeError: an integer is required (got type str)

UPDATE:
Its the Mosquto broker addon
see 2021.5: Stability, performance, triggers, color modes! - #379 by ludeeus