Technical Tip: CMDB page shows duplicate key error while accessing the GUI
| Description | This article describes how to resolve a duplicate key error that appears when accessing the CMDB page from the FortiSIEM GUI. |
| Scope | FortiSIEM. |
| Solution | This issue can occur when a duplicate key entry is repeatedly processed in a loop, which prevents the CMDB page from loading properly and results in an error similar to the following:
ERROR: duplicate key value violates unique constraint "ph_external_reputation_20260221_value_value_type_source_key"
To resolve this issue, run the following commands from the Supervisor CLI as an admin.
# su admin
# cd /opt/phoenix/cache/
Then clear the application server cache and restart the service:
# cd /opt/glassfish/domains/domain1/
Log in to the FortiSIEM GUI again, and it will resolve the issue. If the issue persists, it may indicate an inconsistent user ID entry in the database, such as:
Unable to find com.ph.phoenix.model.cmdb.User with id 151882531
Run the following commands on the Supervisor node to verify the database entries:
# psql -U phoenix phoenixdb -c "select * from ph_group_item where item_id='151882531';" # psql -U phoenix phoenixdb -c "select * from ph_user where id=151882531;" # psql -U phoenix phoenixdb -c "select id,cust_org_id,name,manager_id from ph_user where id=151882531;" > /tmp/users.txt # psql -U phoenix phoenixdb -c "select id,cust_org_id,name,manager_id from ph_user where manager_id=151882531;" > /tmp/managers.txt
Review the output files to determine whether there are any invalid or orphaned user references.
/tmp/users.txt
Note: Direct database modifications are not recommended. If backend changes are required, ensure that a full snapshot or backup of the environment is taken before making any modifications. |