FortiAnalyzer
FortiAnalyzer can receive logs and Windows host events directly from endpoints connected to EMS, and you can use FortiAnalyzer to analyze the logs and run reports.
madhan
Staff
Staff
Article Id 397314
Description

This article describes how to troubleshoot when it is not possible to see logs because a 'Postgres upgrade fails' error. The issue happens when upgrading the FortiAnalyzer is a success, but the database upgrade fails.

Scope FortiAnalyzer.
Solution

Below are the steps to follow when encountering the issue:

  1. Ensure the FortiGate is sending logs to the FortiAnalyzer:
  • This step can be verified by navigating to Security Fabrics -> Fabric Connectors -> Logging & Analytics. Check the connection status under the settings to ensure FortiGate is connected to FortiAnalyzer.

 

APicture1.png

 

  • Run the following command to confirm FortiGate can send the logs through the connections:

 

exe log fortianalyzer test-connectivity

 

APicture2.png

 

  1. After confirming FortiGate is sending the logs, check the status on FortiAnalyzer, which should show the logs are not being received.

 

APicture3.jpg

 

  1. Check the 'Alert Message Console' from the dashboard, and there are alerts with the message 'Postgres upgrade fails'.

 

APicture4.png

 

  1. After having verified the issue, perform an SQL database rebuild using the command ( It requires a restart):

 

execute sql-local rebuild-db

 

Note:

Refer to the following KB article for more information on the SQL rebuild process: Technical Tip: FortiAnalyzer SQL database delete and rebuild

 

  1. After performing the SQL rebuild, monitor the issue until the rebuilding process is finished. If the issue remains, a  reset and format are required:

 

execute reset {all-settings | all-except-ip}

 

Note:

This operation is irreversible: all logs, configurations, and settings will be lost.


execute format {disk | disk-ext4 | disk-ext3}

 

Note

This command will erase all data on the disk, including logs, configurations, and database files