core: 0.113.0b0 - HA not starting up after update

The problem

Upon updating to 0.113.0b0 the frontend starts up, but it is still always showing the following message: Home Assistant is starting, not everything will be available until it is finished.

Now 0.113.0b1 is available, but the update button is not working.

Environment

  • Home Assistant Core release with the issue: 0.113.0b0
  • Last working Home Assistant Core release (if known): 0.112.4
  • Operating environment (OS/Container/Supervised/Core): Supervised
  • Hardware: Synology NAS
  • Database: MariaDB
arch x86_64
chassis
dev false
docker true
docker_version 18.09.8
hassio true
host_os
installation_type Home Assistant Supervised
os_name Linux
os_version 4.4.59+
python_version 3.8.3
supervisor 229
timezone Europe/Moscow
version 0.113.0b0
virtualenv false

Problem-relevant configuration.yaml


Traceback/Error logs

Log Details (ERROR)
Logger: aiohttp.server
Source: components/recorder/util.py:75
First occurred: July 16, 2020, 10:30:52 PM (2 occurrences)
Last logged: 8:44:45 AM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1205, in _execute_context
    context = constructor(dialect, self, conn, *args)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 806, in _init_compiled
    self.cursor = self.create_cursor()
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 1162, in create_cursor
    return self._dbapi_connection.cursor()
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 1000, in cursor
    return self.connection.cursor(*args, **kwargs)
