glucaci / mongodb-quartz-net

MongoDB Job Store for Quartz.NET
MIT License
50 stars 39 forks source link

Quartz.JobPersistenceException add lock instance error #13

Closed CMeyer19 closed 3 years ago

CMeyer19 commented 5 years ago

Hi i have a question on the following exception.

I am running a dockerised .net core API service that schedules different types of jobs.

I keep running into this error: Quartz.JobPersistenceException: Unable to add lock instance for lock TriggerAccess on {MachineName}-{Guid}

Is this a fatal error or something i don't need to be concerned about, i only have a singleton scheduler service that is responsible for adding, removing and executing jobs.

I am using a single database with a single container.

The full exception: Quartz.JobPersistenceException: Unable to add lock instance for lock TriggerAccess on LAPTOP-CMEYER-fef7cff8-e654-40b8-8dfd-044e3799c6ab ---> System.Exception: Unable to add lock instance for lock TriggerAccess on LAPTOP-CMEYER-fef7cff8-e654-40b8-8dfd-044e3799c6ab at Quartz.Spi.MongoDbJobStore.LockManager.AddLock(LockInstance lockInstance) in C:\Sandbox\Server\Server\src\Scheduler.API\Quartz.Spi.MongoDbJobStore\LockManager.cs:line 75 at Quartz.Spi.MongoDbJobStore.LockManager.AcquireLock(LockType lockType, String instanceId) in C:\Sandbox\Server\Server\src\Scheduler.API\Quartz.Spi.MongoDbJobStore\LockManager.cs:line 54 at Quartz.Spi.MongoDbJobStore.MongoDbJobStore.StoreJobAndTrigger(IJobDetail newJob, IOperableTrigger newTrigger, CancellationToken cancellationToken) in C:\Sandbox\Server\Server\src\Scheduler.API\Quartz.Spi.MongoDbJobStore\MongoDbJobStore.cs:line 201 --- End of inner exception stack trace --- at Quartz.Spi.MongoDbJobStore.MongoDbJobStore.StoreJobAndTrigger(IJobDetail newJob, IOperableTrigger newTrigger, CancellationToken cancellationToken) in C:\Sandbox\Server\Server\src\Scheduler.API\Quartz.Spi.MongoDbJobStore\MongoDbJobStore.cs:line 214 at Quartz.Core.QuartzScheduler.ScheduleJob(IJobDetail jobDetail, ITrigger trigger, CancellationToken cancellationToken) in C:\projects\quartznet\src\Quartz\Core\QuartzScheduler.cs:line 617 at Scheduler.SchedulerService.ScheduleTriggerEvaluationAsync(String groudId, String triggerId, Boolean isActivate, DateTimeOffset date) in C:\Sandbox\Server\Server\src\Scheduler.API\Scheduler\SchedulerService.cs:line 58 at Scheduler.API.Service.SchedulerApi.ScheduleEventAsync(CalendarEventEntity calendarEventEntity) in C:\Sandbox\Server\Server\src\Scheduler.API\Scheduler.API.Service\SchedulerAPI.cs:line 270 at Scheduler.API.Service.SchedulerApi.EventEntityChangeEventAsync(IRedGreenQueueAdapter redq, JObject jo, String publishKey, String subscribeKey, String replyKey, Hashtable headers) in C:\Sandbox\Server\Server\src\Scheduler.API\Scheduler.API.Service\SchedulerAPI.cs:line 89 at DAPI.RedGreenQueue.Adapter.RedGreenQueueAdapter.ProcessSubscriptionMessageAsync(String publishKey, String subscribeKey, String replyKey, String message, Func1 effectiveMessage, Boolean logNoSubscribes, Hashtable headers) [See nested exception: System.Exception: Unable to add lock instance for lock TriggerAccess on LAPTOP-CMEYER-fef7cff8-e654-40b8-8dfd-044e3799c6ab at Quartz.Spi.MongoDbJobStore.LockManager.AddLock(LockInstance lockInstance) in C:\Sandbox\Server\Server\src\Scheduler.API\Quartz.Spi.MongoDbJobStore\LockManager.cs:line 75 at Quartz.Spi.MongoDbJobStore.LockManager.AcquireLock(LockType lockType, String instanceId) in C:\Sandbox\Server\Server\src\Scheduler.API\Quartz.Spi.MongoDbJobStore\LockManager.cs:line 54 at Quartz.Spi.MongoDbJobStore.MongoDbJobStore.StoreJobAndTrigger(IJobDetail newJob, IOperableTrigger newTrigger, CancellationToken cancellationToken) in C:\Sandbox\Server\Server\src\Scheduler.API\Quartz.Spi.MongoDbJobStore\MongoDbJobStore.cs:line 201]`

image

chrisdrobison commented 5 years ago

Did you figure this out?

smedet commented 5 years ago

Hello Chris I am getting the same exception. Please advise.

Quartz.JobPersistenceException: Unable to add lock instance for lock TriggerAccess on NON_CLUSTERED ---> System.Exception: Unable to add lock instance for lock TriggerAccess on NON_CLUSTERED at Quartz.Spi.MongoDbJobStore.LockManager.AddLock(LockInstance lockInstance) at Quartz.Spi.MongoDbJobStore.LockManager.d7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Quartz.Spi.MongoDbJobStore.MongoDbJobStore.d110.MoveNext() --- End of inner exception stack trace --- at Quartz.Spi.MongoDbJobStore.MongoDbJobStore.d110.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Quartz.Core.QuartzSchedulerThread.d28.MoveNext() [See nested exception: System.Exception: Unable to add lock instance for lock TriggerAccess on NON_CLUSTERED at Quartz.Spi.MongoDbJobStore.LockManager.AddLock(LockInstance lockInstance) at Quartz.Spi.MongoDbJobStore.LockManager.d7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Quartz.Spi.MongoDbJobStore.MongoDbJobStore.d110.MoveNext()]

kcragin commented 5 years ago

Anyone have any more thoughts on this or resolution? I'm getting this exception as well.

chrisdrobison commented 5 years ago

Now that the new Mongo supports transactions, we could probably replace the lock with a transaction call.


From: Kit Cragin notifications@github.com Sent: Monday, April 1, 2019 1:39 PM To: chrisdrobison/mongodb-quartz-net Cc: Chris Robison; Comment Subject: Re: [chrisdrobison/mongodb-quartz-net] Quartz.JobPersistenceException add lock instance error (#13)

Anyone have any more thoughts on this or resolution? I'm getting this exception as well.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/chrisdrobison/mongodb-quartz-net/issues/13#issuecomment-478717203, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABu24ak-6oUW1b-9ZV7bDguNJJKqTtwxks5vcmCNgaJpZM4YWIEV.

gabrieligbastos commented 5 years ago

+1, same here =(

vnovakovits commented 5 years ago

+1

xico002 commented 4 years ago

+1

xico002 commented 4 years ago

Did you figure this out?

Do you know why this happens? @chrisdrobison

chrisdrobison commented 4 years ago

I don’t. I don’t really maintain the library any more as I’ve moved away from using Quartz for scheduling tasks. I’m open to someone opening a PR.

NorekZ commented 4 years ago

@CMeyer19 try v3.0.5, hopefully it was just fixed...

glucaci commented 3 years ago

I will close this if was already fixed