000032166 - Saving a History Log field errors and changes are lost in RSA Archer 5.x

Document created by RSA Customer Support Employee on Aug 12, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000032166
Applies ToRSA Product Set: Archer
RSA Version/Condition: 5.x
IssueSaving a History Log field errors and the changes are lost. 
The w3wp log may state that the History Log field cannot save due to a violation of PRIMARY KEY constraint on a duplicate key.
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
    <ApplicationData>
        <TraceData>
            <DataItem>
                <TraceRecord Severity="Error" xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord">
                    <TraceIdentifier>Archer.NET</TraceIdentifier>
                    <UserId>0</UserId>
                    <Description>Violation of PRIMARY KEY constraint 'PK_tblIVFieldHistoryOptions'. Cannot insert duplicate key in object 'dbo.tblIVFieldHistoryOptions'. The duplicate key value is (116508, 116010).
The statement has been terminated.
SQL statement: usp_update_field_history_log @userToken = '435432E7070800FB6ACE192988017806', @fieldId = 116508, @date = '12/2/2015 4:27:24 PM', @searchDefaultField = False, @maxTrackModifications = , @historicalSearching = False, @trackAllFields = False, @logFormat = 1, @displayControlId = 16, @advancedDisplayOption = False, @advancedDisplayTypeId = 0, @advancedDisplayText = '', @fieldOptionXML = '&lt;ROOT&gt;&lt;V a="I" b="116010" c="0" d="1" e="1" /&gt;&lt;V a="I" b="116012" c="1" d="1" e="1" /&gt;&lt;V a="I" b="116014" c="2" d="1" e="1" /&gt;&lt;V a="I" b="116032" c="3" d="1" e="1" /&gt;&lt;V a="I" b="116033" c="4" d="1" e="1" /&gt;&lt;V a="I" b="116034" c="5" d="1" e="1" /&gt;&lt;V a="I" b="116035" c="6" d="1" e="1" /&gt;&lt;V a="I" b="116036" c="7" d="1" e="1" .../ROOT&gt;', @maxTrackDays = , @showUserChangesOnly = False</Description>
                    <AppDomain>/LM/W3SVC/944038430/ROOT-1-130935043560495320</AppDomain>
                    <Exception>
                        <ExceptionType>ArcherTech.Kernel.Utility.Data.ArcherDbException, ArcherTech.Kernel, Version=5.5.10201.1001, Culture=neutral, PublicKeyToken=null</ExceptionType>
                        <Message>Violation of PRIMARY KEY constraint 'PK_tblIVFieldHistoryOptions'. Cannot insert duplicate key in object 'dbo.tblIVFieldHistoryOptions'. The duplicate key value is (116508, 116010).
The statement has been terminated.
SQL statement: usp_update_field_history_log @userToken = '435432E7070800FB6ACE192988017806', @fieldId = 116508, @date = '12/2/2015 4:27:24 PM', @searchDefaultField = False, @maxTrackModifications = , @historicalSearching = False, @trackAllFields = False, @logFormat = 1, @displayControlId = 16, @advancedDisplayOption = False, @advancedDisplayTypeId = 0, @advancedDisplayText = '', @fieldOptionXML = '&lt;ROOT&gt;&lt;V a="I" b="116010" c="0" d="1" e="1" /&gt;&lt;V a="I" b="116012" c="1" d="1" e="1" /&gt;&lt;V a="I" b="116014" c="2" d="1" e="1" /&gt;&lt;V a="I" b="116032" c="3" d="1" e="1" /&gt;&lt;V a="I" b="116033" c="4" d="1" e="1" /&gt;&lt;V a="I" b="116034" c="5" d="1" e="1" /&gt;&lt;V a="I" b="116035" c="6" d="1" e="1" /&gt;&lt;V a="I" b="116036" c="7" d="1" e="1" /&gt;&lt;V a="I" b="116037" c="8" d="1" e="1" /&gt;&lt;V a="I" b="116039" c="9" d="1" e="1" /&gt;&lt;V a="I" b="116040" c="10" d="1" e="1" .../ROOT&gt;', @maxTrackDays = , @showUserChangesOnly = False</Message>
                        <Source>ArcherTech.Kernel</Source>
                        <StackTrace>   at ArcherTech.Kernel.Utility.Data.ArcherSqlDatabase.WrapDatabaseCall(DbCommand command, Action methodToWrap)
   at ArcherTech.Kernel.Utility.Data.ArcherSqlDatabase.ExecuteNonQuery(DbCommand command)
   at ArcherTech.Kernel.DataSource.Db.HistoryLogFieldDefinitionDataSource.Update(HistoryLogFieldDefinition historyLogFieldDefinition, HistoryLogFieldDisplay historyLogFieldDisplay, IList`1 fieldSelectionChanges)
   at ArcherTech.Kernel.Brokers.HistoryLogFieldDefinitionBrokerHelper.SaveInternal(FieldContainerBase fieldContainer, FieldSaveOptions saveOptions, Boolean isFieldInsert, Level level)
   at ArcherTech.Kernel.Brokers.HistoryLogFieldDefinitionBrokerHelper.SaveInternal(FieldContainerBase fieldContainer, Level level, FieldSaveOptions saveOptions)
   at ArcherTech.Kernel.Brokers.FieldDefinitionBrokerHelperBase.WrapValidate(FieldContainerBase fieldContainer, Level level, FieldSaveOptions saveOptions, FieldSave fieldSave)
   at ArcherTech.Kernel.Brokers.FieldDefinitionBrokerHelperBase.Save(FieldContainerBase fieldContainer, Level level, FieldSaveOptions saveOptions)
   at ArcherTech.Kernel.Brokers.BrokerBase.&lt;&gt;c__DisplayClass11`1.&lt;SaveWithUniqueNameAlias&gt;b__f()
   at ArcherTech.Kernel.Brokers.BrokerBase.CheckUniqueConstraint(Action deleg)
   at ArcherTech.Kernel.Brokers.BrokerBase.SaveWithUniqueNameAlias[T](Func`2 saveFunction, T domainObject, Func`1 getNameFunction, Func`1 getAliasFunction, Func`2 setNameFunction, Func`2 setAliasFunction, Boolean createUniqueNameAlias)
   at ArcherTech.Kernel.Brokers.FieldDefinitionBroker.SaveInternal(FieldContainerBase fieldContainer, Level level, FieldSaveOptions saveOptions)
   at ArcherTech.Kernel.Brokers.FieldDefinitionBroker.Save(FieldContainerBase fieldContainer)
   at ArcherTech.Kernel.Managers.FieldDefinitionManager.Save(SessionContext sessionContext, FieldContainerBase fieldContainer)</StackTrace>
                    </Exception>
                </TraceRecord>
            </DataItem>
        </TraceData>
    </ApplicationData>
</E2ETraceEvent>

 
Resolution
  1. Change the History Log field's Field Tracking option from All to Selected.
  2. Remove all the field from the Selected fields list.
  3. With the Selected fields empty, click Apply.
  4. Add desired fields back to the Selected fields list.  Maybe a few at a time and click Apply. 

Attachments

    Outcomes