IIS Setting on the App Pool

Hello All,

We are seeing some quirky issues on version 23.1.8

Issue is Folks start to see errors on customization, which is “fixed” by restarting the app pool in EAS
image

Is the .NET on the app pool supposed to be No Managed Code?

image

Maybe this is a rabbit hole, just tring to stay ahead of the potential issues.

From the 2023.1 install guide.
“For your application server, your IIS Application Pool has its .NET CLR version set to No Managed Code.
The application server then works with IIS using an in-process hosting model. You can only host one
application within a Kinetic 2022 application pool.”

It looks like his IIS pool is setup as No Managed Code. Doesn’t show how many apps are in that pool, but unless Ken s doing really weird stuff it will only be 1.

Yes only one application per pool.

All of the errors are on dynamic querying. If there are mutiple calls during one function.

We restart the app pool and like magic, :magic_wand: application starts working again.

I changed my dev apppool to no managed code and recycled and the admin console and client started throwing errors until I set it back to v4

I saw your version and went to check my test 23.1 and they were set as unmanaged and running :man_shrugging:

Your error is coming from application, not IIS itself. Probably IIS restart just clears the app pool cache and the problem is not reproduced until another time.

You better look at the full error stack in the error message and in the server event viewer, they will give you more information about what is wrong.

And yes, 2023 app pool should run with No Managed Code

1 Like

Here is the error. Has something to do with dynamic query. I’ll post the code in a bit.
Resetting the app pool “fixes” this.


## System Information ##
==================

 

AppServer Connection: https://KINETIC.embedtek.local/Kinetic2023_1
Form Name: ShellMenuForm
Customization Name: 
Menu ID: 
Software Version: 4.2.300.8

 

============

 

Application Error

 

Exception caught in: mscorlib

 

## Error Detail ##
============
##!Message:##! Exception has been thrown by the target of an invocation.
##!Inner Exception Message:##! This is a duplicate entry of an existing record
##!Program:##! CommonLanguageRuntimeLibrary
##!Method:##! InvokeMethod

 

## Client Stack Trace ##
==================
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeScriptMethod(MethodInfo scriptMethod, Object[] parameters)
   at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeInitializeCustomCodeIfExists()
   at Ice.Lib.Customization.CustomScriptManager.TryActionShowExceptionBoxOrLogVerificationErrorIfException(Action action, String exceptionBoxTitle)

 

## Inner Exception ##
===============
This is a duplicate entry of an existing record

 

##  ##

 

   at Ice.Cloud.ProxyBase`1.CallWithCommunicationFailureRetry(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, RestRpcValueSerializer serializer)
   at Ice.Cloud.ProxyBase`1.CallWithMultistepBpmHandling(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, Boolean useSparseCopy)
   at Ice.Cloud.ProxyBase`1.Call(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, Boolean useSparseCopy)
   at Ice.Proxy.BO.DynamicQueryImpl.Execute(DynamicQueryDataSet queryDS, QueryExecutionDataSet executionParams)
   at Ice.Adapters.DynamicQueryAdapter.ExecuteDashboardParameterized(DynamicQueryDataSet ds, QueryExecutionDataSet executionDs)
   at Script.GetUDCodes(String CodeType)
   at Script.InitializeCustomCode()

Is this a BAQ Widget on the Modern Shell?

Custom code on client customization. Once the error starts occurring the second call to GetUDCodes causes the error.

Here is the code.

Modular Level Variables

private EpiDataView edvCauseCodes;
private EpiDataView edvResCodes;

In initialization

public void InitializeCustomCode()
	{
		edvCauseCodes = new EpiDataView();
		edvCauseCodes.dataView = GetUDCodes("CaseCause");
		oTrans.Add("edvCauseCodes", edvCauseCodes);
		
		edvResCodes = new EpiDataView();
		edvResCodes.dataView = GetUDCodes("CaseRes");
		oTrans.Add("edvResCodes", edvResCodes);

GetUDCodes Function

private DataView GetUDCodes(string CodeType)
    {
		#region Create the QueryExecutionDataSet and set the parameters for the query
	
		dqaUserCodes = new DynamicQueryAdapter(oTrans);
		dqaUserCodes.BOConnect();
		dqaUserCodes.GetDashboardQuery("GetUserCodes");
		
		QueryExecutionDataSet parameters = new QueryExecutionDataSet();
		
		DataRow parameterRow1 = parameters.ExecutionParameter.NewRow();
		parameterRow1["ParameterID"] = "CodeTypeID";
		parameterRow1["ParameterValue"] = CodeType;
		parameterRow1["ValueType"] = "x(50)";
		parameterRow1["IsEmpty"] = false;
		parameterRow1["RowMod"] = "";
		parameters.ExecutionParameter.Rows.Add(parameterRow1);
		
		#endregion
		
		dqaUserCodes.ExecuteDashboardParameterized(dqaUserCodes.RuntimeQuery, parameters);

		return new DataView(dqaUserCodes.QueryResults.Tables["Results"]);
		//edvCauseCodes.dataView = new DataView(dqaUserCodes.QueryResults.Tables["Results"]);	
    }

error is on this line

dqaUserCodes.ExecuteDashboardParameterized(dqaUserCodes.RuntimeQuery, parameters);

When we step through in Debug in Visual Studio, no error.

Let it run on it’s own, errors out. It’s like the runtime is making calls out of sync or multiple times.

Update the code to the following based on a forum search. No errors, and we didn’t need to restart the pool.

:hand_with_index_finger_and_thumb_crossed: :hand_with_index_finger_and_thumb_crossed: :hand_with_index_finger_and_thumb_crossed: That is the trick.

private DataView GetUDCodes(string CodeType)
    {
		#region Create the QueryExecutionDataSet and set the parameters for the query	
		using (DynamicQueryAdapter dqaUserCodes = new DynamicQueryAdapter(oTrans))
    	{				
			dqaUserCodes.BOConnect();
			var queryExecutionDataSet = new QueryExecutionDataSet();
			queryExecutionDataSet.ExecutionParameter.AddExecutionParameterRow("CodeTypeID", CodeType, "x(50)", false, Guid.Empty, "A");
			dqaUserCodes.ExecuteByID("GetUserCodes", queryExecutionDataSet);
			return new DataView(dqaUserCodes.QueryResults.Tables["Results"]);
		}
		#endregion
    }

I was about to suggest using a “using”. In your original code you were not disposing anything. My guess is you were getting a duplicate for of the Execution Params.

1 Like

Thanks.

Sometimes posting the code here is the perspective needed to make things work. LOL

I would guess @jgiese.wci you are correct on the parameter values.

2 Likes