Environment : This was observed during an upgrade failure from 7.7.2 to 7.7.12 however the information is not specific to any version.
Check the upgrade log in /var/log/upgrade/
If an upgrade exits with the following error :
ERROR: could not create unique index "external_radius_server_acct_partial"
DETAIL: Key (ap_group_id, host, is_auth, is_mgmt, is_acct, acct_port)=(8, AMP, 0, 0, 1, 1813) is duplicated.: create UNIQUE index external_radius_server_acct_partial on external_radius_server(ap_group_id, host, is_auth, is_mgmt, is_acct, acct_port) WHERE is_acct = 1 at /usr/local/airwave/lib/perl/Mercury/Utility/ChangeDB.pm line 659
Check for the table it's complaining about in the DETAIL section of the error message (external_radius_server in this case).
The external_radius_server is the table used by the AMP to store external radius server configuration information for Cisco devices in a group.
In our scenario, we were not managing Cisco devices from the AMP and hence we truncated the entire table and ran a make. Following are the commands
2) airwave=> TRUNCATE table external_radius_server;
3) [root@amp-server mercury]# make
NOTE : This will remove all the radius servers from the Group configuration for the Cisco devices. You will see a mismatch on Cisco devices if the devices are in Monitor mode and you will lose radius config if the Cisco device is in Manage mode. Hence DO NOT perform the above steps on devices in Manage mode.
Meanwhile, you can also try another approach by deleting only the IDs that the error log complains about.
For instance for the above error message, we can only delete the row for ap_group_id = 8 however there is a possibility that the upgrade may fail again complaining about a different row.
You can delete individual rows from the table using :
airwave=> delete from external_radius_server where ap_group_id = '8';