API: Calling the API to run a job when the schedule is enabled trigger an error message #2389

Closed
djalai opened this Issue Mar 27, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@djalai

djalai commented Mar 27, 2017

Issue type: Bug report/Enhancement Request

My Rundeck detail

  • Rundeck version: 2.7.3-1 (cluster mode enabled)
  • install type: rpm
  • OS Name/version:
    Distributor ID: CentOS
    Description: CentOS Linux release 7.3.1611 (Core)
    Release: 7.3.1611
    Codename: Core

Expected Behavior
Call to the rundeck api to run a job should have triggered the targeted job or return an api error message

Actual Behavior
Got a html response with the following stack trace in the rundeck service.log -->

INFO ScheduledExecutionService: scheduling immediate job run: 920:troubleshoot_acces_serveurs
ERROR GrailsExceptionResolver: ObjectAlreadyExistsException occurred when processing request: [POST] /api/18/job/[ID]/run
Unable to store Job : 'PUREPLAYER:troubleshoot_acces_serveurs:Confluence.920:troubleshoot_acces_serveurs', because one already exists with this identification.. Stacktrace follows:
org.quartz.ObjectAlreadyExistsException: Unable to store Job : 'PUREPLAYER:troubleshoot_acces_serveurs:Confluence.920:troubleshoot_acces_serveurs', because one already exists with this identification.
at org.quartz.simpl.RAMJobStore.storeJob(RAMJobStore.java:279)
at org.quartz.simpl.RAMJobStore.storeJobAndTrigger(RAMJobStore.java:251)
at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:886)
at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:249)
at rundeck.services.ScheduledExecutionService.scheduleTempJob(ScheduledExecutionService.groovy:1077)
at rundeck.services.ExecutionService.retryExecuteJob(ExecutionService.groovy:1661)
at rundeck.services.ExecutionService.executeJob(ExecutionService.groovy:1620)
at rundeck.controllers.ScheduledExecutionController.apiJobRun(ScheduledExecutionController.groovy:3317)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:696)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1515)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:519)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:582)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1097)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:448)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1031)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:261)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:101)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:97)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
at com.dtolabs.rundeck.server.filters.AuthFilter.doFilter(AuthFilter.java:74)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:519)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:540)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1097)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:448)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1031)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:446)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:271)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:246)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)
at java.lang.Thread.run(Thread.java:745)

How to reproduce Behavior

  • create a job with a schedule enabled
  • curl -X POST -H "X-Rundeck-Auth-Token: XXXXXXXXXXXX" https://myrundeckhost/api/18/job/[ID]/run
  • you will have a html response and will see an error message like above in your service.log
  • disable the schedule on the job and rerun the call. Everything will run as you wish.

@gschueler gschueler added the bug label Mar 31, 2017

@nheinemans

This comment has been minimized.

Show comment
Hide comment
@nheinemans

nheinemans Apr 3, 2017

We are experiencing the same issue.

We are experiencing the same issue.

@gschueler gschueler modified the milestone: 2.8.0 Apr 3, 2017

@gschueler gschueler self-assigned this Apr 6, 2017

@gschueler gschueler closed this in 67aa484 Apr 7, 2017

gschueler added a commit that referenced this issue Apr 7, 2017

Merge pull request #2410 from rundeck/rundeck-2389
fix #2389 api job execution should pass executionType

@gschueler gschueler removed the in progress label Apr 7, 2017

@saharnah

This comment has been minimized.

Show comment
Hide comment
@saharnah

saharnah Feb 25, 2018

i have the same issue, is it solved?

trying to trigger this job: https://172.19.37.101:4443/api/1/job/993a7930-36bd-4df1-abe8-c796bc706462/run

and getting this error:

Stack Trace

org.quartz.ObjectAlreadyExistsException: Unable to store Job : 'staging_reports:URL_reports_staging_east :.54:URL_reports_staging_east ', because one already exists with this identification.
	at org.quartz.simpl.RAMJobStore.storeJob(RAMJobStore.java:279)
	at org.quartz.simpl.RAMJobStore.storeJobAndTrigger(RAMJobStore.java:251)
	at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:886)
	at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:249)
	at rundeck.services.ScheduledExecutionService.scheduleTempJob(ScheduledExecutionService.groovy:1077)
	at rundeck.services.ExecutionService.retryExecuteJob(ExecutionService.groovy:1661)
	at rundeck.services.ExecutionService.executeJob(ExecutionService.groovy:1620)
	at rundeck.controllers.ScheduledExecutionController.apiJobRun(ScheduledExecutionController.groovy:3317)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:696)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1515)
	at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
	at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:519)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:582)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1097)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:448)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1031)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
	at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:261)
	at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:101)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:97)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at com.dtolabs.rundeck.server.filters.AuthFilter.doFilter(AuthFilter.java:74)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:519)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:540)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1097)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:448)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1031)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:446)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:271)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:246)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)
	at java.lang.Thread.run(Thread.java:745)

i have the same issue, is it solved?

trying to trigger this job: https://172.19.37.101:4443/api/1/job/993a7930-36bd-4df1-abe8-c796bc706462/run

and getting this error:

Stack Trace

org.quartz.ObjectAlreadyExistsException: Unable to store Job : 'staging_reports:URL_reports_staging_east :.54:URL_reports_staging_east ', because one already exists with this identification.
	at org.quartz.simpl.RAMJobStore.storeJob(RAMJobStore.java:279)
	at org.quartz.simpl.RAMJobStore.storeJobAndTrigger(RAMJobStore.java:251)
	at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:886)
	at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:249)
	at rundeck.services.ScheduledExecutionService.scheduleTempJob(ScheduledExecutionService.groovy:1077)
	at rundeck.services.ExecutionService.retryExecuteJob(ExecutionService.groovy:1661)
	at rundeck.services.ExecutionService.executeJob(ExecutionService.groovy:1620)
	at rundeck.controllers.ScheduledExecutionController.apiJobRun(ScheduledExecutionController.groovy:3317)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:696)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1515)
	at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
	at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:519)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:582)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1097)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:448)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1031)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
	at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:261)
	at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:101)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:97)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at com.dtolabs.rundeck.server.filters.AuthFilter.doFilter(AuthFilter.java:74)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:519)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:540)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1097)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:448)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1031)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:446)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:271)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:246)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)
	at java.lang.Thread.run(Thread.java:745)
@gschueler

This comment has been minimized.

Show comment
Hide comment
@gschueler

gschueler Feb 26, 2018

Member

@saharnah what version are you using?

Member

gschueler commented Feb 26, 2018

@saharnah what version are you using?

@saharnah

This comment has been minimized.

Show comment
Hide comment
@saharnah

saharnah Feb 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment