You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The upgrade_59.sql migration fails, resulting in [db] component changed from idle to failed.
The migration tries to add a new primary key to the instance_uuid and ts_create columns of the vspheredb_daemonlog table.
The problem is that existing databases can already contain entries where those columns are not unique - since ts_create was handled differently before e14d363.
For example:
MariaDB [icinga_vspheredb]> select * from vspheredb_daemonlog;
+---------------+------------------------------------+------+--------------------+--------------+---------+-----------------------------------------------------+
| ts_create | instance_uuid | pid | fqdn | vcenter_uuid | level | message |
+---------------+------------------------------------+------+--------------------+--------------+---------+-----------------------------------------------------+
| 1699959383103 | 0xD6A86DF6F4F7409391BFB41B93CFC564 | 7116 | master.example.com | 0x | notice | [db] DB has been cleaned up |
| 1699959383103 | 0xD6A86DF6F4F7409391BFB41B93CFC564 | 7116 | master.example.com | 0x | notice | [db] Running DB cleanup (this could take some time) |
| 1699959383103 | 0xD6A86DF6F4F7409391BFB41B93CFC564 | 7116 | master.example.com | 0x | notice | [db] DB schema is ready |
| 1699959382773 | 0xD6A86DF6F4F7409391BFB41B93CFC564 | 7116 | master.example.com | 0x | notice | [db] Applying schema migrations |
Steps to Reproduce (for bugs)
Install the current master (a700003 at the time of writing).
enable verbose output by setting ExecStart=/usr/bin/icingacli vspheredb daemon run --trace --debug via systemctl edit --full icinga-vspheredb.service
systemctl daemon-reload
systemctl restart icinga-vspheredb.service
journalctl -feu icinga-vspheredb.service
Manually try to execute the migration:
mysql --user=icinga_vspheredb_user --password icinga_vspheredb < /usr/share/icingaweb2/modules/vspheredb/schema/mysql-migrations/upgrade_59.sql
--------------
ALTER TABLE vspheredb_daemonlog
ADD PRIMARY KEY (instance_uuid, ts_create)
--------------
ERROR 1062 (23000) at line 1: Duplicate entry '\xD6\xA8m\xF6\xF4\xF7@\x93\x91\xBF\xB4\x1B\x93\xCF\xC5d-16999...'for key 'PRIMARY'
Expected Behavior
Migrations should run through.
Current Behavior
The upgrade_59.sql migration fails, resulting in
[db] component changed from idle to failed
.The migration tries to add a new primary key to the
instance_uuid
andts_create
columns of thevspheredb_daemonlog
table.The problem is that existing databases can already contain entries where those columns are not unique - since
ts_create
was handled differently before e14d363.For example:
Steps to Reproduce (for bugs)
ExecStart=/usr/bin/icingacli vspheredb daemon run --trace --debug
viasystemctl edit --full icinga-vspheredb.service
systemctl daemon-reload
systemctl restart icinga-vspheredb.service
journalctl -feu icinga-vspheredb.service
Manually try to execute the migration:
Your Environment
The text was updated successfully, but these errors were encountered: