This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided "as is" with no warranties.

Issue

A K2 4.7 upgrade fails with the setup manager hanging on registering controls and deploying KSPX packages.
Running a repair results in the same behavior.
The installation completes but K2 service is unable to start.

Symptoms

Following errors are found in the installation trace log:

"SC_Trace.ParseTrace: 22:16:09:>> Logged Error: Target did not complete successfully: Register_Control_Tree 1:16: SC_Trace.ParseTrace: 22:16:09:>> Logged Error: Package deployment timeout reached, stopping. 1:16: SC_Trace.ParseTrace: 22:16:09:>> Logged Error: Target did not complete successfully: Management.kspx 1:16: SC_Trace.ParseTrace: 22:16:09:>> Logged Error: Target did not complete successfully: DocuSign_Feature_Activation.kspx 1:16: SC_Trace.ParseTrace: 22:16:09:>> Logged Error: Package deployment timeout reached, stopping. 1:16: SC_Trace.ParseTrace: 22:16:09:>> Logged Error: Target did not complete successfully: K2 Package and Deployment for SharePoint.kspx 1:16: SC_Trace.ParseTrace: 22:16:09:>> Logged Error: Package deployment timeout reached, stopping. 1:16: SC_Trace.ParseTrace: 22:16:09:>> Logged Error: Target did not complete successfully: K2 for SharePoint 2013.kspx 1:16: SC_Trace.ParseTrace: 22:16:09:>> Logged Error: Package deployment timeout reached, stopping. 1:16: SC_Trace.ParseTrace: 22:16:09:>> Logged Error: Target did not complete successfully: SmartForms Tester Collateral.kspx 1:16: SC_Trace.ParseTrace: 22:16:09:>> Logged Error: Component update failed: K2 blackpearl Server 4:9: DeployPackage.Execute: 18:58:07:>> Logged Error: Package deployment timeout reached, stopping. 4:8: Log.WriteUnindent: 18:58:07:>> End deploy Package 4:8: Component.ExecuteTarget: 18:58:07:>> Logged Error: Target did not complete successfully: Management.kspx Logged Error: Target did not complete successfully: DocuSign_Feature_Activation.kspx DeployPackage.Execute: 20:03:18:>> Logged Error: Package deployment timeout reached, stopping. 4:8: Log.WriteUnindent: 20:03:18:>> End deploy Package 4:8: Component.ExecuteTarget: 20:03:18:>> Logged Error: Target did not complete successfully: K2 Package and Deployment for SharePoint.kspx DeployPackage.Execute: 21:08:22:>> Logged Error: Package deployment timeout reached, stopping. 4:8: Log.WriteUnindent: 21:08:22:>> End deploy Package 4:8: Component.ExecuteTarget: 21:08:22:>> Logged Error: Target did not complete successfully: K2 for SharePoint 2013.kspx DeployPackage.Execute: 22:13:24:>> Logged Error: Package deployment timeout reached, stopping. 4:8: Log.WriteUnindent: 22:13:24:>> End deploy Package 4:8: Component.ExecuteTarget: 22:13:24:>> Logged Error: Target did not complete successfully: SmartForms Tester Collateral.kspx PatchPanel.Patch: 22:13:46:>> Logged Error: Component update failed: K2 blackpearl Server 4:8: PatchPanel.Patch: 22:13:46:>> Patching: K2 blackpearl Setup Manager"

Resolution

To fix the issues give the K2 Service account full rights to the following directories:

%ProgramData%\SourceCode\Temp
 Program Files (x86)\K2 Blackpearl

Next, clear up the contents of this sourcecode\Temp folder.
- Run K2 Blackpearl Setup Manager from installation media and select Configure.
- This resolved the control error issue first part.

We then looked at the deployment log for the first management.kspx that failed in the following directory:
C:\Program Files (x86)\K2 blackpearl\Setup\Management.log

The following error was displayed: 

