Backup fails - The given key was not present in the dictionary

Created:

2016-11-16 13:07:06 UTC

Modified:

2017-08-16 18:29:11 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Backup fails - The given key was not present in the dictionary

Applicable to:

  • Plesk 11.x for Windows
  • Plesk 10.x for Windows
  • Plesk 12.0 for Windows

Symptoms

Backup fails with an error:

` <?xml version="1.0" encoding="utf-8"?>
<execution-result status="error">
  <object name="server" type="server">
    <message severity="error" code="keynotfoundexception">
      <description>the given key was not present in the dictionary.</description>
    </message>
  </object>
</execution-result> `

This makes migration from the server impossible, as on destination server Parallels Plesk Migration & Transfer Manager will fail to deploy agent:

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

Cause

The issue might be caused by the inconsistency in Plesk database.

Diagnostics

To troubleshoot the problem, please execute the following command and query:

 "%plesk_bin%\\dbclient.exe" --direct-sql --sql="select domains.id, domains.name, clients.login from domains left join clients on clients.id=domains.cl_id where clients.login is NULL"

If empty output is returned, then this article does not apply to your case.

If any domain names are returned, it means that they belong to a non-existing client.

Workaround

  1. Back up the database:

        "%plesk_dir%\\MySQL\\bin\\mysqldump.exe" -P8306 -uadmin -pPleskAdminPassword --databases psa > c:\\Users\\Administrator\\plesk_db_backup.sql
  2. Set correct cl\_id for the domain entry (replace N in the request with ID of domain found on Diagnostics step and admin with login of proper owner of the domain):

    "%plesk_bin%"\\dbclient.exe --direct-sql --sql="update domains set cl_id = (select id from clients where login = 'admin') where id = N" `
Have more questions? Submit a request
Please sign in to leave a comment.