Skip to main content


 

Symptoms

 


When attempting to fetch the forms in K2 iOS app, the application throws a "Sorry, something went wrong" error. There is a "500 internal server error" that is being thrown for the following URL:

https://k2.denallix.com/k2api/api/category/Application Forms
 

 

Diagnoses

 


Using Fiddler as a proxy, we captured the following error:

{"Message":"An error has occurred.","ExceptionMessage":"An error occurred when trying to create a controller of type 'CategoryController'. Make sure that the controller has a parameterless public constructor.","ExceptionType":"System.InvalidOperationException","StackTrace":" at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)
at System.Web.Http.Controllers.HttpControllerDescriptor.CreateController(HttpRequestMessage request)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()","InnerException":{"Message":"An error has occurred.","ExceptionMessage":"None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'SourceCode.Services.WebApi.Controllers.V1_1.CategoryController' can be invoked with the available services and parameters:
Cannot resolve parameter 'System.Lazy`1aSourceCode.Forms.Management.FormsManager] formsManager' of constructor 'Void .ctor(System.Lazy`1aSourceCode.Categories.Client.CategoryManager], System.Lazy`1aSourceCode.Forms.Management.FormsManager], SourceCode.Client.ITranslatorService)'.","ExceptionType":"Autofac.Core.DependencyResolutionException","StackTrace":" at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable`1 parameters)
at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.GetInstanceOrActivator(HttpRequestMessage request, Type controllerType, Func`1and activator)
at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)"}}

Looking at the 'SourceCode.Services.WebApi.dll' assembly being referenced its size and version indicates that this is the assembly from the K2 Blackpearl installer instead of the K2 Smartforms installer.

1. The K2 blackpearl installation will create the 'SourceCode.Services.WebApi.dll' file with the 258 KB size version
2. The K2 Smartforms installation (which will usually happen next) will replace this 'SourceCode.Services.WebApi.dll' file with the 261 KB size version this is as intended
 

 

Resolution

From the installation logs attached, it would seem that there had been a K2 blackpearl repair which will likely had replaced the 261 KB file from Smartforms installation with the 258 KB file from Blackpearl; which resulted in the internal server error that we were seeing. When a K2 Blackpearl repair is needed, a Smartforms repair as well as a K2 blackpearl for Sharepoint 2013 repair is also necessary. Repairing both K2 Smartforms and K2 for Sharepoint 2013 resolved the issue.

 

 



 
Be the first to reply!

Reply