Backup fails - An item with the same key has already been added

Created:

2016-11-16 13:18:39 UTC

Modified:

2017-08-08 13:16:19 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Backup fails - An item with the same key has already been added

Applicable to:

  • Plesk 12.0 for Windows

Symptoms

Backup fails with an error. The error message on the plesk control panel is

Error: pmm utility 'PMMCli' raised an exception. Error code is: -1 See pmmcli.log to find out detailed information on this

The log file on the server contains this for the error ( %plesk_dir%PMM\\logs\\pmmcli.log ):

] CRITICAL: PMMUtility exception:
Subprocess <subprocess[40272] 'C:\\\\Program Files (x86)\\\\Parallels\\\\Plesk\\\\admin\\\\bin\\\\plesk_agent_manager.exe domains-id --get-size -c --session-path=C:\\\\Program Files (x86)\\\\Parallels\\\\Plesk\\\\PMM\\\\sessions\\\\YYYY-MM-DD-130131.665 1596'> was finished with exit code -1

== STDOUT ====================
********** Exception handled start **********
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at psa100dumpagent.Psa100Structure.loadWwwRoots()
at psa100dumpagent.Psa100Structure..ctor(CommonEnv env)
at psa104dumpagent.PsaDumpEnv.getPsaStructure()
at psadumpagent.DumpEnv.get_defaultBackupOwnerGuid()
at psadumpagent.DumpEnv.init(DumpParams _params)
at psadumpagent.DumpEnv..ctor(DumpParams _params)
at plesk_agent_manager.Program._Main(String command, String sessionPath, List`1 arguments)
at plesk_agent_manager.Program.Main(String[] args)
********** Exception handled end **********

== STDERR ====================
Traceback (most recent call last):
File "C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\share\\pmmcli\\pmmcli.py", line 2650, in main
data_action_response, errcode_response, error_message = actions.get(sys.argv[1][2:])(parameters)
File "C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\share\\pmmcli\\pmmcli.py", line 2502, in make_dump
return ActionRunner(MakeDumpAction, backup_task_description, None).doActivity()
File "C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\share\\pmmcli\\pmmcli.py", line 170, in doActivity
result = self.processor.doActivity()
File "C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\share\\pmmcli\\pmmcli.py", line 1415, in doActivity
raise PMMUtilityException('PMMCli', x)
PMMUtilityException: PMMCli was finished with exit code -1

[2014-12-08 13:01:33.361|26212] INFO: Outgoing packet:
<?xml version="1.0" ?><response>
<errcode>1000</errcode>
<errmsg>pmm utility 'PMMCli' raised an exception. Error code is: -1
See pmmcli.log to find out detailed information on this</errmsg>
</response>

In the backup session folder (for e.g %plesk_dir%PMM\\sessions\\YYYY-MM-DD-100500.101 ):

 <?xml version="1.0" encoding="utf-8"?>
<execution-result status="error">
<object name="server" type="server">
<message severity="error" code="KeyNotFoundException">
<description> An item with the same key has already been added </description>
</message>
</object>
</execution-result>

The error may occur on source during migration, which would result in following error reported by Parallels Plesk Migration Manager on destination server:

ERROR: Unable to initialize agent on remote host.  
The given key was not present in the dictionary.

Cause

This issue may be caused by inconsistency in Parallels Plesk Panel database ( psa ): duplicate values are present (e.g. domains with same name).

Troubleshooting

To troubleshoot the problem, execute following SQL query on the server:

 > SELECT displayName, COUNT(*) FROM domains GROUP BY displayName HAVING COUNT(*) > 1;

If domain name (or names) are returned, it means that there are more than one domain with same displayName value in domains table.

Resolution

  1. Backup psa database:

    "%plesk_dir%\\Mysql\\bin\\mysqldump.exe" -uadmin -padmin_password -P8306 psa > C:\\psa_dump.sql
  2. correct displayName values to make them unique.

Have more questions? Submit a request
Please sign in to leave a comment.