"Method not found: 'Void SourceCode.Forms.Design.DefinitionUtility.Merge(SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection, SourceCode.Forms.Design.Merging.IMergeInfoProvider, SourceCode.Forms.Authoring.View, SourceCode.Forms.Authoring.View, SourceCode.Forms.Design.Merging.MergeContext)'. at SourceCode.Runtime.Services.Forms.MergeProvider.MergeAuthoringInstances(IMergeInfoProvider mergeProvider, IBaseNamedObject source, IBaseNamedObject target, ComplexType complexType) at SourceCode.Runtime.Services.Forms.MergeProvider.Merge(ComplexType complexType, IBaseNamedObject instance) at SourceCode.Runtime.Services.Forms.MergeProvider.Merge(ComplexType complexType) at SourceCode.Runtime.Services.Forms.Services.BaseFormViewService`3.Deploy(IDeploymentContext context) Failed! View com.K2.System.Management.View.ProcessInstanceList | 00:00:00.0234799 Method not found: 'Void SourceCode.Forms.Design.DefinitionUtility.Merge(SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection, SourceCode.Forms.Design.Merging.IMergeInfoProvider, SourceCode.Forms.Authoring.View, SourceCode.Forms.Authoring.View, SourceCode.Forms.Design.Merging.MergeContext)'. Success! ServiceObject Workflow_Management_ManagementService_GetProcActivities | 00:00:01.1888514 Success! ServiceObject Workflow_Management_ManagementService_GotoActivity | 00:00:01.2054150 Success! SmartObject com_K2_System_Workflow_SmartObject_Activity | 00:00:00.0739959 Method not found: 'Void SourceCode.Forms.Design.DefinitionUtility.Merge(SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection, SourceCode.Forms.Design.Merging.IMergeInfoProvider, SourceCode.Forms.Authoring.View, SourceCode.Forms.Authoring.View, SourceCode.Forms.Design.Merging.MergeContext)'. at SourceCode.Runtime.Services.Forms.MergeProvider.MergeAuthoringInstances(IMergeInfoProvider mergeProvider, IBaseNamedObject source, IBaseNamedObject target, ComplexType complexType) at SourceCode.Runtime.Services.Forms.MergeProvider.Merge(ComplexType complexType, IBaseNamedObject instance) at SourceCode.Runtime.Services.Forms.MergeProvider.Merge(ComplexType complexType) at SourceCode.Runtime.Services.Forms.Services.BaseFormViewService`3.Deploy(IDeploymentContext context) Failed! View com.K2.System.Management.View.ActivityList | 00:00:00.0110843 Method not found: 'Void SourceCode.Forms.Design.DefinitionUtility.Merge(SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection, SourceCode.Forms.Design.Merging.IMergeInfoProvider, SourceCode.Forms.Authoring.View, SourceCode.Forms.Authoring.View, SourceCode.Forms.Design.Merging.MergeContext)'. Method not found: 'Void SourceCode.Forms.Design.DefinitionUtility.Merge(SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection, SourceCode.Forms.Design.Merging.IMergeInfoProvider, SourceCode.Forms.Authoring.View, SourceCode.Forms.Authoring.View, SourceCode.Forms.Design.Merging.MergeContext)'. at SourceCode.Runtime.Services.Forms.MergeProvider.MergeAuthoringInstances(IMergeInfoProvider mergeProvider, IBaseNamedObject source, IBaseNamedObject target, ComplexType complexType) at SourceCode.Runtime.Services.Forms.MergeProvider.Merge(ComplexType complexType, IBaseNamedObject instance) at SourceCode.Runtime.Services.Forms.MergeProvider.Merge(ComplexType complexType) at SourceCode.Runtime.Services.Forms.Services.BaseFormViewService`3.Deploy(IDeploymentContext context) Failed! Form com.K2.System.Management.Form.ProcessInstanceGoToActivity | 00:00:00.0183143 Method not found: 'Void SourceCode.Forms.Design.DefinitionUtility.Merge(SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection, SourceCode.Forms.Design.Merging.IMergeInfoProvider, SourceCode.Forms.Authoring.View, SourceCode.Forms.Authoring.View, SourceCode.Forms.Design.Merging.MergeContext)'."

From the above error it we determined that there is a mismatch with assemblies in the K2 installation and in the global assembly cache.
We looked at the following assemblies mentioned in the error above and compared them to the GAC assemblies:

C:\Program Files (x86)\K2 blackpearl\Host Server\Bin\SourceCode.Forms.Design.dll version "4.16200.16348.1"
Global Assembly Cache: assembly version "4.16200.18060.2"

The SourceCode.Forms.Design.dll caused the failure with the installation.
This is not resolved by running a K2 repair, the K2 setup manager looks in the Global assembly cache if a version number is higher than the current setup dll. It will not replace it causing the failure and the long installation time.
Use GACUTIL to replace the SourceCode.Forms.Design.dll 4.16200.18060.2 with the SourceCode.Forms.Design.dll 4.16200.16348.1 in the global assembly cache.

Once this was done running a repair it completed with no issues.
It was determined that this was caused with a K2 4611.57 4.6.11 rollup and that any rollup after version 57 can cause this to occur on a upgrade.