Closed astrosteve0 closed 1 month ago
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (recorder
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
recorder documentation recorder source (message by IssueLinks)
https://www.home-assistant.io/integrations/recorder#mariadb-and-mysql
Make sure you are using innodb
myiasm is not supporyed
When I switched to MySQL, I hadn't seen those instructions in your link, so did none of that. I checked several of the tables in phpMyAdmin, and they are innodb already. Then I thought I'd run the create table statement HA was failing on right inside phpMyAdmin, only I added the ENGINE and CHARSET statements as below:
CREATE TABLE migration_changes ( migration_id VARCHAR(255) NOT NULL, version SMALLINT NOT NULL, PRIMARY KEY (migration_id) ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4
The above worked fine with no errors. I rebooted HA, and it also added a field to the table "states". One more thing to check, I changed the name of the table to create to something else, and removed the ENGINE and CHARSET statements, and then it failed with the same error I got in HA. I think you just need to add the ENGINE and CHARSET statements to your create table code, and the bug would go away.
One more note: running the statement:
SET GLOBAL default_storage_engine = 'InnoDB';
Then running the create table statement without the ENGINE and CHARSET statements does work. I found the setting under MySQL/MySQL Settings default_storage_engine, and changed it to InnoDB, so this should be permanent. Hopefully this helps someone else that may have this issue.
The problem
I updated from what was the latest version to 2024.4.0 this morning, and the recorder fails. This was working great before, and the only update I did was to 2024.4.0, using HA on W11 inside a VM VirtualBox. I run the database on MySQL 8.3.0.
What version of Home Assistant Core has the issue?
2024.4.0
What was the last working version of Home Assistant Core?
2024.3.3
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Recorder
Link to integration documentation on our website
https://www.home-assistant.io/integrations/recorder
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response