{"action":"created","issue":{"url":"https://api.github.com/repos/rundeck/rundeck/issues/1349","labels_url":"https://api.github.com/repos/rundeck/rundeck/issues/1349/labels{/name}","comments_url":"https://api.github.com/repos/rundeck/rundeck/issues/1349/comments","events_url":"https://api.github.com/repos/rundeck/rundeck/issues/1349/events","html_url":"https://github.com/rundeck/rundeck/issues/1349","id":96089587,"number":1349,"title":"java.lang.NullPointerException in RundeckAPICentralDispatcher.deleteStoredJobs","user":{"login":"dpetzel","id":943268,"avatar_url":"https://avatars.githubusercontent.com/u/943268?v=3","gravatar_id":"","url":"https://api.github.com/users/dpetzel","html_url":"https://github.com/dpetzel","followers_url":"https://api.github.com/users/dpetzel/followers","following_url":"https://api.github.com/users/dpetzel/following{/other_user}","gists_url":"https://api.github.com/users/dpetzel/gists{/gist_id}","starred_url":"https://api.github.com/users/dpetzel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpetzel/subscriptions","organizations_url":"https://api.github.com/users/dpetzel/orgs","repos_url":"https://api.github.com/users/dpetzel/repos","events_url":"https://api.github.com/users/dpetzel/events{/privacy}","received_events_url":"https://api.github.com/users/dpetzel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-20T15:30:56Z","updated_at":"2015-07-20T16:43:49Z","closed_at":null,"body":"When attempting to purge jobs we are seeing the following exception and the jobs are not purged\r\n\r\n```\r\n$ rd-jobs purge -p \"MyProject\" -g \"MyGroup\"\r\nWARN  SimpleHttpConnectionManager: SimpleHttpConnectionManager being used incorrectly.  Be sure that HttpMethod.releaseConnection() is always called and that only one thread and/or method is using this connection manager at a time.\r\njava.lang.NullPointerException\r\n\tat com.dtolabs.client.services.RundeckAPICentralDispatcher.deleteStoredJobs(RundeckAPICentralDispatcher.java:1182)\r\n\tat com.dtolabs.rundeck.core.cli.jobs.JobsTool.purgeAction(JobsTool.java:817)\r\n\tat com.dtolabs.rundeck.core.cli.jobs.JobsTool.go(JobsTool.java:647)\r\n\tat com.dtolabs.rundeck.core.cli.BaseTool.run(BaseTool.java:108)\r\n\tat com.dtolabs.rundeck.core.cli.jobs.JobsTool.main(JobsTool.java:383)\r\nError: null\r\n```\r\nI've tried running as root as well as the rundeck user and get the same result.\r\n\r\nWhat is interesting is that the server on which I get this error is part of a clustered configuration. I have tried it on both nodes without success.\r\n\r\nWhen running the same command on a standalone instance the command runs cleans. \r\n\r\nWe are running 2.4.0. I poked around https://github.com/rundeck/rundeck/blob/v2.4.0/core/src/main/java/com/dtolabs/client/services/RundeckAPICentralDispatcher.java#L1182 but nothing really jumped out at me. Unfortunately, I'm not in a position where I can test the latest version in a clustered fashion.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rundeck/rundeck/issues/comments/122944811","html_url":"https://github.com/rundeck/rundeck/issues/1349#issuecomment-122944811","issue_url":"https://api.github.com/repos/rundeck/rundeck/issues/1349","id":122944811,"user":{"login":"dpetzel","id":943268,"avatar_url":"https://avatars.githubusercontent.com/u/943268?v=3","gravatar_id":"","url":"https://api.github.com/users/dpetzel","html_url":"https://github.com/dpetzel","followers_url":"https://api.github.com/users/dpetzel/followers","following_url":"https://api.github.com/users/dpetzel/following{/other_user}","gists_url":"https://api.github.com/users/dpetzel/gists{/gist_id}","starred_url":"https://api.github.com/users/dpetzel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpetzel/subscriptions","organizations_url":"https://api.github.com/users/dpetzel/orgs","repos_url":"https://api.github.com/users/dpetzel/repos","events_url":"https://api.github.com/users/dpetzel/events{/privacy}","received_events_url":"https://api.github.com/users/dpetzel/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T16:43:49Z","updated_at":"2015-07-20T16:43:49Z","body":"Correct. I also found the following in the rundeck.log which might help\r\n\r\n```\r\n2015-07-20 08:19:50,168 [qtp254432682-35] ERROR org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver - MySQLIntegrityConstraintViolationException occurred when processing request: [POST] /api/5/jobs/delete\r\nCannot delete or update a parent row: a foreign key constraint fails (`mydb`.`rdoption`, CONSTRAINT `FKAFFFA9275C4E2579` FOREIGN KEY (`scheduled_execution_id`) REFERENCES `scheduled_execution` (`id`)). Stacktrace follows:\r\ncom.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`mydb`.`rdoption`, CONSTRAINT `FKAFFFA9275C4E2579` FOREIGN KEY (`scheduled_execution_id`) REFERENCES `scheduled_execution` (`id`))\r\n```"}}