We have a form (modern design) that has several tabs and a few collections as well. The form is submitted by an anonymous user, then a similar form with a few additional fields is used by a licensed user to review the submission. Sometimes, the reviewer needs to see the form again in their Completed Tasks but when they go there, some of the forms cannot be viewed again. The forms client displays the error:
Laserfiche Forms has encountered a problem.
An unexpected error has occurred. [LFF502-UnexpectedError]
A review of the Admin log in Event Viewer on the Forms server shows this message:
Inner exception: System.ArgumentException Message: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Laserfiche.Forms.Routing.ModernFormTokenGenerator.BuildRepeatableToken(Dictionary`2& tokenDict) at Laserfiche.Forms.Routing.ModernFormTokenGenerator.BuildDataSetTokens(XmlDocument xml, Dictionary`2& tokenDict) at Laserfiche.Forms.Routing.ModernFormTokenGenerator.GenerateFromXml(XmlDocument xml, cf_users submitter, ParseTokenOptions options) at E_Forms.Classes.ModernFormDataProvider.GetFormsInfo(Boolean prevXml, NameValueCollection retainCollection) at E_Forms.Models.ViewModels.ModernForm.ModernFormRendererModel.ConstructFormInfo(FormSetting formSetting, Boolean prevXml, NameValueCollection retainCollection) at E_Forms.Models.ViewModels.ModernForm.ModernFormRendererModel.RetrieveFormInfoFromSubmission(Int32 submissionId, Int32 rawInstanceId, Int32 currentUser, String redirectUrl, Boolean viewSubmission) at E_Forms.Controllers.FormController.AVSubmission(String routingResumeId, Int32 instanceId, Int32 submissionId, Boolean clientHandlesRedirect, String oldResumeId, Boolean readonly, Boolean outsideInbox) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c.<BeginInvokeSynchronousActionMethod>b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_0.<InvokeActionMethodFilterAsynchronouslyRecursive>b__0() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_6.<BeginInvokeAction>b__4() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult)
Not sure where to go from here. The user is only trying to view a form already submitted, so there's no data being submitted. Not sure how a duplicate key could be created when nothing should be created.
This error is very, very difficult to reproduce as it only happens on some of the submitted forms.