{"record":{"id":"85e312e3ed2dd714","repo":"flowable/flowable-engine","slug":"no-job-found-with-id-jobid-85e312","errorCode":null,"errorMessage":"No job found with id '\" + jobId + \"'.","messagePattern":"No job found with id '\" \\+ jobId \\+ \"'\\.","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SetJobRetriesCmd.java","lineNumber":63,"sourceCode":"        this.jobId = jobId;\n        this.retries = retries;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        JobEntity job = commandContext\n                .getJobEntityManager()\n                .findJobById(jobId);\n        if (job != null) {\n            job.setRetries(retries);\n\n            if (commandContext.getEventDispatcher().isEnabled()) {\n                commandContext.getEventDispatcher().dispatchEvent(\n                        ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_UPDATED, job),\n                        EngineConfigurationConstants.KEY_PROCESS_ENGINE_CONFIG);\n            }\n        } else {\n            throw new ActivitiObjectNotFoundException(\"No job found with id '\" + jobId + \"'.\", Job.class);\n        }\n        return null;\n    }\n}\n","sourceCodeStart":45,"sourceCodeEnd":68,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SetJobRetriesCmd.java#L45-L68","documentation":"SetJobRetriesCmd.execute() loads the job by id and updates its retry count; if findJob returns null, it throws ActivitiObjectNotFoundException with the id and Job.class, since the target job does not exist.","triggerScenarios":"ManagementService.setJobRetries(jobId, n) with an id not present in the job tables — job already executed/removed, wrong database, or id from a different engine instance.","commonSituations":"Retrying maintenance on a job that completed between listing and update (race), environment mismatch, or the job was deleted by job cleanup/timeout handlers.","solutions":["Verify the job exists: ManagementService.createJobQuery().jobId(jobId).singleResult() before setting retries.","Confirm you are connected to the same database/engine where the job lives.","Handle the not-found case gracefully (log and skip) if jobs are short-lived."],"exampleFix":"// before\nmanagementService.setJobRetries(jobId, 5);\n// after\nJob job = managementService.createJobQuery().jobId(jobId).singleResult();\nif (job != null) {\n    managementService.setJobRetries(jobId, 5);\n}","handlingStrategy":"validation","validationCode":"Job job = managementService.createJobQuery().jobId(jobId).singleResult();\nif (job == null) throw new IllegalArgumentException(\"No job \" + jobId);","typeGuard":null,"tryCatchPattern":"try { managementService.setJobRetries(jobId, retries); }\ncatch (ActivitiObjectNotFoundException e) { log.warn(\"job {} no longer exists\", jobId); }","preventionTips":["Check job existence before retry mutations","Handle short-lived jobs (they can vanish between query and update)","Confirm engine/database affinity in multi-node setups"],"tags":["job","not-found","management-service"],"backgroundTag":"entity-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}