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

Refers 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
  • MG:9aff9c99f429718499d1262cb972cf49
  • MG:964e472fd23e03b4e2b05bee5bdf9acd
  • MT:349e3dc3e6fe50d928af903be75bca1f
  • MT:6ca41bd3955b629e914ca04773d7d112
  • MT:b20fcb1f82c734dc42a46c31b1a2e0d9
  • MG:ca685213fe8a2e869945334a304acb23

Created:

2016-11-16 12:59:13 UTC

Modified:

2017-02-13 06:13:54 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

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.