Recorder component fails on 0.42.2

Just updated to 0.42.2 from 0.41 and now the recorder component fails every time I restart with the following error:

Apr 09 14:12:12 raspberrypi2 hass[6359]: 17-04-09 14:12:12 INFO (MainThread) [homeassistant.setup] Setting up logger                                 [100/445]
Apr 09 14:12:14 raspberrypi2 hass[6359]: 17-04-09 14:12:14 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (psycopg2.Programm
ingError) relation "ix_recorder_runs_start_end" already exists
Apr 09 14:12:14 raspberrypi2 hass[6359]: [SQL: 'CREATE INDEX ix_recorder_runs_start_end ON recorder_runs (start, "end")']
Apr 09 14:12:14 raspberrypi2 hass[6359]: 17-04-09 14:12:14 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (psycopg2.Progr
ammingError) relation "ix_recorder_runs_start_end" already exists
Apr 09 14:12:14 raspberrypi2 hass[6359]: [SQL: 'CREATE INDEX ix_recorder_runs_start_end ON recorder_runs (start, "end")'] (retrying in 3 seconds)
Apr 09 14:12:17 raspberrypi2 hass[6359]: 17-04-09 14:12:17 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (psycopg2.Programm
ingError) relation "ix_recorder_runs_start_end" already exists
Apr 09 14:12:17 raspberrypi2 hass[6359]: [SQL: 'CREATE INDEX ix_recorder_runs_start_end ON recorder_runs (start, "end")']
Apr 09 14:12:17 raspberrypi2 hass[6359]: 17-04-09 14:12:17 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (psycopg2.Prog$
ammingError) relation "ix_recorder_runs_start_end" already exists
Apr 09 14:12:17 raspberrypi2 hass[6359]: [SQL: 'CREATE INDEX ix_recorder_runs_start_end ON recorder_runs (start, "end")'] (retrying in 3 seconds)
Apr 09 14:12:20 raspberrypi2 hass[6359]: 17-04-09 14:12:20 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (psycopg2.Programm
ingError) relation "ix_recorder_runs_start_end" already exists
Apr 09 14:12:20 raspberrypi2 hass[6359]: [SQL: 'CREATE INDEX ix_recorder_runs_start_end ON recorder_runs (start, "end")']
Apr 09 14:12:20 raspberrypi2 hass[6359]: 17-04-09 14:12:20 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (psycopg2.Progr
ammingError) relation "ix_recorder_runs_start_end" already exists
Apr 09 14:12:20 raspberrypi2 hass[6359]: [SQL: 'CREATE INDEX ix_recorder_runs_start_end ON recorder_runs (start, "end")'] (retrying in 3 seconds)
Apr 09 14:12:22 raspberrypi2 hass[6359]: 17-04-09 14:12:22 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
Apr 09 14:12:23 raspberrypi2 hass[6359]: 17-04-09 14:12:23 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (psycopg2.Programm
ingError) relation "ix_recorder_runs_start_end" already exists
Setup failed for recorder: Component failed to initialize.
Apr 09 14:12:45 raspberrypi2 hass[6359]: 17-04-09 14:12:45 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of history. Setup failed for
dependencies: recorder
Apr 09 14:12:45 raspberrypi2 hass[6359]: 17-04-09 14:12:45 ERROR (MainThread) [homeassistant.setup] Setup failed for history: Could not setup all dependencies
.
Apr 09 14:12:45 raspberrypi2 hass[6359]: 17-04-09 14:12:45 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of logbook. Setup failed for
dependencies: recorder
Apr 09 14:12:45 raspberrypi2 hass[6359]: 17-04-09 14:12:45 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: Could not setup all dependencies
.

I’m using postgres for the backend (setup using these instructions).

Not really sure where to go from here. Is anyone else experiencing this issue?

I don’t think it is possible to downgrade from 0.42 and keep the database. So you probably have to delete your database if you need to downgrade the version

Sorry that was a typo (now fixed). I upgraded to 0.42.2.

If anyone else runs into this, the only way I could get back up and running was to drop the tables from my postgres db. Not an ideal solution but everything seems to be working fine now.

I upgraded from 41.0 to 42.2 and got the same error. I am on the default sql lite. What tables should I drop?

Ben

Or should I simply delete the database?

With sqlite it’s probably easiest to just delete the database file.

How do you delete the database? I’m on the default SQL lite

Simply delete the file called ‘home-assistant_v2.db’ from the same directory where your configuration.yaml file is.
It probably makes sense to stop HASS for this, but I’m not sure if it’s strictly necessary.