Null buffer error

1.7k Views Asked by At

I've just noticed that when running an application I periodically get an error message.

Server Error in '/' Application.
Buffer cannot be null.
Parameter name: buffer
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.ArgumentNullException: Buffer cannot be null.
Parameter name: buffer

Stack trace:

    [ArgumentNullException: Buffer cannot be null.
Parameter name: buffer]
   System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable) +12627669
   MemcachedProviders.Session.Common.Deserialize(HttpContext context, Byte[] serializedItems, Int32 timeout) +47
   MemcachedProviders.Session.Db.SQLDbOperations.GetItem(String strSessionId, String strApplicationName, Int32 iTime, HttpContext context, Boolean lockRecord, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags) +1221
   MemcachedProviders.Session.SessionStateProvider.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) +1069
   System.Web.SessionState.SessionStateModule.GetSessionStateItem() +178
   System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(Object state) +299

[HttpException (0x80004005): Exception of type 'System.Web.HttpException' was thrown.]
   System.Web.SessionState.SessionStateModule.EndAcquireState(IAsyncResult ar) +11513726
   System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107

Our application uses Enyim memcached and MemcachedProviders and runs in a load balanced environment.

The application does alot of managing of PDF reports and compiling of responses then generating a final report pdf. So we use streams quite a bit.

This problem only appears to affect our management application as we also expose a webservice and I never get the error when looking at the service definition and WSDL.

From looking at the session table in the DB I can see that they are being created but, many of them have null in the SessionItems field and the locked flag set to 1. The data time stamps seem to correlate to the null buffer error occurances.

Is this a case of a buffer set incorrectly or maxing out?

0

There are 0 best solutions below