Symptoms
New custom plug-in PLUGIN was installed in PBA. During configure.pl execution following error appears:
[Wed Sep 10 15:30:29 2014] Updating privileges for PLUGIN
Could not parse ./update_perms.pl: DBD::Pg::st execute failed: ERROR: duplicate key value violates unique constraint "MethodToPrivilege_PK"
DETAIL: Key ("MethodID", "PrivilegeID")=(4666, 1212) already exists. at ./update_perms.pl line 101.
Could not do ./update_perms.pl: at /usr/local/bm/tools/configure.pl line 189.
Could not run ./update_perms.pl at /usr/local/bm/tools/configure.pl line 190.
DBD::Pg::st execute failed: ERROR: duplicate key value violates unique constraint "MethodToPrivilege_PK"
DETAIL: Key ("MethodID", "PrivilegeID")=(4666, 1212) already exists. at ./update_perms.pl line 101.
...propagated at /usr/local/bm/tools/configure.pl line 191.
Cause
There are dublicate records in /usr/local/bm/conf/PLUGIN.methods.list
file.
Resolution
In PBA Home> System> Settings> Security> Privileges
add ID column to the list and find privilege with ID from error, in provided example it is:
1212 MANAGE_OWN_DOMAINS_C Allowes to register, transfer and renew domains.
Search for reconds with this privilege in PLUGIN.methods.list file, find duplicates:
[root@pba conf]# grep MANAGE_OWN_DOMAINS_C PLUGIN.methods.list
...
PLUGIN PluginConf TestConnection MANAGE_OWN_DOMAINS_C
PLUGIN PluginConf TestConnection MANAGE_OWN_DOMAINS_C
...
Remove one of duplicate records, so that all records in file are unique and rerun configure.pl.
During PBA updates methods.list files are rewritten, so there might be an error in PLUGIN code that will cause the same issue during its reinstallation. Please, review the code to avoid issue in future.