EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB45226: "Database error....Duplicate entry 'xxx' for key 'PRIMARY'" error message appears when attempting to log into a project source in Developer


Stefan Zepeda

Salesforce Solutions Architect • Strategy


"Database error....Duplicate entry 'xxx' for key 'PRIMARY'" error message appears when attempting to log into a project source in Developer

SYMPTOM:
 
When trying to log onto a project source the following error occurs immediately regardless of login information:
 

ka02R000000kbrrQAA_0EM440000002Caj.png

 


Database error <>: Execute Query failed. Error type: Odbc error. Odbc operation attempted: SQLExecDirect. Duplicate entry '7F76FF9143B18EB70819608FF560B08A-0154FB3F43BC8095882A628DE63CFCF' for key 'PRIMARY'

 
CAUSE:
 
This issue is caused by lingering temporary rows that Strategy inserts and deletes upon connecting to the metadata.  This operation is to ensure that the referential integrity trigger used when deleting objects is functioning properly so that inconsistencies are prevented.  However, the temporary rows could still be present under one of two scenarios.  The first is either an application crash, database server crash, or network interruption partway through the script being run.  The other is that the trigger is missing or not functioning properly.  Follow the steps below to determine if there are indeed duplicate rows within the metadata.
 
ACTION:
 
To determine if duplicate rows existit is necessary to query the metadata.  Remember to take a backup of the metadata prior to performing any queries.  In order to determine the specific metadata table in which the script is currently failing on check the DSSErrors.log.  The duplicate row will always be contained in the very last row of the table and have "Dummy Name" as the OBJECT_NAME.  An example is shown below in which the dummy row is returned when specifying the PROJECT_ID that is contained within the error message.  If a similar query returns data, then duplicate row(s) exist within the metadata.
 

ka02R000000kbrrQAA_0EM440000002Can.png

 
If this is the case contact Strategy Technical Support to resolve this issue.  Even if all of the duplicate rows are resolved, the root issue may lie with the referential integrity trigger, depending on how the error was caused.  It is possible that the trigger was lost during a restore of the metadata or is not functioning correctly and needs to be recreated.
 
 


Comment

0 comments

Details

Knowledge Article

Published:

June 7, 2017

Last Updated:

June 7, 2017