Seeing this error

Topics: Troubleshooting
Apr 11 at 3:57 PM
I keep getting the below error in the logs, I think that it is one of the contributory factors to Orchard 1.10 running very slowly on my development machine.

Has anyone seen this or something similar before?
2016-04-11 15:55:42,629 [9] NHibernate.AssertionFailure - (null) - An AssertionFailure occurred - this may indicate a bug in NHibernate or in your custom types. [(null)]
NHibernate.AssertionFailure: null id in Orchard.Tasks.Locking.Records.DistributedLockRecord entry (don't flush the Session after an exception occurs)
2016-04-11 15:55:42,690 [9] Orchard.Tasks.Locking.Services.DistributedLockService - (null) - An error occurred while trying to acquire lock 'DistributedLock:Default:Orchard.JobsQueue.Services.JobsQueueProcessor'. [(null)]
NHibernate.AssertionFailure: null id in Orchard.Tasks.Locking.Records.DistributedLockRecord entry (don't flush the Session after an exception occurs)
   at NHibernate.Event.Default.DefaultFlushEntityEventListener.CheckId(Object obj, IEntityPersister persister, Object id, EntityMode entityMode)
   at NHibernate.Event.Default.DefaultFlushEntityEventListener.GetValues(Object entity, EntityEntry entry, EntityMode entityMode, Boolean mightBeDirty, ISessionImplementor session)
   at NHibernate.Event.Default.DefaultFlushEntityEventListener.OnFlushEntity(FlushEntityEvent event)
   at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEntities(FlushEvent event)
   at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event)
   at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
   at NHibernate.Impl.SessionImpl.Flush()
   at NHibernate.Transaction.AdoTransaction.Commit()
   at Orchard.Data.TransactionManager.DisposeSession() in C:\Orchard\Orchard-master\src\Orchard\Data\SessionLocator.cs:line 92
   at Orchard.Data.TransactionManager.Dispose() in C:\Orchard\Orchard-master\src\Orchard\Data\SessionLocator.cs:line 82
   at Autofac.Core.Disposer.Dispose(Boolean disposing)
   at Autofac.Util.Disposable.Dispose()
   at Autofac.Core.Lifetime.LifetimeScope.Dispose(Boolean disposing)
   at Autofac.Util.Disposable.Dispose()
   at Orchard.Tasks.Locking.Services.DistributedLockService.ExecuteOnSeparateTransaction(Action`1 action) in C:\Orchard\Orchard-master\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 206
   at Orchard.Tasks.Locking.Services.DistributedLockService.EnsureDistributedLockRecord(String internalName, Nullable`1 maxValidFor) in C:\Orchard\Orchard-master\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 142
   at Orchard.Tasks.Locking.Services.DistributedLockService.<>c__DisplayClass9_1.<AcquireLockInternal>b__0() in C:\Orchard\Orchard-master\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 103
   at Orchard.Tasks.Locking.Services.DistributedLockService.RepeatUntilTimeout(Nullable`1 timeout, TimeSpan repeatInterval, Func`1 action) in C:\Orchard\Orchard-master\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 189
   at Orchard.Tasks.Locking.Services.DistributedLockService.AcquireLockInternal(String name, Nullable`1 maxValidFor, Nullable`1 timeout, Boolean throwOnTimeout) in C:\Orchard\Orchard-master\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 102
2016-04-11 15:55:42,725 [9] Orchard.Tasks.Locking.Services.DistributedLockService - (null) - Error while trying to acquire lock 'Orchard.JobsQueue.Services.JobsQueueProcessor'. [(null)]
NHibernate.AssertionFailure: null id in Orchard.Tasks.Locking.Records.DistributedLockRecord entry (don't flush the Session after an exception occurs)
   at NHibernate.Event.Default.DefaultFlushEntityEventListener.CheckId(Object obj, IEntityPersister persister, Object id, EntityMode entityMode)
   at NHibernate.Event.Default.DefaultFlushEntityEventListener.GetValues(Object entity, EntityEntry entry, EntityMode entityMode, Boolean mightBeDirty, ISessionImplementor session)
   at NHibernate.Event.Default.DefaultFlushEntityEventListener.OnFlushEntity(FlushEntityEvent event)
   at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEntities(FlushEvent event)
   at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event)
   at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
   at NHibernate.Impl.SessionImpl.Flush()
   at NHibernate.Transaction.AdoTransaction.Commit()
   at Orchard.Data.TransactionManager.DisposeSession() in C:\Orchard\Orchard-master\src\Orchard\Data\SessionLocator.cs:line 92
   at Orchard.Data.TransactionManager.Dispose() in C:\Orchard\Orchard-master\src\Orchard\Data\SessionLocator.cs:line 82
   at Autofac.Core.Disposer.Dispose(Boolean disposing)
   at Autofac.Util.Disposable.Dispose()
   at Autofac.Core.Lifetime.LifetimeScope.Dispose(Boolean disposing)
   at Autofac.Util.Disposable.Dispose()
   at Orchard.Tasks.Locking.Services.DistributedLockService.ExecuteOnSeparateTransaction(Action`1 action) in C:\Orchard\Orchard-master\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 206
   at Orchard.Tasks.Locking.Services.DistributedLockService.EnsureDistributedLockRecord(String internalName, Nullable`1 maxValidFor) in C:\Orchard\Orchard-master\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 142
   at Orchard.Tasks.Locking.Services.DistributedLockService.<>c__DisplayClass9_1.<AcquireLockInternal>b__0() in C:\Orchard\Orchard-master\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 103
   at Orchard.Tasks.Locking.Services.DistributedLockService.RepeatUntilTimeout(Nullable`1 timeout, TimeSpan repeatInterval, Func`1 action) in C:\Orchard\Orchard-master\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 189
   at Orchard.Tasks.Locking.Services.DistributedLockService.AcquireLockInternal(String name, Nullable`1 maxValidFor, Nullable`1 timeout, Boolean throwOnTimeout) in C:\Orchard\Orchard-master\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 134
   at Orchard.Tasks.Locking.Services.DistributedLockService.TryAcquireLock(String name, Nullable`1 maxValidFor, Nullable`1 timeout, IDistributedLock& dLock) in C:\Orchard\Orchard-master\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 42
Developer
Apr 11 at 5:28 PM
Hi eRuth, we have seen this and we have a fix ready. I created a PR here: https://github.com/OrchardCMS/Orchard/pull/6737
Perhaps you could clone that branch and give it a try? If so, please let us know on the thread of the PR your findings. If it works, we can pull it into the 1.10.x branch. Thanks!
Apr 12 at 10:45 AM
Interesting - I tried it on a clean install and no problems....

Then I restored my database, included my module projects and it appeared again, which to me suggests that something in my code isn't helping, but at the moment I don't know what that is. Tempted to try another clean install, and add in the modules one by one to see what causes it, and see if I can recreate the problem
Apr 12 at 4:27 PM
Some more info on this - I seem to be generating it in a specific scenario.

I'm sending information to Orchard by calling a WebApi controller I created for that purpose, I seem to hit that error as I try to create a content item - don't know if that helps at all