I'm tryting to create a new "widget field" by add a new color (widget item) to a honeycomb widget. But I can't save the dashboard because the inserted widget field id already exists while trying to save the new widget item to the database.
Now, how did this happen? I'm guessing that somewhere along the way, through insertion, imports, upgrades, backups or whatever, the ID counter of said index became lesser than the items that already exists.
The database schema seem to not have a standard auto increment index counter so I can't just fast forward the auto increment index counter to something reasonable. Where is this counter implemented and how do I set it? I'm going through the source code, but no luck yet.
Zabbix 7.0.
PHP Code:
Error in query [INSERT INTO widget_field (widget_fieldid,widgetid,type,name,value_str) VALUES ('185326','44775','1','thresholds.2.color','00FF00'),
Code:
Error in query [INSERT INTO widget_field (widget_fieldid,widgetid,type,name,value_str) VALUES ('185326','44775','1','thresholds.2.color','00FF00'),('185327','44775','1','thresholds.2.threshold','-90')] [Duplicate entry '185326' for key 'widget_field.PRIMARY'] [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerDashboardUpdate->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CDashboard->update() → CDashboardGeneral->updatePages() → CDashboardGeneral->updateWidgets() → CDashboardGeneral->updateWidgetFields() → DB::insert() → DB::insertBatch() → DBexecute() → trigger_error() in include/db.inc.php:362] SQL statement execution has failed "INSERT INTO widget_field (widget_fieldid,widgetid,type,name,value_str) VALUES ('185326','44775','1','thresholds.2.color','00FF00'),('185327','44775','1','thresholds.2.threshold','-90')".
The database schema seem to not have a standard auto increment index counter so I can't just fast forward the auto increment index counter to something reasonable. Where is this counter implemented and how do I set it? I'm going through the source code, but no luck yet.
Zabbix 7.0.
Comment