none
Failed upgrading MIM Service to hotfix 4.4.1459.0 RRS feed

  • Question

  • Hi All,

    I'm recieving errors while upgrading the MIM 2016 SP1 (build 4.4.1302.0) Service & Portal compontents (with dbname MIMService) to hotfix 4.4.1459.0. 

    The MsiInstaller error event & database tracelog contain the correct db connection string, and I've double checked the installer account's SA permissions on the SQL server (v11.0.5059). 

    We also enabled the 8690 traceflag globally on the SQL server. A workaround to fix a possible SQL issue https://support.microsoft.com/en-nz/help/2962767/fix-cannot-insert-duplicate-key-error-occurs-when-you-update-a-table-b but that didn't help the upgrade.

    MsiInstaller error event (eventID 11722)

    Product: Microsoft Identity Manager Service and Portal -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action UpgradeDatabase, location: C:\Program Files\Microsoft Forefront Identity Manager\2010\Service\Microsoft.IdentityManagement.DatabaseUpgrade.exe, command: /ConnectionString:"Data Source=MIM_SQL_Alias;Initial Catalog=MIMService;Integrated Security=SSPI;Pooling=true;Connection Timeout=225" /FimServiceAccountName:"HUBKAHO\FIM_Svc" /FimServiceDatabaseName:"MIMService" 

    Microsoft.IdentityManagement.DatabaseUpgrade_tracelog.txt:

    Microsoft.ResourceManagement Verbose: 0 : Executing Batch #: 1
        DateTime=2017-10-03T12:01:06.4768943Z
    Microsoft.ResourceManagement Verbose: 0 : --this is a placeholder for no sql action
        DateTime=2017-10-03T12:01:06.4768943Z
    Microsoft.ResourceManagement Verbose: 0 : Out-of-box object import : Completed processing pre object import file NoOperation.sql.
        DateTime=2017-10-03T12:01:06.4768943Z
    Microsoft.ResourceManagement Verbose: 0 : Out-of-box object import : Started processing object import file ServicePartitionNameAttribute.xml.
        DateTime=2017-10-03T12:01:06.4768943Z
    Microsoft.ResourceManagement Verbose: 0 : PlatformBasics is starting. IsService = 'False'.
        DateTime=2017-10-03T12:01:07.8834574Z
    Microsoft.ResourceManagement Verbose: 0 : Application Registered as ServiceId '1', ServicePartitionId '1'.
        DateTime=2017-10-03T12:01:09.0108573Z
    Microsoft.ResourceManagement Verbose: 0 : Request '' status was updated in-memory from 'NotFound' to 'Validating'.
        DateTime=2017-10-03T12:01:10.0266527Z
    Microsoft.ResourceManagement Verbose: 0 : Request created: 'Create AttributeTypeDescription:  'Service Partition Name' Request'
        <RequestParameter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="CreateRequestParameter"><Calculated>false</Calculated><Target>8cfab375-9b95-4b92-8c5c-77a3455a0f7d</Target><PropertyName>DataType</PropertyName><Value xsi:type="xsd:string">String</Value><Operation>Create</Operation></RequestParameter>
        <RequestParameter xmlns:xsi="http://www.w3.org/2001/X
        DateTime=2017-10-03T12:01:14.5308587Z
    Microsoft.ResourceManagement Verbose: 0 : Entered RequestDispatcher with Request Object; RequestIdentifier 'f04ab527-0ef7-4d9a-abed-520608b70c5e'.
        DateTime=2017-10-03T12:01:14.5464559Z
    Microsoft.ResourceManagement Verbose: 0 : Add request 'f04ab527-0ef7-4d9a-abed-520608b70c5e' to cache with RequestStatus 'Validating'.
        DateTime=2017-10-03T12:01:14.5620816Z
    Microsoft.ResourceManagement Information: 1 : RequestDispatcher enter processing pipeline;  RequestIdentifier 'f04ab527-0ef7-4d9a-abed-520608b70c5e'; Operation 'Create'; Object 'AttributeTypeDescription'; RequestStatus 'Validating'.
        DateTime=2017-10-03T12:01:14.5620816Z
    Microsoft.ResourceManagement Verbose: 0 : RequestDispatcher is processing RequestIdentifier 'f04ab527-0ef7-4d9a-abed-520608b70c5e' for a 'Create' operation on object 'AttributeTypeDescription' with RequestStatus 'Validating'.
        DateTime=2017-10-03T12:01:14.5620816Z
    Microsoft.ResourceManagement Information: 1 : ManagementPolicy: EvaluatingRights
        DateTime=2017-10-03T12:01:14.5620816Z
    Microsoft.ResourceManagement Information: 1 : ManagementPolicy: RightsEvaluated
        DateTime=2017-10-03T12:01:22.4691194Z
    Microsoft.ResourceManagement Verbose: 0 : Request 'f04ab527-0ef7-4d9a-abed-520608b70c5e' status was updated in-memory from 'Validating' to 'Validated'.
        DateTime=2017-10-03T12:01:22.4691194Z
    Microsoft.ResourceManagement Verbose: 0 : Request 'f04ab527-0ef7-4d9a-abed-520608b70c5e' updates have been persisted to permanent storage.
        DateTime=2017-10-03T12:01:22.6410257Z
    Microsoft.ResourceManagement Verbose: 0 : RequestDispatcher is processing RequestIdentifier 'f04ab527-0ef7-4d9a-abed-520608b70c5e' for a 'Create' operation on object 'AttributeTypeDescription' with RequestStatus 'Validated'.
        DateTime=2017-10-03T12:01:22.6410257Z
    Microsoft.ResourceManagement Verbose: 0 : Executing initial authentication.
        DateTime=2017-10-03T12:01:22.6566353Z
    Microsoft.ResourceManagement Verbose: 0 : Request 'f04ab527-0ef7-4d9a-abed-520608b70c5e' status was updated in-memory from 'Validated' to 'Authenticating'.
        DateTime=2017-10-03T12:01:22.6566353Z
    Microsoft.ResourceManagement Verbose: 0 : Request 'f04ab527-0ef7-4d9a-abed-520608b70c5e' status was updated in-memory from 'Authenticating' to 'Authenticated'.
        DateTime=2017-10-03T12:01:22.6566353Z
    Microsoft.ResourceManagement Verbose: 0 : RequestDispatcher is processing RequestIdentifier 'f04ab527-0ef7-4d9a-abed-520608b70c5e' for a 'Create' operation on object 'AttributeTypeDescription' with RequestStatus 'Authenticated'.
        DateTime=2017-10-03T12:01:22.6566353Z
    Microsoft.ResourceManagement Verbose: 0 : Request 'f04ab527-0ef7-4d9a-abed-520608b70c5e' status was updated in-memory from 'Authenticated' to 'Authorized'.
        DateTime=2017-10-03T12:01:22.6722619Z
    Microsoft.ResourceManagement Verbose: 0 : RequestDispatcher is processing RequestIdentifier 'f04ab527-0ef7-4d9a-abed-520608b70c5e' for a 'Create' operation on object 'AttributeTypeDescription' with RequestStatus 'Authorized'.
        DateTime=2017-10-03T12:01:22.6722619Z
    Microsoft.ResourceManagement Information: 1 : WS: Action.Create.Execute.Enter
        DateTime=2017-10-03T12:01:22.6878881Z
    Microsoft.ResourceManagement Error: 3 : Reraised Error 50000, Level 14, State 1, Procedure ReRaiseException, Line 37, Message: Reraised Error 50000, Level 14, State 1, Procedure ReRaiseException, Line 37, Message: Reraised Error 2601, Level 14, State 1, Procedure PostProcessAttributeTypeDescriptionUpdate, Line 256, Message: Cannot insert duplicate key row in object 'fim.AttributeInternal' with unique index 'IX_AttributeInternal_Name'. The duplicate key value is (ServicePartitionName).
        DateTime=2017-10-03T12:01:23.8984083Z
    Microsoft.ResourceManagement Error: 3 : Microsoft.ResourceManagement.WebServices.Exceptions.UnwillingToPerformException: Other ---> System.Data.SqlClient.SqlException: Reraised Error 50000, Level 14, State 1, Procedure ReRaiseException, Line 37, Message: Reraised Error 50000, Level 14, State 1, Procedure ReRaiseException, Line 37, Message: Reraised Error 2601, Level 14, State 1, Procedure PostProcessAttributeTypeDescriptionUpdate, Line 256, Message: Cannot insert duplicate key row in object 'fim.AttributeInternal' with unique index 'IX_AttributeInternal_Name'. The duplicate key value is (ServicePartitionName).
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlDataReader.HasMoreRows()
       at System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout)
       at System.Data.SqlClient.SqlDataReader.NextResult()
       at Microsoft.ResourceManagement.Data.DataAccess.ProcessRequest(RequestType request)
       --- End of inner exception stack trace ---
        DateTime=2017-10-03T12:01:23.9140375Z
    Microsoft.ResourceManagement Warning: 2 : Request 'f04ab527-0ef7-4d9a-abed-520608b70c5e' failed while trying to commit the changes to the database.  Exception: 'Dispatch Request Failure Source: 'Other''.
        DateTime=2017-10-03T12:01:23.9452886Z
    Microsoft.ResourceManagement Verbose: 0 : Request 'f04ab527-0ef7-4d9a-abed-520608b70c5e' updates have been persisted to permanent storage.
        DateTime=2017-10-03T12:01:24.2265768Z
    Microsoft.ResourceManagement Information: 1 : RequestIdentifier 'f04ab527-0ef7-4d9a-abed-520608b70c5e' exited RequestDispatcher with RequestStatus 'Failed'.
        DateTime=2017-10-03T12:01:24.2265768Z
    Microsoft.ResourceManagement Error: 3 : Out-of-box object import : Errors encountered when upgrading the configuration object .
        DateTime=2017-10-03T12:01:24.2421787Z
    Microsoft.ResourceManagement Verbose: 0 : Out-of-box object import : Exception message.
     Failure when making web service call.

    SourceObjectID = urn:uuid:8cfab375-9b95-4b92-8c5c-77a3455a0f7d
    Error = Microsoft.ResourceManagement.WebServices.Exceptions.UnwillingToPerformException: Other ---> System.Data.SqlClient.SqlException: Reraised Error 50000, Level 14, State 1, Procedure ReRaiseException, Line 37, Message: Reraised Error 50000, Level 14, State 1, Procedure ReRaiseException, Line 37, Message: Reraised Error 2601, Level 14, State 1, Procedure 
        DateTime=2017-10-03T12:01:24.2421787Z
    Microsoft.ResourceManagement Verbose: 0 : Out-of-box object import : Completed processing object import file ServicePartitionNameAttribute.xml.
        DateTime=2017-10-03T12:01:24.2421787Z
    Microsoft.ResourceManagement Verbose: 0 : Out-of-box object import : Started processing post object import file ConfigurationChange2009Attribute.sql.
        DateTime=2017-10-03T12:01:24.2421787Z
    Microsoft.ResourceManagement Verbose: 0 : Executing Batch #: 1
        DateTime=2017-10-03T12:01:24.2421787Z
    Microsoft.ResourceManagement Verbose: 0 : --********************************************************
    --*                 
        DateTime=2017-10-03T12:01:24.2421787Z
    Microsoft.ResourceManagement Verbose: 0 : Executing Batch #: 2
        DateTime=2017-10-03T12:01:24.2421787Z
    Microsoft.ResourceManagement Verbose: 0 : CREATE PROCEDURE [setup].[ResetAttributeKey]
        @attributeObjectKey BIGINT, 

        DateTime=2017-10-03T12:01:24.2421787Z
    Microsoft.ResourceManagement Verbose: 0 : Executing Batch #: 3
        DateTime=2017-10-03T12:01:24.2578018Z
    Microsoft.ResourceManagement Verbose: 0 : EXEC  [setup].[ReseedSchemaCacheTables]

        DateTime=2017-10-03T12:01:24.2578018Z
    Microsoft.ResourceManagement Verbose: 0 : Executing Batch #: 4
        DateTime=2017-10-03T12:01:24.2578018Z
    Microsoft.ResourceManagement Verbose: 0 : DECLARE @objectKey BIGINT;
        
    SELECT
        @objectKey  = [ai].[ObjectKey]
    FR
        DateTime=2017-10-03T12:01:24.2578018Z
    Microsoft.ResourceManagement Verbose: 0 : Execute SQL : The following sql statement failed.
     DECLARE @objectKey BIGINT;
        
    SELECT
        @objectKey  = [ai].[ObjectKey]
    FROM [fim].[AttributeInternal] AS [ai]
    WHERE [ai].[Name] = 'ServicePartitionName';

    EXEC [setup].[ResetAttributeKey]
        @attributeObjectKey = @objectKey,
        @attributeKey = 251;

    EXEC  [setup].[ReseedSchemaCacheTables]
        DateTime=2017-10-03T12:01:24.6797338Z
    Microsoft.ResourceManagement Verbose: 0 : Execute SQL : The transaction failed with the following errors System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_BindingInternal_AttributeInternal". The conflict occurred in database "MIMService", table "fim.BindingInternal", column 'AttributeKey'.
    Cannot insert duplicate key row in object 'fim.AttributeInternal' with unique index 'IX_AttributeInternal_Name'. The duplicate key value is (ServicePartitionName).
    The statement has been terminated.
    The state
        DateTime=2017-10-03T12:01:24.6797338Z
    Microsoft.ResourceManagement Error: 3 : The database upgrade fails to run the post-process sql script for configuration updates. 
    The error message: Execute SQL : The upgrade tool has rolled back. 
    The sql transaction running the script ConfigurationChange2009Attribute.sql failed. 
     Exception: System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_BindingInternal_AttributeInternal". The conflict occurred in database "MIMService", table "fim.BindingInternal", column 'AttributeKey'.
    Cannot insert duplicate key row in object 'fim.AttributeInternal' with unique index 'IX_AttributeInternal_Name'. The duplicate key value is (ServicePartitionName).
    The statement has been terminated.
    The statement has been terminated.
    Checking identity information: current identity value '32700'.
    DBCC execution completed. If DBCC printed error messages, contact your system administrator.
    Checking identity information: current identity value '251'.
    DBCC execution completed. If DBCC printed error messages, contact your system administrator.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.IdentityManagement.DatabaseUpgrade.Program.ExecuteSqlScript(SqlConnection connection, String sqlFile, Boolean embeddedAsResource, Boolean hasPlaceholders, Boolean continueOnError) 

        DateTime=2017-10-03T12:01:24.6797338Z
    Microsoft.ResourceManagement Verbose: 0 : Database upgrade : Out-of-box object upgrade completed.
        DateTime=2017-10-03T12:01:24.6797338Z
    Microsoft.ResourceManagement Verbose: 0 : Database upgrade : Out-of-box object upgrade complete with errors. Execute SQL : The upgrade tool has rolled back. 
    The sql transaction running the script ConfigurationChange2009Attribute.sql failed. 
     Exception: System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_BindingInternal_AttributeInternal". The conflict occurred in database "MIMService", table "fim.BindingInternal", column 'AttributeKey'.
    Cannot insert duplicate key row in object 'fim.AttributeInte
        DateTime=2017-10-03T12:01:24.6797338Z
    Microsoft.ResourceManagement Error: 3 : Database upgrade : Encountered errors when upgrading the out-of-box objects.
        DateTime=2017-10-03T12:01:24.6797338Z
    Microsoft.ResourceManagement Verbose: 0 : The AppDomain's parent process is exiting.
        DateTime=2017-10-03T12:01:24.6797338Z
    Upgrading the MM Sync component with custom dbname (MIMSynchronizationService) to 4.4.1459.0 completed without problems.

    Any ideas?

    Best regards,

    Wouter

    Wouter Landuyt | IS4U FIM/MIM Expert Blog: blog.is4u.be

    If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer. Thank you!


    • Edited by Wouter L Monday, October 9, 2017 8:20 AM
    Monday, October 9, 2017 8:19 AM

