{"record":{"id":"d5a59a0e129900a9","repo":"apache/dolphinscheduler","slug":"backfilldatelist-is-empty","errorCode":null,"errorMessage":"backfillDateList is empty","messagePattern":"backfillDateList is empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/workflow/BackfillWorkflowDTOValidator.java","lineNumber":53,"sourceCode":"\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());\n\n        startParamListValidator.validate(backfillWorkflowDTO.getStartParamList());\n    }","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/workflow/BackfillWorkflowDTOValidator.java#L35-L71","documentation":"BackfillWorkflowDTOValidator.validate requires backfillParams.backfillDateList to be non-empty, since a backfill must reference at least one date to complement. When CollectionUtils.isEmpty(backfillParams.getBackfillDateList()) is true, it throws IllegalArgumentException('backfillDateList is empty').","triggerScenarios":"A backfill request where backfillParams is provided but its backfillDateList is null or an empty list, e.g. complementScheduleDateList was an empty string or the date-parsing step produced no entries before building the DTO.","commonSituations":"UI sending an empty date range after invalid date input; comma-separated date list trimmed to empty string; timezone/locale parsing dropping all values; copy-pasted request template with dates left blank.","solutions":["Populate backfillDateList with at least one valid date (format yyyy-MM-dd HH:mm:ss) before submitting.","Fix the client so an empty complementScheduleDateList short-circuits the request with a friendlier error instead of sending it.","Check for whitespace-only or malformed comma-separated date strings that parse to nothing.","If triggering programmatically, ensure List.isNotEmpty(backfillDateList) in a pre-check."],"exampleFix":"// before\nparams.setBackfillDateList(Collections.emptyList());\n// after\nparams.setBackfillDateList(Arrays.asList(\"2026-01-01 00:00:00\", \"2026-01-02 00:00:00\"));","handlingStrategy":"validation","validationCode":"if (!params.backfillDateList || params.backfillDateList.length === 0) {\n  throw new Error('backfillDateList must contain at least one date');\n}","typeGuard":"function hasDates(params) {\n  return Array.isArray(params?.backfillDateList) && params.backfillDateList.length > 0;\n}","tryCatchPattern":"try {\n  backfill(dto);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"backfillDateList is empty\")) {\n    // prompt user to pick a date range\n  }\n}","preventionTips":["Require at least one date in the UI before allowing submission.","Trim and verify comma-separated date strings before sending.","Check date parsing didn't silently drop invalid entries.","Unit-test request builders with empty and single-date lists."],"tags":["backfill","empty-list","validation"],"backgroundTag":"empty-required-field","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"}