Violation of Primary Key constraint 'PK_tblWindowsRelations'.

Member since: 2002
Violation of Primary Key constraint 'PK_tblWindowsRelations'. Cannor insert duplicate keys object 'tblwindowsRelations'. Only occurs on some AD-accounts which might point to troubles with nested groups or trusted domains? Using windowsMembershipProvider on windows 2003 EPiServer CMS 5.1.422.4 Any suggestions?
#15879 Mar 25, 2008 19:07
  • joakim.mahler
    Member since: 2002
    We have managed to sort out the groups causing the trouble and it seems that groups migrated from a trusted domain gest duplicated in tblWindowRelations. But still no solution other then removing the PK_Constraint...
    #16553 Mar 25, 2008 19:09
  • Vladimir Ljepoja
    Member since: 2007
    Hi, I have the same problem with Episerver 5 SP1, version 5.1.422.122. For some AD accounts the EpiServer works without any problem and for some accounts it gives me exception: Violation of PRIMARY KEY constraint 'PK_tblWindowsRelations'. Cannot insert duplicate key in object 'dbo.tblWindowsRelations'. The statement has been terminated. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PK_tblWindowsRelations'. Cannot insert duplicate key in object 'dbo.tblWindowsRelations'. The statement has been terminated. Have you got now some solution for this problem? Best Regards Vlada
    #16554 Mar 25, 2008 19:09
  • Joakim Jormelin
    Member since: 2002

    Hi. Late response but might help someone. The problem still occurs and is most likely caused by trust relationships between domains. The easy fix is to simply remove the primary key on tbl_windowsrelations. The problem still occurs in CMS 5 R2.


    #25778 Nov 05, 2008 16:14
  • Jonas Nilsson
    Member since: 2002


    EPiServer has two updated stored procedures that will fix this issue.

    The problem still exists in SP3.



    #26280 Dec 01, 2008 10:10
  • Per Hemmingson
    Member since: 2006


    This is a known issue in which according to buglist should be fixed in EPiServer CMS R1 SP2,

    #8865 Logging on with the Windows membership provider will sometimes give a "violation of primary key constraint"

    There is a hotfix available from EPiServer Developer Support


    #26299 Dec 01, 2008 21:36
  • Joakim Jormelin
    Member since: 2002

    Yes I've been told that this is a known issue and it should be fixed in SP2 but we are now running R2 and the problem still occurs. I've got the two SP's now and will try them out as soon as i get the time.

    For everybody from EPiServer reading this, there is also an open supportcase (119334 ) regarding this case.

    #26475 Dec 08, 2008 8:30