AttributeError: 'NoneType' object has no attribute 'cursor'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/history/__init__.py", line 499, in get
    await hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/history/__init__.py", line 525, in _sorted_significant_states_json
    result = _get_significant_states(
  File "/usr/src/homeassistant/homeassistant/components/history/__init__.py", line 141, in _get_significant_states
    states = execute(
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 75, in execute
    result = list(qry)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/ext/baked.py", line 445, in __iter__
    return q._execute_and_instances(context)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3528, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1014, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1127, in _execute_clauseelement
    ret = self._execute_context(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1207, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
    util.raise_(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1205, in _execute_context
    context = constructor(dialect, self, conn, *args)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 806, in _init_compiled
    self.cursor = self.create_cursor()
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 1162, in create_cursor
    return self._dbapi_connection.cursor()
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 1000, in cursor
    return self.connection.cursor(*args, **kwargs)
sqlalchemy.exc.StatementError: (builtins.AttributeError) 'NoneType' object has no attribute 'cursor'
[SQL: SELECT states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated 
FROM states 
WHERE (states.domain IN (%s, %s, %s, %s, %s) OR states.last_changed = states.last_updated) AND states.last_updated > %s AND states.entity_id IN ([EXPANDING_entity_ids]) AND states.last_updated < %s ORDER BY states.entity_id, states.last_updated]
[parameters: [{'start_time': datetime.datetime(2020, 7, 14, 19, 30, 50, 656000, tzinfo=<UTC>), 'end_time': datetime.datetime(2020, 7, 16, 19, 30, 50, 656000, tzinfo=<UTC>), 'entity_ids': ['sensor.u_s_main_pollutant']}]]

System log

Log provider Supervisor

20-07-16 15:52:49 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 16:22:50 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 16:51:34 INFO (MainThread) [supervisor.snapshots] Found 9 snapshot files
20-07-16 16:51:34 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/beta.json
20-07-16 16:51:34 ERROR (MainThread) [supervisor.snapshots.snapshot] Can't read snapshot tarfile /data/backup/6c72ff4e.tar: unexpected end of data
20-07-16 16:52:52 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 16:52:52 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 17:22:54 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 17:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/hassio-addons repository
20-07-16 17:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
20-07-16 17:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/pschmitt/home-assistant-addons repository
20-07-16 17:51:36 INFO (MainThread) [supervisor.store] Load add-ons from store: 70 all - 0 new - 0 remove
20-07-16 17:52:55 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 17:58:14 INFO (MainThread) [supervisor.host.sound] Update PulseAudio information
20-07-16 18:22:57 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 18:22:57 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 18:51:34 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/beta.json
20-07-16 18:52:59 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 18:52:59 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 19:23:01 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 19:23:01 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 19:53:03 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 19:53:03 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 20:04:54 INFO (MainThread) [supervisor.host.sound] Update PulseAudio information
20-07-16 20:23:05 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 20:51:34 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/beta.json
20-07-16 20:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/pschmitt/home-assistant-addons repository
20-07-16 20:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
20-07-16 20:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/hassio-addons repository
20-07-16 20:51:36 INFO (MainThread) [supervisor.store] Load add-ons from store: 70 all - 0 new - 0 remove
20-07-16 20:53:07 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 21:23:09 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 21:53:11 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 22:11:34 INFO (MainThread) [supervisor.host.sound] Update PulseAudio information
20-07-16 22:23:12 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 22:51:34 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/beta.json
20-07-16 22:53:14 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 22:53:14 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 23:23:16 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 23:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
20-07-16 23:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/hassio-addons repository
20-07-16 23:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/pschmitt/home-assistant-addons repository
20-07-16 23:51:36 INFO (MainThread) [supervisor.store] Load add-ons from store: 70 all - 0 new - 0 remove
20-07-16 23:53:18 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-16 23:53:18 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 00:18:14 INFO (MainThread) [supervisor.host.sound] Update PulseAudio information
20-07-17 00:23:20 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 00:23:20 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 00:51:34 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/beta.json
20-07-17 00:53:22 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 00:53:22 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 01:23:25 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 01:53:26 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 02:23:29 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 02:23:29 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 02:24:54 INFO (MainThread) [supervisor.host.sound] Update PulseAudio information
20-07-17 02:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
20-07-17 02:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/pschmitt/home-assistant-addons repository
20-07-17 02:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/hassio-addons repository
20-07-17 02:51:34 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/beta.json
20-07-17 02:51:36 INFO (MainThread) [supervisor.store] Load add-ons from store: 70 all - 0 new - 0 remove
20-07-17 02:53:30 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 02:53:30 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 03:23:32 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 03:23:32 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 03:53:36 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 03:53:36 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 04:23:38 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 04:23:38 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 04:31:34 INFO (MainThread) [supervisor.host.sound] Update PulseAudio information
20-07-17 04:51:34 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/beta.json
20-07-17 04:53:40 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 05:23:42 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 05:44:56 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress
20-07-17 05:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/hassio-addons repository
20-07-17 05:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
20-07-17 05:51:34 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/pschmitt/home-assistant-addons repository
20-07-17 05:51:36 INFO (MainThread) [supervisor.store] Load add-ons from store: 70 all - 0 new - 0 remove
20-07-17 05:53:44 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 05:53:44 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 06:23:46 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 06:23:46 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 06:38:14 INFO (MainThread) [supervisor.host.sound] Update PulseAudio information
20-07-17 06:51:34 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/beta.json
20-07-17 06:53:48 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 06:53:48 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 06:57:55 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress
20-07-17 06:58:09 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress
20-07-17 06:58:09 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress
20-07-17 06:58:09 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress
20-07-17 06:58:16 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress
20-07-17 06:58:16 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress
20-07-17 06:58:17 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress
20-07-17 06:58:17 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress
20-07-17 06:58:32 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress
20-07-17 07:18:26 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress
20-07-17 07:18:27 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress
20-07-17 07:23:49 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 07:23:49 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-17 07:39:18 ERROR (MainThread) [supervisor.utils] Can't execute update while a task is in progress

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (16 by maintainers)

Most upvoted comments

@elad-bar the problem is your data manager https://github.com/elad-bar/ha-edgeos/blob/a395fc3bae318d01c4300d62df698e264abd35ef/custom_components/edgeos/managers/data_manager.py#L70-L74

You use async_call_later with 2 seconds. However, if Home Assistant starts up takes longer than 2 seconds, you are now running a never ending job during startup. Opened a PR with a fix https://github.com/elad-bar/ha-edgeos/pull/36

Using hass.loop.create_task will bypass Home Assistant tracking system which is what should be done for long living tasks.