Violation of PRIMARY KEY constraint 'longtaskparamsPrimaryKey', cannot insert duplicate key in object dbo.longtaskparams

Created:

2016-11-16 12:59:13 UTC

Modified:

2017-04-24 11:30:48 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Violation of PRIMARY KEY constraint 'longtaskparamsPrimaryKey', cannot insert duplicate key in object dbo.longtaskparams

Applicable to:

  • Plesk 11.0 for Windows
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Windows
  • Plesk 11.5 for Linux
  • Plesk 9.x and below for Windows

Symptoms

When trying to update service plan or install APS application, the following error message appears:

Violation of PRIMARY KEY constraint 'longtaskparamsPrimaryKey', cannot insert duplicate key in object 'dbo.longtaskparams'. The duplicate key value is ('id', 'name').

Cause

Table ' longtasks ' was cleaned, but table ' longtaskparams ' was not and contains old orphan records. As a result Plesk tries to use duplicated ID values.

Resolution

You should always clean both tables: longtaskparams and longtasks if it is needed for some reasons.

To fix the issue clean up ' longtaskparams ' table with the command:

"%plesk_bin%\\dbclient" --direct-sql --sql="truncate table longtaskparams"
Have more questions? Submit a request
Please sign in to leave a comment.