Sitecore: Server Error in '/' Application : Empty strings are not allowed. Parameter name: handleId

2.5k Views Asked by At

My regression testing is on going to an upgraded Sitecore instance of 8.0-U3 to 8.1-U2. And one piece of the testing is to check if the workflow is properly working as expected.

So I created a new sample item named PAGE ABC (template: /sitecore/templates/Sample/Sample Item) under the /sitecore/content/home node.

The workflow of the PAGE ABC is 'Sample workflow' (template: /sitecore/system/Workflows/Sample Workflow) which was provided on a freshly installed Sitecore instance.

The PAGE ABC was created without any issue, but when I submitted the PAGE ABC, I encountered an ArgumentException shown below:

Server Error in '/' Application.
________________________________________
Empty strings are not allowed.
Parameter name: handleId
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.ArgumentException: Empty strings are not allowed.
Parameter name: handleId

Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[ArgumentException: Empty strings are not allowed.
Parameter name: handleId]
   Sitecore.Diagnostics.Assert.ArgumentNotNullOrEmpty(String argument, String argumentName) +204
   Sitecore.Workflows.WorkflowUIHelper.ExtractFieldsFromFieldEditor(String handleId) +48
   Sitecore.Shell.Framework.Commands.Workflow.Run(ClientPipelineArgs args) +900

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +128
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
   Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) +89
   Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline) +313
   Sitecore.Web.UI.Sheer.ClientPage.ResumePipeline() +224
   Sitecore.Web.UI.Sheer.ClientPage.OnPreRender(EventArgs e) +825
   Sitecore.Shell.Applications.ContentManager.ContentEditorPage.OnPreRender(EventArgs e) +24
   System.Web.UI.Control.PreRenderRecursiveInternal() +197
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7763


________________________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1073.0

Note: In this case, all the required fields are populated. I also tried leaving one (1) required field empty but same problem persist.

I searched for the keyword 'handleId' parameter on the entire website and I found this section on my \temp folder _UpgradeHistory which I suspected has something to do with the above issue inside the Sitecore.Kernel.xml

   <member name="M:Sitecore.Workflows.WorkflowUIHelper.ExtractFieldsFromFieldEditor(System.String)">
        <summary>
        Extract the field values set by the field editor
        </summary>
        <param name="handleId">The Id of the handle holding the return values from the field editor</param>
        <returns>A NameValueCollection containg the fields</returns>
    </member>

I also tried searching over the internet, but I didn't find any relative solution to my problem.

Edited: I created a freshly instance of Sitecore v.8.1-U2. Replace the master db in the ConnectionString.config of the upgrade instance and the workflow submit action works, then I attached back the upgraded master database and I encountered again the issue.

Edited: I actually also noticed that there's a difference in the dialog box of the workflow. It is small compared to the working instance, which is a bigger dialog box. See supporting screenshots below:

Figure 1 : Not working workflow

Not working workflow

Figure 2 : Working workflow

Working workflow

I will post a more detailed investigation when I got new information. Appreciate any help. Thanks.

2

There are 2 best solutions below

1
Hishaam Namooya On

EDITED Since when changing the master database, the workflow works. Then the issue comes with the items. Can you check if the template of the workflow is the same as compared with the working instance.

Path is /sitecore/templates/System/Workflow

4
Marvin Glenn Lacuna On

I found the fix and the root cause.

First, I recreated the issue by creating a new workflow 'WORKFLOW ABC' under /sitecore/system/Workflows, I added the necessary actions, such as Draft and Published, and then create a new template and assign the 'WORKFLOW ABC'. I also created an actual item and tried to change the workflow of the item from Submit to Published. The error appeared once again. (successful replication of the issue)

Then I did the same process to a freshly installed instance and I wasn't able to replicate the issue.

Root cause:

So I compared both values and there's a discrepancy, the Default Comment Template field was empty (why it took me so long to figured this out) but is existing to the freshly installed 8.1-U2 instance.

Resolution:

I changed the value of the Default Comment Template field from empty to \Templates\System\Workflow\Standard Comment Template and test again and it works.

Screenshot for easy visualization: Sample workflow with empty Default Comment Template field

You may also want to update the Default Comment Dialog Height field value to 250, but this one is optional.