Closed saschaludwig closed 2 months 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)
Heh, looks like we got to the same place around the same time: https://github.com/home-assistant/core/issues/120115
The ids are all Integer
which works fine for sqlite, but can overflow since its a lot easier to hit the max with mariadb/postgresql
I see the merged change above relating to the legacy foreign key constraint, but unless I missed something in that MR, it seems like we also need a type change for the states table ID column under Postgres and MySQL to use a 64-bit value.
That PR solved an unrelated problem. This issue has not been worked on yet
fix is targeted for 2024.8.x
The problem
I'm getting a lot of
psycopg2.errors.SequenceGeneratorLimitExceeded: nextval: reached maximum value of sequence "states_state_id_seq" (2147483647)
errors and the recorder is unable to write any new history data into the Postgres DB.Here is my recorder config:
Is there anything I can do on the short term, or do I have to wait for a fix/migration of the DB to alter the field type to BIGINT for example.
My Postgres DB is only <1 year old, what can be done in the long term to don't run into this again?
What version of Home Assistant Core has the issue?
core-2024.6.1
What was the last working version of Home Assistant Core?
No response
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