{"record":{"id":"e4d36f141e174017","repo":"flowable/flowable-engine","slug":"no-job-found-with-id-jobid","errorCode":null,"errorMessage":"No job found with id ${jobId}","messagePattern":"No job found with id (.+?)","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/cmd/GetJobExceptionStacktraceCmd.java","lineNumber":73,"sourceCode":"            break;\n        case TIMER:\n            job = jobServiceConfiguration.getTimerJobEntityManager().findById(jobId);\n            break;\n        case SUSPENDED:\n            job = jobServiceConfiguration.getSuspendedJobEntityManager().findById(jobId);\n            break;\n        case DEADLETTER:\n            job = jobServiceConfiguration.getDeadLetterJobEntityManager().findById(jobId);\n            break;\n        case EXTERNAL_WORKER:\n            job = jobServiceConfiguration.getExternalWorkerJobEntityManager().findById(jobId);\n            break;\n         default:\n             break;\n        }\n\n        if (job == null) {\n            throw new FlowableObjectNotFoundException(\"No job found with id \" + jobId, Job.class);\n        }\n\n        return job.getExceptionStacktrace();\n    }\n\n}\n","sourceCodeStart":55,"sourceCodeEnd":80,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/cmd/GetJobExceptionStacktraceCmd.java#L55-L80","documentation":"After checking the ASYNC/TIMER/SUSPENDED job entity managers, GetJobExceptionStacktraceCmd throws FlowableObjectNotFoundException when no job entity with the given id exists in any job table. It signals the caller asked for the exception stacktrace of a job that does not exist (or no longer exists).","triggerScenarios":"Calling ManagementService.getJobExceptionStacktrace(jobId) (or executing GetJobExceptionStacktraceCmd) with an id that does not match any row in ACT_RU_JOB, ACT_RU_TIMER_JOB, ACT_RU_SUSPENDED_JOB, ACT_RU_DEADLETTER_JOB, or the history job table.","commonSituations":"The job already executed and was deleted; a history-level/cleanup job removed it; the id came from a different engine or datasource; typo/stale id stored in an external system; job moved between tables after a state change and the caller used an outdated reference.","solutions":["Verify the job id is current by querying for the job (job query or dead-letter/timer job queries) before fetching the stacktrace.","Handle FlowableObjectNotFoundException in the caller and treat it as 'job gone' rather than a hard failure.","Check you are connected to the same database/engine the job was created in; move async executor history/cleanup settings if jobs are being purged too early."],"exampleFix":"// before\nString st = managementService.getJobExceptionStacktrace(jobId);\n// after\ntry {\n    String st = managementService.getJobExceptionStacktrace(jobId);\n} catch (FlowableObjectNotFoundException e) {\n    log.warn(\"Job {} no longer exists; stacktrace unavailable\", jobId);\n}","handlingStrategy":"try-catch","validationCode":"Job job = managementService.createJobQuery(). jobId==null?null: managementService.createJobQuery()...; // verify existence via job/timerJob/deadLetterJob/suspendedJob queries first","typeGuard":"boolean jobExists = managementService.createJobQuery().jobId(jobId).count() > 0;","tryCatchPattern":"try { return managementService.getJobExceptionStacktrace(jobId); } catch (FlowableObjectNotFoundException e) { return null; }","preventionTips":["Query for the job before reading its stacktrace","Expect jobs to disappear after execution or cleanup; treat not-found as normal","Confirm engine/datasource consistency across services"],"tags":["flowable","job-not-found","object-not-found","job-service"],"backgroundTag":"resource-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"}