FortiManager
FortiManager supports network operations use cases for centralized management, best practices compliance, and workflow automation to provide better protection against breaches.
sss
Staff
Staff
Article Id 338340
Description This article describes how to solve the error 'code: -20001', 'message: Internal error' that occurs while deleting a newly created VDOM for a managed FortiGate in the FortiManager Device database.
Scope FortiManager with Workspace mode enabled.
Solution

Conditions:

  • FortiManager with Workspace mode enabled.
  • A New VDOM (in Device database) was created and then used 'Discard and Unlock' without saving.

This applies to a specific condition when a new VDOM is created by mistake for a managed FortiGate in FortiManager's device DB using CLI scripts but then while trying to delete that gives an 'Internal error'.

 
The new VDOM will not be deleted even if the configuration was not saved as 'Discard and Unlock' in FortiManager ADOM.

 

However, if the VDOM configuration was Saved and then deleted, the newly created VDOM will be deleted without any error.

 

Debug commands to capture the logs:

 

FMG # diagnose debug reset
FMG # diagnose debug timestamp enable
FMG # diagnose debug service cdb 255
FMG # diagnose debug service dvmdb 255
FMg # diagnose debug enable

 

Error in the FortiManager debug:

 

2024-09-02 11:07:04 Request:
2024-09-02 11:07:04 { "client": "gui json:24391", "id": 56, "keep_session_idle": 1, "method": "delete", "params": [{ "flags": ["create_task", "nonblocking"], "target start": 1, "url": "\/dvmdb\/adom\/root\/device\/beta-kvm87\/vdom\/VDNEW1"}], "session": 25519}
2024-09-02 11:07:04 Chkperm Response:
2024-09-02 11:07:04 { "id": 56, "result": [{ "status": { "code": 0, "message": "OK"}, "url": "\/dvmdb\/adom\/root\/device\/beta-kvm87\/vdom\/VDNEW1"}], "session": 25519}
2024-09-02 11:07:04 Response:
2024-09-02 11:07:04 { "id": 56, "result": [{ "status": { "code": -20001, "message": "Internal error"}, "url": "\/dvmdb\/adom\/root\/device\/beta-kvm87\/vdom\/VDNEW1"}]}

 

Resolution:

The following command will fix this issue and delete the unwanted VDOM from the FortiManager's device database.

 

FMG # diag cdb upgrade check resync-dev-vdoms

Checking: Resync and add any missing vdoms from device database to DVM database
DEL dev=136, vdom=8640
1 error(s) found.

The above changes will be made to the database, however it is recommended to perform a backup first.
Do you want to continue? (y/n)y

Upgrading: Resync and add any missing vdoms from device database to DVM database
DEL dev=136, vdom=8640
1 error(s) fixed.

Database upgrade complete.

 

 

Related article:

Technical Tip: How to check FortiManager database integrity prior to upgrade