Skip to main content

Why does my directory synchronization fail on Plesk?

The directory tracking database is synchronized with Plesk using the Plesk XML-RPC API. Under certain circumstances, this API may produce errors that Patchman can't resolve or work around, and require manual action to solve within Plesk. If you think that directory synchronization isn’t working correctly, check the relevant logging in /var/log/patchman/patchman.log for more information.

This article lists some known error messages and resolutions. If you are encountering an error that is not listed here, please contact us and include the messages themselves.

API key is not found

CODE
ERROR: Plesk returned error code 11003 in checkup phase
ERROR: Plesk response: '<?xml version="1.0"?>
    <packet version="1.6.6.0">
            <system>
                    <status>error</status>
                    <errcode>11003</errcode>
                    <errtext>PleskAPIInvalidSecretKeyException : key is not found</errtext>
            </system>       </packet>'

This error surfaced as a result of an unexpected and undocumented change in behavior in Plesk 18.0.33. If you see this error, please check if you recently performed an upgrade to this Plesk version.

Update your version of Patchman to at least 1.13.0 to resolve this problem.

API access is blocked

CODE
ERROR: Plesk returned error code 1006 in checkup phase
ERROR: Plesk response: '<?xml version="1.0"?>
	<packet version="1.6.6.0">
		<system>
			<status>error</status>
			<errcode>1006</errcode>
			<errtext>Access to API is disabled for 127.0.0.1</errtext>
		</system>	</packet>'

In this case, Plesk has been configured to not allow access to the Plesk API from localhost (127.0.0.1). This address is considered the default API availability and thus is what Patchman will try. There are two possible resolutions for this problem:

  1. Change the Plesk API ACL to allow requests from 127.0.0.1. In the Plesk interface, this can be found under Tools & Settings > IP Access Restriction Management > IP allow/deny list.

  2. Change the address Patchman uses to access the API. This approach is only useful if the API is made available on an external interface instead of an internal one - it won’t work if you made the API completely unavailable. To achieve this, add the following to /etc/patchman/patchman.ini (create the file if it doesn’t exist yet):

    CODE
    [plesk]
    api_address=<IP>

    Afterwards, reload the settings in Patchman using service patchman reload.

Timeout

CODE
ERROR: Could not query Plesk, Timeout was reached

The Plesk API is not responding fast enough. It is strongly recommended to check if Plesk is working correctly; the default timeout for Patchman is 15 minutes, so if the API is indeed slower than that, it is probably having performance problems. Also note that the longer such interaction takes, the more it will delay other routine tasks like scans and definition updates.

If you really want to increase the timeout, add the following to /etc/patchman/patchman.ini (create the file if it does not exist yet):

CODE
[plesk]
api_timeout=<timeout in seconds>

Afterwards, reload the settings in Patchman using service patchman reload.

Domain.php errors

CODE
ERROR: Call to a member function isDefault() on null (Domain.php:748)

This problem is caused by database inconsistency in the Plesk database, particularly in PHP setting configuration. You can fix this problem by manually running the following command (as root), executing a fixing query on the Plesk backend database:

CODE
plesk db "insert into PhpSettings (id, noteId) (select value, 0 from SubscriptionProperties where name = 'phpSettingsId' and value not in (select id from PhpSettings));"

In older versions of patchman-client, this error was incorrectly ignored and various directories and users may not have been synchronized to the Patchman directory tracking database. Starting with version 1.5.0, this error produces failure warnings in the Patchman logfile (/var/log/patchman/patchman.log) for the directory synchronization task.

API version is too old

CODE
ERROR: Plesk returned error code 1005 in checkup phase
ERROR: Plesk response: '<?xml version="1.0"?>
	<packet version="1.6.6.0">
		<system>
			<status>error</status>
			<errcode>1005</errcode>
			<errtext>Protocol version '1.6.6.0' is not supported. Current protocol version is '1.6.3.5'</errtext>
		</system>	</packet>'

Your version of Plesk is too old for Patchman integration. Please refer to What are the minimal requirements for running Patchman?

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.