All replies

  • After many attempts and troubleshooting, I found the solution!

    The configuration change 2009a and 2009b are adding already existing objects to the MIM Service (Service Partition Name attribute & binding to request). I have migrated the configuration from the previous MIM setup to a clean installation prior to upgrading to 4.4.1459.0. During the migration, the Service Partition Name objects were already created and the hotfix fails.

    Solution:

    After the hotfix fails (by displaying error alert), do not press ok. Go to your MIM Service installation folder and locate "Microsoft.IdentityManagement.DatabaseUpgrade.exe.config". Copy this file to another location. Open de file and remove the lines with tag ConfigurationChange and Id "ConfigurationChange2009a/b". Create a backup of the original .config file and replace it with the newly updated config file. Restore your database and re-run the hotfix.

     <ConfigurationChange Id="ConfigurationChange2009a" File="ServicePartitionNameAttribute.xml" EmbeddedAsResource="True" PreSql="NoOperation.sql" PostSql="ConfigurationChange2009Attribute.sql" SourceVersion="2009" />
     <ConfigurationChange Id="ConfigurationChange2009b" File="ServicePartitionNameBinding.xml" EmbeddedAsResource="True" PreSql="NoOperation.sql" PostSql="ServicePartitionNamePopulated.sql" SourceVersion="2009" />
       

    Best regards,

    Wouter


    <b>Wouter Landuyt | IS4U FIM/MIM Expert Blog: <a href="http://blog.is4u.be/"> blog.is4u.be</a></b><br/> <br/> If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer. Thank you!

    • Proposed as answer by Varun Kohli Friday, November 1, 2019 11:31 AM
    Tuesday, October 24, 2017 2:55 PM