I just tried to upgrade my Hassbian instance (RPi3) to 0.76.2. Hass wouldn’t restart for a long time, then finally the UI appeared. Following error showing in the log:
2018-08-25 18:19:58 WARNING (Recorder) [homeassistant.components.recorder.migration] Database requires upgrade. Schema version: 5
2018-08-25 18:20:01 WARNING (Recorder) [homeassistant.components.recorder.migration] Column context_id already exists on events, continueing
2018-08-25 18:20:01 WARNING (Recorder) [homeassistant.components.recorder.migration] Column context_user_id already exists on events, continueing
2018-08-25 18:20:01 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (_mysql_exceptions.OperationalError) (1061, "Duplicate key name 'ix_events_context_id'") [SQL: 'CREATE INDEX ix_events_context_id ON events (context_id)'] (Background on this error at: http://sqlalche.me/e/e3q8)
2018-08-25 18:20:01 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (_mysql_exceptions.OperationalError) (1061, "Duplicate key name 'ix_events_context_id'") [SQL: 'CREATE INDEX ix_events_context_id ON events (context_id)'] (Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds
I see there’s a reference to this problem in the Release Notes, but I have no idea what I’m supposed to do to fix. Can anyone please help me out?
@Neild1968 One of the most important things to do BEFORE you update is to read about what changes are being implemented along with any breaking changes.
"This release has a migration, initial startup can take ~20 minutes (depends on size DB)
This release includes a database migration to allow us to store context in the database. This will make it possible in the future to introduce attribution. For example, we’ll be able to say which user opened the garage door or which automation triggered the party mode at 3am."