Uploaded image for project: 'Couchbase ASP.NET Integration'
  1. Couchbase ASP.NET Integration
  2. CBASP-21

System.ArgumentNullException with ASP.NET Session Management

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.0.0-beta3
    • 2.0.0-beta2
    • None

    Description

      From https://forums.couchbase.com/t/argumentnullexception-in-sessionstateprovider/7406

      exception : "System.Web.HttpException (0x80004005): Exception of type 'System.Web.HttpException' was thrown. ---> System.ArgumentNullException: Buffer cannot be null. NEWLINETOKEN Parameter name: buffer NEWLINETOKEN at System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable) NEWLINETOKEN at System.IO.MemoryStream..ctor(Byte[] buffer) NEWLINETOKEN at Couchbase.AspNet.SessionState.CouchbaseSessionStateProvider.SessionStateItem.Load(String headerPrefix, String dataPrefix, IBucket bucket, String id, Boolean metaOnly) NEWLINETOKEN at Couchbase.AspNet.SessionState.CouchbaseSessionStateProvider.SessionStateItem.Load(IBucket bucket, String id, Boolean metaOnly) NEWLINETOKEN at Couchbase.AspNet.SessionState.CouchbaseSessionStateProvider.GetSessionStoreItem(IBucket bucket, HttpContext context, Boolean acquireLock, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) NEWLINETOKEN at Couchbase.AspNet.SessionState.CouchbaseSessionStateProvider.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) NEWLINETOKEN at System.Web.SessionState.SessionStateModule.GetSessionStateItem() NEWLINETOKEN at System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(Object state) NEWLINETOKEN at System.Web.HttpAsyncResult.End() NEWLINETOKEN at System.Web.SessionState.SessionStateModule.EndAcquireState(IAsyncResult ar) NEWLINETOKEN at System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar)",

      This is presumably happening because that Load() function gets the header document and then checks to see if Status == KeyNotFound, but doesn't check to see if it failed for any other reason. Then a scenario where the Get() fails for some other reason happens, thus resulting in a null object being sent into MemoryStream(). Should the header document check to see if the value == null similar to how it checks the session document in the same function? Or at least check value.Success?

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              jmorris Jeff Morris
              jmorris Jeff Morris
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty