When ever we try to update a user using an ASP.net MVC4 website, we get this error. Please help me to find out . This was working previously without any issue.
ErrorCode<ERRCA0012>:SubStatus<ES0001>
:Object being referred to is not locked by any client.
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: Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode<ERRCA0012>:SubStatus<ES0001>:
Object being referred to is not locked by any client.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[DataCacheException: ErrorCode<ERRCA0012>:SubStatus<ES0001>:Object being referred to is not locked by any client.]
Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ErrStatus errStatus, Guid trackingId, Exception responseException, Byte[][] payload, EndpointID destination) +551
Microsoft.ApplicationServer.Caching.SocketClientProtocol.ExecuteApi(IVelocityRequestPacket request, IMonitoringListener listener) +287
Microsoft.ApplicationServer.Caching.SocketClientProtocol.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout, DataCacheTag[] tags, String region, IMonitoringListener listener) +360
Microsoft.ApplicationServer.Caching.DataCache.InternalPutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout, DataCacheTag[] tags, String region, IMonitoringListener listener) +216
Microsoft.ApplicationServer.Caching.<>c__DisplayClass9d.<PutAndUnlock>b__9c() +160
Microsoft.ApplicationServer.Caching.DataCache.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout) +276
Microsoft.Web.DistributedCache.<>c__DisplayClass1c.<PutAndUnlock>b__1b() +52
Microsoft.Web.DistributedCache.<>c__DisplayClass31`1.<PerformCacheOperation>b__30() +19
Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(Action action) +208
Microsoft.Web.DistributedCache.DataCacheForwarderBase.PerformCacheOperation(Func`1 func) +167
Microsoft.Web.DistributedCache.DataCacheForwarderBase.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout) +162
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +929
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270
Please check if your requests are not timing out. We also faced exact same issue in our project and we found this blog post really helpful in finding why we were running into this issue: http://www.anujvarma.com/session-storage-app-fabric-cache/.
One thing we initially did was increased the request timeout to 5 minutes (300 seconds) in web.config as mentioned in the blog post. However we only did it for the action where we knew we would encounter the timeout issue. To change the timeout for all actions, you could do something like below which was mentioned in the post:
<system.web>
<httpRuntime executionTimeout = "300"/>
</system.web>
Or you could do is increase the timeout for specific action:
<location path="Controller/Action">
<system.web>
<httpRuntime executionTimeout="300"/>
</system.web>
</location>
IMHO, 2nd option is more preferable over the 1st one because you're targeting specific actions instead of your entire site.
However as mentioned in my comments as well, this is not really foolproof. Better alternative would be to optimize the code first so that your requests are not taking long time. In our case, we had a bad retry policy for storage operations and we fixed the issue by modifying that retry policy.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments