
Can't delete job after update through API
Reported by chris gallimore | December 19th, 2011 @ 08:14 AM
After updating a group of jobs, then trying to delete any job in the same group this error occurs.
Request: /job/delete/d43f7cd9-985a-4dfc-8641-4fcbb130b868 
Message: Cannot delete or update a parent row: a foreign key 
constraint fails (`rundeck`.`rdoption`, CONSTRAINT 
`FKAFFFA927243CF2FF` FOREIGN KEY (`scheduled_execution_id`) REFERENCES 
`scheduled_execution` (`id`)) 
Caused by: Executing action [delete] of controller 
[ScheduledExecutionController] caused exception: 
org.springframework.dao.DataIntegrityViolationException: could not 
delete: [ScheduledExecution#31]; SQL [delete from scheduled_execution 
where id=? and version=?]; constraint [null]; nested exception is 
org.hibernate.exception.ConstraintViolationException: could not 
delete: [ScheduledExecution#31] 
Class: ScheduledExecutionController 
At Line: [582] 
Code Snippet: 
Stack Trace 
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionEx ception: 
Executing action [delete] of controller 
[ScheduledExecutionController]  caused exception: 
org.springframework.dao.DataIntegrityViolationException: could not 
delete: [ScheduledExecution#31]; SQL [delete from scheduled_execution 
where id=? and version=?]; constraint [null]; nested exception is 
org.hibernate.exception.ConstraintViolationException: could not 
delete: [ScheduledExecution#31] 
        at 
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.exe cuteAction(SimpleGrailsControllerHelper.java: 
250) 
        at 
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.han dleURI(SimpleGrailsControllerHelper.java: 
202) 
        at 
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.han dleURI(SimpleGrailsControllerHelper.java: 
137) 
        at 
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleReq uest(SimpleGrailsController.java: 
88) 
        at 
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(S impleControllerHandlerAdapter.java: 
48) 
        at 
org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(G railsDispatcherServlet.java: 
255) 
        at 
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServl et.java: 
716) 
        at 
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkSe rvlet.java: 
647) 
        at 
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.ja va: 
563) 
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) 
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) 
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: 
511) 
        at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1166) 
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest Filter.java: 
70) 
        at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1157) 
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest Filter.java: 
70) 
        at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1157) 
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest Filter.java: 
70) 
        at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1157) 
        at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 
388) 
        at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 
216) 
        at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 
182) 
        at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 
765) 
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 
418) 
        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327) 
        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) 
        at 
org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInf o(WebUtils.java: 
301) 
        at 
org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInf o(WebUtils.java: 
277) 
        at 
org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInf o(WebUtils.java: 
269) 
        at 
org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInt ernal(UrlMappingsFilter.java: 
187) 
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest Filter.java: 
76) 
        at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1157) 
        at 
org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(Grai lsPageFilter.java: 
249) 
        at 
org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPag eFilter.java: 
140) 
        at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1157) 
        at 
org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterI nternal(GrailsWebRequestFilter.java: 
65) 
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest Filter.java: 
76) 
        at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1157) 
        at 
org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInter nal(HiddenHttpMethodFilter.java: 
63) 
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest Filter.java: 
76) 
        at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1157) 
        at 
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(Cha racterEncodingFilter.java: 
88) 
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest Filter.java: 
76) 
        at 
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(Delegat ingFilterProxy.java: 
237) 
        at 
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFil terProxy.java: 
167) 
        at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1157) 
        at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 
388) 
        at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 
216) 
        at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 
182) 
        at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 
765) 
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 
418) 
        at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 
152) 
        at org.mortbay.jetty.Server.handle(Server.java:326) 
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 
536) 
        at org.mortbay.jetty.HttpConnection 
$RequestHandler.headerComplete(HttpConnection.java:915) 
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) 
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) 
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405) 
        at org.mortbay.jetty.bio.SocketConnector 
$Connection.run(SocketConnector.java:228) 
        at org.mortbay.thread.QueuedThreadPool 
$PoolThread.run(QueuedThreadPool.java:582) 
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: 
org.springframework.dao.DataIntegrityViolationException: could not 
delete: [ScheduledExecution#31]; SQL [delete from scheduled_execution 
where id=? and version=?]; constraint [null]; nested exception is 
org.hibernate.exception.ConstraintViolationException: could not 
delete: [ScheduledExecution#31] 
        at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java: 
92) 
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234) 
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1049) 
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java: 
923) 
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:880) 
        at groovy.lang.Closure.call(Closure.java:279) 
        at groovy.lang.Closure.call(Closure.java:274) 
        at 
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.han dleAction(SimpleGrailsControllerHelper.java: 
377) 
        at 
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.exe cuteAction(SimpleGrailsControllerHelper.java: 
244) 
        ... 59 more 
Caused by: org.springframework.dao.DataIntegrityViolationException: 
could not delete: [ScheduledExecution#31]; SQL [delete from 
scheduled_execution where id=? and version=?]; constraint [null]; 
nested exception is 
org.hibernate.exception.ConstraintViolationException: could not 
delete: [ScheduledExecution#31] 
        at ScheduledExecutionService 
$_deleteScheduledExecution_closure13.doCall(ScheduledExecutionService.groov y: 
364) 
        at $Proxy11.doInTransaction(Unknown Source) 
        at 
ScheduledExecutionService.deleteScheduledExecution(ScheduledExecutionServic e.groovy: 
344) 
        at ScheduledExecutionService$deleteScheduledExecution.call(Unknown 
Source) 
        at ScheduledExecutionController 
$_closure12.doCall(ScheduledExecutionController.groovy:582) 
        at ScheduledExecutionController 
$_closure12.doCall(ScheduledExecutionController.groovy) 
Caused by: org.hibernate.exception.ConstraintViolationException: could 
not delete: [ScheduledExecution#31] 
        ... 6 more
Comments and changes to this ticket
- 
         Greg Schueler May 7th, 2012 @ 05:20 PM- State changed from new to hold
- Assigned user set to Greg Schueler
 I was unable to reproduce this using v1.4.2. tested with local file db, and mysql. If you still have this problem, please post your rundeck version, server OS, and if using mysql or other rdb. 
- 
            
         chris gallimore May 7th, 2012 @ 06:12 PMI did some testing using 'modify' and it seemed to work. This was using Rundeck v1.4.2 and MySQL. 
- 
         
- 
            
         beckham836 June 17th, 2024 @ 02:11 AMOpenguessr is a fantastic tool for learning about new places around the globe. 
- 
            
         Pebi Technology December 30th, 2024 @ 02:12 AMAll the contents you mentioned in post is too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts. 
 Cricut Designs Cricut Design Insight Full Updates Blend Pedia
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
(DEPRECATED) Please use github issues for issue tracking at http://github.com/dtolabs/rundeck/issues
 Create new ticket
                    Create new ticket
 brian.stephens
      brian.stephens
 Greg Schueler
      Greg Schueler