Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

SoException with webappusage-table


Moved topic from api-forum to here general support if this is more appropriate place.

I've had problems with this webappusage-table before but this exception is new. Below are details of exception.

Our customer's SuperOffice-version is "SuperOffice NetServer 8.5 Release (Build: Release85_C-2019.09.03-01)", so is problem possibly fixed in later releases? Error is annoying since it seems to crash whole app pool in IIS causing all users to log out.


Exception: SuperOffice.Exceptions.SoException

Message: The field named webappusage.aggregateCount caused an exception

StackTrace: at SuperOffice.Data.Dialect.Dialect.UpdateSql(PrivateSave cmd)
at SuperOffice.Data.Dialect.Dialect.GenerateSql(SqlCommand cmd)
at SuperOffice.Data.QueryProcessor.GenerateSql()
at SuperOffice.Data.SoCommand.ExecuteNonQuery()
at SuperOffice.Data.QueryExecutionHelper.StartQuery(SqlCommand command, ExecutionType executionType, Boolean ignoreSentry, Boolean executeScalar, Boolean useUnauthenticatedConnection, SoConnection explicitConnection)
at SuperOffice.Data.QueryExecutionHelper.ExecuteNonQuery(SqlCommand command, Boolean ignoreSentry)
at SuperOffice.CallHome.FactoryStatisticsWriter._writeTimer_Elapsed(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireNextTimers()

InnerException: SuperOffice.Exceptions.SoException

Message: Failed to invoke the ToSql(...) method with argument(s): [SuperOffice.Data.SQL.Parameter] : @P0 of type dbUInt with value: 2149847551

StackTrace: at SuperOffice.Data.Dialect.Dialect.InvokeToSql(Object[] toSqlArguments)
at SuperOffice.Data.Dialect.Dialect.UpdateSql(PrivateSave cmd)

InnerException: System.Reflection.TargetInvocationException

Message: Exception has been thrown by the target of an invocation.

StackTrace: 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 SuperOffice.Data.Dialect.Dialect.InvokeToSql(Object[] toSqlArguments)

InnerException: System.OverflowException

Message: Value was either too large or too small for an Int32.

StackTrace: at System.Convert.ToInt32(UInt32 value)
at SuperOffice.Data.Dialect.Dialect.ConvertToDbParameterType(Object value, FieldDataType dataType)
at SuperOffice.Data.Dialect.Dialect.ToSql(Parameter arg)

RE: SoException with webappusage-table

Hi Mikko,

the error is saying that SuperOffice is trying to write the number 2,149,847,551 into the crm7.webappusage.aggregatedCount field. That field is defined as an INT, and cannot contain a number larger than 2,147,483,647.

You could run a query to see if there are any suspect rows using

select top 20 * from crm8.webappusage order by aggregateCount desc

I'm not sure what the number is an aggregate of. Most likely there are two potential fixes. I haven't tried, so you need to figure out how to test this safely yourself.

You could either delete the rows from the crm8.webappusage table (I'm not sure if there are any consequences), or figure out if there is a way to disable writing to webappusage table. 

Which version are you on?

Af: Frode Lillerud 10. sep 2020

RE: SoException with webappusage-table

Thanks for answer! Our customer has version 8.5 R04 installed.

Seems like clearing webappusage is temporary solution but table fills up soon again. Usually errors start again in next day. But maybe I should automate some cleaning script to be runned regularly.

Looks like viewState "classFactory.Database.retrieve.SuperOffice.Configuration.ConfigFile:Security:SentrySection" has biggest aggregateCount by far.

Af: Mikko Tillikainen 10. sep 2020

RE: SoException with webappusage-table

If this is a recurring issue already after 1 day, I believe that the Web/Netsever team may want to know the source of the event. This is the text in the WEBAPPUSAGE.viewState field of the offending record.
Let us know.


Af: Conrad Weyns 10. sep 2020

RE: SoException with webappusage-table

Based on that viewState "classFactory.Database.retrieve.SuperOffice.Configuration.ConfigFile:Security:SentrySection" has the highest aggregateCount, do you have anything custom defined in the Sentry part of the web.config file (or batch task service config file)? Any custom sentry's being loaded?

Af: David Hollegien 10. sep 2020

RE: SoException with webappusage-table

Unfortunately I can't say which viewState it is because it's not shown in any logs. And I assume exception is thrown before row is inserted/updated in database so sql profiling can't help either. But "classFactory.Database.retrieve.SuperOffice.Configuration.ConfigFile:Security:SentrySection" was biggest entry so that might be it.

There is no custom sentries involved AFAIK, but customer uses SuperOffice very actively all the time and they have lots of users.

Af: Mikko Tillikainen 11. sep 2020

RE: SoException with webappusage-table

It looks like this problem will be solved by upgrading to 8.5-R15

Bug 72680: Webappusage error with large uint

Solved and released in 8.5-R15


I advice you to upgrade and verify that this solves your issue


Af: Erik Eide 11. sep 2020

RE: SoException with webappusage-table

Thanks for info. I'll suggest upgrade for customer.

Af: Mikko Tillikainen 11. sep 2020