Recorder/database errors after reboot, (Resolved)

Rebooted my Ubuntu 18.04/docker/Hass.io(0.98.3) system to update the OS. And now I’m getting Recorder errors as:

2019-09-04 20:06:23 INFO (MainThread) [homeassistant.setup] Setting up http
2019-09-04 20:06:23 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds.
2019-09-04 20:06:23 INFO (MainThread) [homeassistant.setup] Setting up system_log
2019-09-04 20:06:23 INFO (MainThread) [homeassistant.setup] Setup of domain system_log took 0.0 seconds.
2019-09-04 20:06:23 INFO (MainThread) [homeassistant.setup] Setting up recorder
2019-09-04 20:06:25 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host '15ef4d2f-esphome.local.hass.io' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 20:06:28 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host '15ef4d2f-esphome.local.hass.io' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 20:06:31 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host '15ef4d2f-esphome.local.hass.io' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 20:06:33 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
2019-09-04 20:06:34 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host '15ef4d2f-esphome.local.hass.io' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 20:06:37 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host '15ef4d2f-esphome.local.hass.io' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 20:06:40 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host '15ef4d2f-esphome.local.hass.io' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 20:06:43 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host '15ef4d2f-esphome.local.hass.io' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 20:06:46 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host '15ef4d2f-esphome.local.hass.io' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 20:06:49 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host '15ef4d2f-esphome.local.hass.io' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 20:06:52 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host '15ef4d2f-esphome.local.hass.io' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 20:06:52 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 28.7 seconds.
2019-09-04 20:06:52 ERROR (MainThread) [homeassistant.setup] Setup failed for recorder: Integration failed to initialize.
2019-09-04 20:06:53 INFO (MainThread) [homeassistant.setup] Setting up zwave
2019-09-04 20:06:53 INFO (MainThread) [homeassistant.setup] Setup of domain zwave took 0.0 seconds.
2019-09-04 20:06:57 INFO (MainThread) [homeassistant.components.zwave] Z-Wave USB path is /dev/serial/by-id/usb-0658_0200-if00
___SNIP___
2019-09-04 20:30:54 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of history. Setup failed for dependencies: recorder
2019-09-04 20:30:54 ERROR (MainThread) [homeassistant.setup] Setup failed for history: Could not set up all dependencies.

My MariaDB config:

{
  "databases": [
    "homeassistant"
  ],
  "logins": [
    {
      "username": "hass",
      "host": "homeassistant",
      "password": "secretpassword"
    }
  ],
  "rights": [
    {
      "username": "hass",
      "host": "homeassistant",
      "database": "homeassistant",
      "grant": "ALL PRIVILEGES ON"
    }
  ]
}

And the bits in HA config:

recorder:
  db_url: mysql://hass:secretpassword@core-mariadb/homeassistant?charset=utf8
  purge_keep_days: 90
  exclude:
    entities:
      - sensor.date
      - sensor.time

No errors in MariaDB logs.
Why/what is (Host ‘15ef4d2f-esphome.local.hass.io’) trying to connect and borking the recorder?

Help please.

1 Like

If I change the recorder settings to:

recorder:
  #db_url: mysql://hass:secretpassword@core-mariadb/homeassistant?charset=utf8
  db_url: mysql://hass:[email protected]/homeassistant?charset=utf8

By changing to the IP of my system running Hass.io I see a difference in the error:

2019-09-04 21:37:07 INFO (MainThread) [homeassistant.setup] Setting up recorder
2019-09-04 21:37:09 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host 'Hyper-hass-Zotac.j_yard.home' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 21:37:12 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host 'Hyper-hass-Zotac.j_yard.home' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 21:37:15 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host 'Hyper-hass-Zotac.j_yard.home' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 21:37:17 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
2019-09-04 21:37:18 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host 'Hyper-hass-Zotac.j_yard.home' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 21:37:21 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host 'Hyper-hass-Zotac.j_yard.home' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 21:37:24 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host 'Hyper-hass-Zotac.j_yard.home' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 21:37:27 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host 'Hyper-hass-Zotac.j_yard.home' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 21:37:30 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host 'Hyper-hass-Zotac.j_yard.home' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 21:37:33 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host 'Hyper-hass-Zotac.j_yard.home' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 21:37:36 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1130, "Host 'Hyper-hass-Zotac.j_yard.home' is not allowed to connect to this MariaDB server")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2019-09-04 21:37:36 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 28.7 seconds.
2019-09-04 21:37:36 ERROR (MainThread) [homeassistant.setup] Setup failed for recorder: Integration failed to initialize.
2019-09-04 21:37:36 INFO (MainThread) [homeassistant.setup] Setting up group

“hyper-hass-zotac.j_yard.home” is the actual host name of the system running.
I’m still stumped.

Ok I think i got it.

After changing the config:

recorder:
  #db_url: mysql://hass:secretpassword@core-mariadb/homeassistant?charset=utf8
  db_url: mysql://hass:[email protected]/homeassistant?charset=utf8

And seeing the error change. I started play with the DB config and changed the host name to “hyper-hass-zotac.j_yard.home” :

{
  "databases": [
    "homeassistant"
  ],
  "logins": [
    {
      "username": "hass",
      "host": "homeassistant",
      "password": "password1313"
    }
  ],
  "rights": [
    {
      "username": "hass",
      "host": "hyper-hass-zotac.j_yard.home",
      "database": "homeassistant",
      "grant": "ALL PRIVILEGES ON"
    }
  ]
}

And it seems to work as before.

I’m sure if I left the HA config as:

recorder:
  db_url: mysql://hass:secretpassword@core-mariadb/homeassistant?charset=utf8

And then changed the DB config to:

 "rights": [
    {
      "username": "hass",
      "host": "15ef4d2f-esphome.local.hass.io",  <-- Old error host name
      "database": "homeassistant",
      "grant": "ALL PRIVILEGES ON"
    }

Things would work as before the reboot.

However, why? And where is " 15ef4d2f-esphome.local.hass.io " host name coming from?
I did not change the main HA config or the DB config. I Just updated the OS of the system.

DNS bug ?
I have come across a few threads mentioning some sort of dns bug, I did not read them through to the end. Read them just out of curiosity.

Edit:
Reading deeper. looks to be related to a hass.io supervisor update.
E2:
Reading this thread,
Name resolution problem since 0.97.2
Answers all my questions.

2 Likes