Ad Widget

Collapse

Table 'zabbix.history_unit' doesn't exist, even it is there

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FFB-Group
    Junior Member
    • Jan 2023
    • 14

    #1

    Table 'zabbix.history_unit' doesn't exist, even it is there

    Hello everybody

    We had some trouble with our Zabbix lately. We run it on a KVM virtualisation which runs on a GlusterFS cluster.
    We occured some crashes and now our database is messed up.

    What we already did:
    - Remove the old database
    - Import old scheme from backup
    - Import data from backup
    - Delete and recreate corrupted table

    It looks like its working now, but the history tables are still not working properly.
    That's very painful since the datareports of our objects can't be stored correctly and some errors apear, even tho there is no error on a client.



    When i list all tables i see all the tables:

    Code:
    | history |
    | history_log |
    | history_str |
    | history_text |
    | history_uint |
    But when i am running a check on the history_uint i get this error:

    Code:
    MariaDB [zabbix]> check table history_unit;
    +---------------------+-------+----------+-------------------------------------------+
    | Table | Op | Msg_type | Msg_text |
    +---------------------+-------+----------+-------------------------------------------+
    | zabbix.history_unit | check | Error | Table 'zabbix.history_unit' doesn't exist |
    | zabbix.history_unit | check | status | Operation failed |
    +---------------------+-------+----------+-------------------------------------------+
    2 rows in set (0.001 sec)


    Thats kinda strange, because the Zabbix server is writing new data in the table.​ (Our backup didn't contain history data)

    Code:
    MariaDB [zabbix]> select * from history_uint LIMIT 20;
    +--------+------------+-------+-----------+
    | itemid | clock | value | ns |
    +--------+------------+-------+-----------+
    | 50081 | 1681970321 | 0 | 502806857 |
    | 50081 | 1681974581 | 0 | 807556469 |
    | 50081 | 1681975121 | 0 | 40932666 |
    | 50081 | 1681975601 | 0 | 39593459 |
    | 50081 | 1681983461 | 0 | 49031482 |
    | 50081 | 1681985441 | 0 | 61489273 |
    | 50081 | 1681999901 | 0 | 615364904 |
    | 50081 | 1682003921 | 0 | 292049754 |
    | 50081 | 1682022641 | 0 | 146939188 |
    | 50081 | 1682033201 | 0 | 30275079 |
    | 50081 | 1682045501 | 0 | 21339457 |
    | 50081 | 1682045681 | 0 | 601833878 |
    | 50081 | 1682047181 | 0 | 495823686 |
    | 50081 | 1682052161 | 0 | 564115976 |
    | 50081 | 1682052881 | 0 | 451397606 |
    | 50112 | 1681969766 | 3 | 176889242 |
    | 50112 | 1681970246 | 3 | 546031608 |
    | 50112 | 1681970786 | 3 | 444488404 |
    | 50112 | 1681970846 | 3 | 204789835 |
    | 50112 | 1681971146 | 3 | 485798009 |
    +--------+------------+-------+-----------+
    20 rows in set (0.001 sec)


    We already tried to delete the history_uint table and created a new one, but the error still occures.

    Does anybody have a solution or an idea how to fix this?
    Thanks a lot!
  • FFB-Group
    Junior Member
    • Jan 2023
    • 14

    #2

    Edit:
    There was a typo in my table check, apparently it looks like the table is fine, but our zabbix still can't read and store the data correctly.

    Code:
    MariaDB [zabbix]> check table history_uint;
    +---------------------+-------+----------+----------+
    | Table | Op | Msg_type | Msg_text |
    +---------------------+-------+----------+----------+
    | zabbix.history_uint | check | status | OK |
    +---------------------+-------+----------+----------+
    1 row in set (5.228 sec)
    ​
    with mysqlcheck i found something else wrong in my database;


    Code:
    root@chbi0zab01:/backup/zabbix# mysqlcheck --all-databases
    mysql.column_stats                                 OK
    mysql.columns_priv                                 OK
    mysql.db                                           OK
    mysql.event                                        OK
    mysql.func                                         OK
    mysql.global_priv                                  OK
    mysql.gtid_slave_pos
    Error    : Table 'mysql.gtid_slave_pos' doesn't exist in engine
    status   : Operation failed
    mysql.help_category                                OK
    mysql.help_keyword                                 OK
    mysql.help_relation                                OK
    mysql.help_topic                                   OK
    mysql.index_stats                                  OK
    mysql.innodb_index_stats
    Error    : Table 'mysql.innodb_index_stats' doesn't exist in engine
    status   : Operation failed
    mysql.innodb_table_stats
    Error    : Table 'mysql.innodb_table_stats' doesn't exist in engine
    status   : Operation failed
    mysql.plugin                                       OK
    mysql.proc                                         OK
    mysql.procs_priv                                   OK
    mysql.proxies_priv                                 OK
    mysql.roles_mapping                                OK
    mysql.servers                                      OK
    mysql.table_stats                                  OK
    mysql.tables_priv                                  OK
    mysql.time_zone                                    OK
    mysql.time_zone_leap_second                        OK
    mysql.time_zone_name                               OK
    mysql.time_zone_transition                         OK
    mysql.time_zone_transition_type                    OK
    mysql.transaction_registry
    Error    : Table 'mysql.transaction_registry' doesn't exist in engine
    status   : Operation failed
    sys.sys_config                                     OK

    Also here is a screenshot what i mean with our zabbix doesn't work correctly:
    Some data is just not written or can't be read
    Click image for larger version

Name:	21-04-_2023_07-44-33.png
Views:	1317
Size:	22.5 KB
ID:	463365
    Attached Files

    Comment

    • FFB-Group
      Junior Member
      • Jan 2023
      • 14

      #3
      We solved it by reinstalling all mysql and mariadb files and services from the system. Now it works again

      Comment


      • clarker4
        clarker4 commented
        Editing a comment
        Hi FFB-group, could you explain exactly how you reinstalled mariadb and mysql files exactly?
    Working...