{"record":{"id":"edf27f983f23c976","repo":"flowable/flowable-engine","slug":"no-job-found-with-id-jobid-edf27f","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/SetJobRetriesCmd.java","lineNumber":66,"sourceCode":"        this.jobId = jobId;\n        this.retries = retries;\n        this.jobServiceConfiguration = jobServiceConfiguration;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        JobEntity job = jobServiceConfiguration.getJobEntityManager().findById(jobId);\n        if (job != null) {\n\n            job.setRetries(retries);\n\n            FlowableEventDispatcher eventDispatcher = jobServiceConfiguration.getEventDispatcher();\n            if (eventDispatcher != null && eventDispatcher.isEnabled()) {\n                eventDispatcher.dispatchEvent(FlowableJobEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_UPDATED, job),\n                        jobServiceConfiguration.getEngineName());\n            }\n        } else {\n            throw new FlowableObjectNotFoundException(\"No job found with id '\" + jobId + \"'.\", Job.class);\n        }\n        return null;\n    }\n}\n","sourceCodeStart":48,"sourceCodeEnd":71,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/cmd/SetJobRetriesCmd.java#L48-L71","documentation":"In SetJobRetriesCmd.execute(), after the job id passes validation, the command searches the job tables for the entity; when no job with that id can be found it throws FlowableObjectNotFoundException ('No job found with id ...', Job.class). It means retries were requested for a job that does not exist (anymore).","triggerScenarios":"Calling ManagementService.setJobRetries(jobId, retries) with a well-formed id that matches no job in ACT_RU_JOB/ACT_RU_TIMER_JOB/ACT_RU_SUSPENDED_JOB/ACT_RU_DEADLETTER_JOB.","commonSituations":"Job already completed/failed and was removed by the async executor or history cleanup; id from a different engine/database; stale id cached in an external dashboard; race where the job is deleted between listing and updating.","solutions":["Catch FlowableObjectNotFoundException and treat it as an idempotent no-op in retry tooling.","Re-fetch the job via a job query before setting retries and handle absence explicitly.","Confirm the same process engine/database is being used; adjust history cleanup retention if jobs are purged while still being managed."],"exampleFix":"// before\nmanagementService.setJobRetries(jobId, 3);\n// after\ntry {\n    managementService.setJobRetries(jobId, 3);\n} catch (FlowableObjectNotFoundException e) {\n    log.warn(\"Job {} not found; skipping retry reset\", jobId);\n}","handlingStrategy":"try-catch","validationCode":"boolean exists = managementService.createJobQuery().jobId(jobId).count() > 0\n    || managementService.createTimerJobQuery().jobId(jobId).count() > 0\n    || managementService.createSuspendedJobQuery().jobId(jobId).count() > 0\n    || managementService.createDeadLetterJobQuery().jobId(jobId).count() > 0;","typeGuard":"boolean jobPresent = job != null && job.getId() != null;","tryCatchPattern":"try { managementService.setJobRetries(jobId, retries); } catch (FlowableObjectNotFoundException e) { log.warn(\"Job {} not found; treating as no-op\", jobId); }","preventionTips":["Handle not-found as an expected outcome for finished/deleted jobs","Re-check job existence right before updating to avoid races","Ensure history/cleanup retention is not shorter than your retry-management window"],"tags":["flowable","job-not-found","object-not-found","job-retries"],"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"}