Troubleshooting Tip: Resolving ClickHouse Error 'Table is not initialized yet (NOT_INITIALIZED)' in FortiSIEM
| Description | This article describes a scenario where FortiSIEM is unable to write events to ClickHouse because the target ClickHouse table is in a NOT_INITIALIZED state. When this happens, event ingestion fails with HTTP 500 errors, which can result in event backlog or dropped events. |
| Scope | FortiSIEM deployments using ClickHouse as the backend database. Environments with replicated tables and ClickHouse Keeper. |
| Solution | A typical error observed in FortiSIEM logs:
grep -i "NOT_INITIALIZED" /opt/clickhouse/log/clickhouse-server.log
Additional symptoms may include:
ClickHouse tables exist in metadata but have not completed initialization. Common contributing factors:
As long as a table remains uninitialized, ClickHouse rejects all inserts, causing FortiSIEM ingestion failures.
Initial Investigation:
grep -i "NOT_INITIALIZED" /opt/clickhouse/log/clickhouse-server.err.log
clickhouse-client ┌─name───────────────┐
SELECT * from system.replicas format Vertical;
echo stat | nc <keeper_ip> 2181
If quorum is lost, attempt recovery:
echo rcvr | nc localhost 2181
systemctl status ClickHouseKeeper systemctl restart ClickHouseKeeper
If the Keeper service fails to start on a critical node:
/data-clickhouse-hot-1/clickhouse-keeper/.systemd_argconf
systemctl restart ClickHouseKeeper
Replica restart may fail initially, but it is still required. Run the following:
clickhouse-client --query "SYSTEM RESTART REPLICAS" clickhouse-client --query "SYSTEM RESTORE REPLICA fsiem.events_replicated" Advanced Recovery (Upgrade / Persistent Failure Case):
In some upgrade scenarios, the issue persists even after taking the steps above.
Resolution:
Remove the problematic Keeper node from the cluster. Select Test and Deploy. On the affected node, run the following cleanup script:
Key takeaways.
|
