Troubleshooting Tip: How to resolve FortiAnalyzer 7.6 version showing Rebuilding SQL database status stuck at 99% for long time
| Description | This article explains how to resolve FortiAnalyzer 7.6 version GUI alert showing rebuilding SQL database stuck at 99% for long time and not proceeding further.
|
| Scope | FortiAnalyzer v7.6.0 and later. |
| Solution | The FortiAnalyzer database upgrade from PostgreSQL (PSQL) to ClickHouse is an automatic background process that occurs when the FortiAnalyzer firmware is upgraded to version 7.6.0 or later.
The database upgrade takes long time depending on the log database in FortiAnalyzer. Sometimes the rebuilding database gets finished however the status shows stuck at 99% during the completion stage and it does not proceed further. FortiAnalyzer GUI shows an alert saying Rebuilding SQL database showing progress of 99% with a short estimated remaining time and not moving forward.
To confirm the database upgrade is finished perform the following two steps,
FAZ01 # diagnose sql show db-size Size: 17574.92 GB
FAZ01 # diagnose sql show db-size
FAZ01 # diagnose sql show db-size
FAZ01 # diagnose sql status migrate-db Migrating log SQL database.
When the database size is not increasing and progress is at 99%, this means it is only a status update issue and that the database migrate has already been completed, meaning the latest logs are already visible.
To resolve the issue, execute the following commands and wait for 5 minutes. After, verify the status of the migration again.
diagnose siem process list
Notice the message changed from 'Migrating log SQL Database' to 'Migrating log SQL database accomplished'. After running these commands, the alert message is also removed from the FortiAnalyzer GUI.
Migrating log SQL database accomplished. |

