Ido-mysql exception

After a system failure, I managed to restore the icinga2 database from backup. Since then, even simple acknowledgments from icingaweb2 don’t seem to work. Metrics for services are OK as well as notifications for alerts. I have the below errors in the log from time to time.

[2022-10-19 15:58:16 +0300] information/IdoMysqlConnection: MySQL IDO instance id: 1 (schema version: ‘1.15.1’)
[2022-10-19 15:58:17 +0300] information/IdoMysqlConnection: Finished reconnecting to ‘ido-mysql’ database ‘icinga2’ in 0.72158 second(s).
[2022-10-19 15:58:18 +0300] critical/IdoMysqlConnection: Error “Duplicate entry ‘94832’ for key ‘icinga_statehistory.PRIMARY’” when executing query "UPDATE icinga_servicestatus SET

This doesn’t seem to be authentication problem, and most features seem to work correctly. Where can I look to find the cause of this ?
I run mysqlcheck on all databases and all is OK.

  • Icinga DB Web version (System - About):
  • Icinga Web 2 version (System - About): 2.11.1
  • Web browser: any
  • Icinga 2 version (icinga2 --version): r2.13.5-1
  • Icinga DB version (icingadb --version):
  • PHP version used (php --version): 7.4.3
  • Server operating system and version: Ubuntu 20.04

Thanks

Anybody any Ideas ?

I tried dumping the db and re-creating in mysql but still the same error.