{"record":{"id":"130a3fa45aa79b94","repo":"apache/dolphinscheduler","slug":"backfillparams-is-null","errorCode":null,"errorMessage":"backfillParams is null","messagePattern":"backfillParams is null","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/workflow/BackfillWorkflowDTOValidator.java","lineNumber":50,"sourceCode":"@Slf4j\n@Component\npublic class BackfillWorkflowDTOValidator implements IValidator<BackfillWorkflowDTO> {\n\n    private final TenantExistValidator tenantExistValidator;\n\n    private final StartParamListValidator startParamListValidator;\n\n    public BackfillWorkflowDTOValidator(TenantExistValidator tenantExistValidator,\n                                        StartParamListValidator startParamListValidator) {\n        this.tenantExistValidator = tenantExistValidator;\n        this.startParamListValidator = startParamListValidator;\n    }\n\n    @Override\n    public void validate(final BackfillWorkflowDTO backfillWorkflowDTO) {\n        final BackfillWorkflowDTO.BackfillParamsDTO backfillParams = backfillWorkflowDTO.getBackfillParams();\n        if (backfillParams == null) {\n            throw new IllegalArgumentException(\"backfillParams is null\");\n        }\n        if (CollectionUtils.isEmpty(backfillParams.getBackfillDateList())) {\n            throw new IllegalArgumentException(\"backfillDateList is empty\");\n        }\n        if (backfillParams.getExpectedParallelismNumber() < 0) {\n            throw new IllegalArgumentException(\"expectedParallelismNumber should >= 0\");\n        }\n        if (backfillWorkflowDTO.getExecType() != CommandType.COMPLEMENT_DATA) {\n            throw new IllegalArgumentException(\"The execType should be START_PROCESS\");\n        }\n        if (backfillWorkflowDTO.getWorkflowDefinition() == null) {\n            throw new IllegalArgumentException(\"The workflowDefinition should not be null\");\n        }\n        if (backfillWorkflowDTO.getWorkflowDefinition().getReleaseState() != ReleaseState.ONLINE) {\n            throw new IllegalStateException(\"The workflowDefinition should be online\");\n        }\n\n        tenantExistValidator.validate(backfillWorkflowDTO.getTenantCode());","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/workflow/BackfillWorkflowDTOValidator.java#L32-L68","documentation":"BackfillWorkflowDTOValidator.validate performs mandatory-field checks on a workflow backfill request. The backfillParams field of BackfillWorkflowDTO must be present; if it is null, the validator throws IllegalArgumentException('backfillParams is null') before any further validation. Backfilling (complementing historical dates) is impossible without the parameters that carry dates, parallelism and start params.","triggerScenarios":"Submitting a backfill workflow API request whose JSON body omits the backfillParams object entirely, or programmatically constructing a BackfillWorkflowDTO without calling setBackfillParams before passing it to validate().","commonSituations":"Client SDK sending an empty/partial body; a JSON field-name typo (backfill_params vs backfillParams) silently deserializing to null; upgrading API clients after the backfill schema changed; hand-built DTOs in tests or scripts.","solutions":["Include a non-null backfillParams object (with backfillDateList, expectedParallelismNumber, startParamList) in the backfill request body.","Fix JSON field names to match BackfillWorkflowDTO.BackfillParamsDTO property names so deserialization populates the field.","Check the client/SDK version matches the server API schema; upgrade the client if backfillParams was recently added.","Validate/construct the DTO via its builder so backfillParams is always set."],"exampleFix":"// before\nBackfillWorkflowDTO dto = new BackfillWorkflowDTO();\ndto.setExecType(CommandType.COMPLEMENT_DATA); // backfillParams never set\n// after\nBackfillWorkflowDTO dto = new BackfillWorkflowDTO();\ndto.setBackfillParams(BackfillWorkflowDTO.BackfillParamsDTO.builder()\n    .backfillDateList(dates).expectedParallelismNumber(1).build());","handlingStrategy":"validation","validationCode":"if (!dto.backfillParams) {\n  throw new Error('backfillParams must be provided');\n}","typeGuard":"function hasBackfillParams(dto) {\n  return dto != null && dto.backfillParams != null && typeof dto.backfillParams === 'object';\n}","tryCatchPattern":"try {\n  backfill(dto);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"backfillParams is null\")) {\n    // rebuild DTO with backfillParams before retrying\n  }\n}","preventionTips":["Use the DTO builder/constructor so backfillParams is mandatory.","Match JSON field names exactly to the DTO properties.","Add request-body schema validation on the client (JSON schema / TypeScript types).","Keep client SDK version in sync with server API schema."],"tags":["backfill","null-check","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}