{"record":{"id":"75949920e1c39fd9","repo":"flowable/flowable-engine","slug":"jobid-is-null","errorCode":null,"errorMessage":"jobId is null","messagePattern":"jobId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/cmd/DeleteDeadLetterJobCmd.java","lineNumber":68,"sourceCode":"        DeadLetterJobEntity jobToDelete = getJobToDelete(commandContext);\n\n        sendCancelEvent(jobToDelete);\n\n        jobServiceConfiguration.getDeadLetterJobEntityManager().delete(jobToDelete);\n        return null;\n    }\n\n    protected void sendCancelEvent(DeadLetterJobEntity jobToDelete) {\n        FlowableEventDispatcher eventDispatcher = jobServiceConfiguration.getEventDispatcher();\n        if (eventDispatcher != null && eventDispatcher.isEnabled()) {\n            eventDispatcher.dispatchEvent(FlowableJobEventBuilder.createEntityEvent(FlowableEngineEventType.JOB_CANCELED, jobToDelete),\n                    jobServiceConfiguration.getEngineName());\n        }\n    }\n\n    protected DeadLetterJobEntity getJobToDelete(CommandContext commandContext) {\n        if (deadLetterJobId == null) {\n            throw new FlowableIllegalArgumentException(\"jobId is null\");\n        }\n        if (LOGGER.isDebugEnabled()) {\n            LOGGER.debug(\"Deleting job {}\", deadLetterJobId);\n        }\n\n        DeadLetterJobEntity job = jobServiceConfiguration.getDeadLetterJobEntityManager().findById(deadLetterJobId);\n        if (job == null) {\n            throw new FlowableObjectNotFoundException(\"No dead letter job found with id '\" + deadLetterJobId + \"'\", Job.class);\n        }\n\n        return job;\n    }\n\n}\n","sourceCodeStart":50,"sourceCodeEnd":83,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/cmd/DeleteDeadLetterJobCmd.java#L50-L83","documentation":"Thrown by DeleteDeadLetterJobCmd.getJobToDelete() (via jobToDelete) when deadLetterJobId is null. Deleting a dead letter job requires a concrete id to look up the entity; a null id is rejected up front as FlowableIllegalArgumentException instead of attempting a pointless findById(null).","triggerScenarios":"managementService.deleteDeadLetterJob(null) or the builder-based delete called without setting the job id; id variable that was never assigned because a prior query/lookup returned nothing; REST/DTO binding leaving the id field null.","commonSituations":"Cleanup scripts iterating a list where some entries are null; frontend sending a delete request with a missing id; copy-pasted delete code using the wrong (unset) variable.","solutions":["Ensure the dead letter job id is set/non-null before calling the delete API","Filter null entries out of id lists before issuing per-id deletes","At the API boundary, validate the id and return a client error instead of invoking the service"],"exampleFix":"// before\nmanagementService.deleteDeadLetterJob(deadLetterJobId); // null\n// after\nif (deadLetterJobId != null) {\n    managementService.deleteDeadLetterJob(deadLetterJobId);\n}","handlingStrategy":"validation","validationCode":"if (deadLetterJobId == null) {\n    throw new IllegalArgumentException(\"deadLetterJobId is required to delete a dead letter job\");\n}","typeGuard":"boolean hasJobId(String id) { return id != null && !id.trim().isEmpty(); }","tryCatchPattern":"try {\n    managementService.deleteDeadLetterJob(deadLetterJobId);\n} catch (FlowableIllegalArgumentException e) {\n    LOGGER.error(\"Delete rejected: {}\", e.getMessage());\n}","preventionTips":["Validate ids at the API/DTO boundary before invoking the service","Filter null entries out of id lists before per-id deletes","Ensure the id is read from the job entity you inspected, not an unset variable"],"tags":["validation","flowable","dead-letter-job"],"backgroundTag":"null-argument","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"}