Ad Widget

Collapse

Cannot delete hosts "" because maintenance since Update to v6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daniel.goldinger
    Junior Member
    • Nov 2016
    • 3

    #1

    Cannot delete hosts "" because maintenance since Update to v6.0

    dear zabbix community

    i am using zabbix since v2.4 without any issues and did all major upgrades since there. after update to latest version (v6.0.3) i'm not able to delete any hosts.

    thats the error message:
    Cannot delete hosts "" because maintenance "Datacenter Migration" must contain at least one host or host group. [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostMassDelete->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CHost->delete() → CHost->validateDelete() → CHost::validateDeleteForce() → CHost::checkMaintenances() → CApiService::exception() in include/classes/api/services/CHost.php:1381]

    it's strange, because whatever i host i try to delete, i get the message without a hostname in "". maintenance "Datacenter Migration" isn't existing anymore. some database queries:

    Code:
    select * from maintenances;
    +---------------+------------------------------+------------------+-------------+--------------+-------------+---------------+
    | maintenanceid | name | maintenance_type | description | active_since | active_till | tags_evaltype |
    +---------------+------------------------------+------------------+-------------+--------------+-------------+---------------+
    | 122 | MaintenanceXXXX | 0 | | 1647298800 | 2057612400 | 0 |
    | 123 | XXXXXX StorageIssueXXXXXXXXX | 0 | | 1647298800 | 1678921200 | 0 |
    | 124 | XXXXypervisors | 0 | | 1650805200 | 1650812400 | 0 |
    | 125 | Graylog | 0 | | 1647846000 | 1647853200 | 0 |
    | 126 | Webserver (Blog) | 0 | | 1648022400 | 1648029600 | 0 |
    | 127 | XXXXXX Wartung XXXXXXX | 0 | | 1651075200 | 1651082400 | 0 |
    | 128 | Swap | 0 | | 1650877200 | 1650884400 | 0 |
    +---------------+------------------------------+------------------+-------------+--------------+-------------+---------------+
    
    
    
    
    select * from maintenances_groups;
    +---------------------+---------------+---------+
    | maintenance_groupid | maintenanceid | groupid |
    +---------------------+---------------+---------+
    | 311 | 122 | 6 |
    | 310 | 122 | 7 |
    | 313 | 122 | 8 |
    | 309 | 122 | 12 |
    | 312 | 124 | 17 |
    | 314 | 126 | 8 |
    | 315 | 128 | 17 |
    +---------------------+---------------+---------+
    
    
    
    MariaDB [zabbix]> select * from maintenances_hosts;
    +--------------------+---------------+--------+
    | maintenance_hostid | maintenanceid | hostid |
    +--------------------+---------------+--------+
    | 234 | 123 | 10142 |
    | 235 | 125 | 10456 |
    | 236 | 127 | 10370 |
    | 239 | 128 | 10168 |
    | 238 | 128 | 10179 |
    | 240 | 128 | 10295 |
    | 237 | 128 | 10303 |
    +--------------------+---------------+--------+
    
    
    
    
    select * from maintenances_windows;
    +--------------------------+---------------+--------------+
    | maintenance_timeperiodid | maintenanceid | timeperiodid |
    +--------------------------+---------------+--------------+
    | 130 | 122 | 130 |
    | 133 | 122 | 133 |
    | 142 | 122 | 142 |
    | 132 | 123 | 132 |
    | 154 | 124 | 154 |
    | 135 | 125 | 135 |
    | 137 | 126 | 137 |
    | 156 | 127 | 156 |
    | 155 | 128 | 155 |
    +--------------------------+---------------+--------------+

    maybe someone can give me some hints, about where to search for that issue. i don't want to delete the hosts directly in database because of the dependencies.
    thanks in advance for any help.

    regards,
    daniel
  • daniel.goldinger
    Junior Member
    • Nov 2016
    • 3

    #2
    to answer my own question:
    there was a corruption in maintenances table. check it in mysql-cli with:
    Code:
    check table maintenances;
    and fix it with:
    Code:
    optimize table maintenances;

    regards,
    daniel

    Comment

    Working...