{"record":{"id":"f441cceef4312523","repo":"apache/druid","slug":"at-least-one-of-basedir-or-files-should-be-specifi","errorCode":null,"errorMessage":"At least one of baseDir or files should be specified","messagePattern":"At least one of baseDir or files should be specified","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/data/input/impl/LocalInputSource.java","lineNumber":95,"sourceCode":"  private final String filter;\n  private final List<File> files;\n  private final SystemFields systemFields;\n\n  @JsonCreator\n  public LocalInputSource(\n      @JsonProperty(\"baseDir\") @Nullable File baseDir,\n      @JsonProperty(\"filter\") @Nullable String filter,\n      @JsonProperty(\"files\") @Nullable List<File> files,\n      @JsonProperty(SYSTEM_FIELDS_PROPERTY) @Nullable SystemFields systemFields\n  )\n  {\n    this.baseDir = baseDir;\n    this.filter = baseDir != null ? Preconditions.checkNotNull(filter, \"filter\") : filter;\n    this.files = files == null ? Collections.emptyList() : files;\n    this.systemFields = systemFields == null ? SystemFields.none() : systemFields;\n\n    if (baseDir == null && CollectionUtils.isNullOrEmpty(files)) {\n      throw new IAE(\"At least one of baseDir or files should be specified\");\n    }\n  }\n\n  @JsonIgnore\n  @Nonnull\n  @Override\n  public Set<String> getTypes()\n  {\n    return Collections.singleton(TYPE_KEY);\n  }\n\n  public LocalInputSource(File baseDir, String filter)\n  {\n    this(baseDir, filter, null, SystemFields.none());\n  }\n\n  @Nullable\n  public File getBaseDir()","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/data/input/impl/LocalInputSource.java#L77-L113","documentation":"LocalInputSource requires at least one source of input: a baseDir directory (combined with a filter) or an explicit list of files. Constructing or deserializing it with neither baseDir nor a non-empty files collection throws this IllegalArgumentException immediately in the constructor.","triggerScenarios":"Creating new LocalInputSource(null, null, ...) in code, or submitting an ingestion spec where the local inputSource object omits both baseDir and files (or provides an empty files array).","commonSituations":"Hand-edited ingestion specs where baseDir was removed, programmatic spec builders that pass null placeholders, template specs with unfilled fields.","solutions":["Add baseDir to the local inputSource spec","Or add the files array with explicit file paths","If using code, ensure either baseDir or a non-empty files list is passed to the constructor"],"exampleFix":"// before\n\"inputSource\": {\"type\": \"local\"}\n// after\n\"inputSource\": {\"type\": \"local\", \"baseDir\": \"/data\", \"filter\": \"*.json\"}","handlingStrategy":"validation","validationCode":"if (spec.getBaseDir() == null && (spec.getFiles() == null || spec.getFiles().isEmpty())) { throw new IllegalArgumentException(\"Provide baseDir or files\"); }","typeGuard":"boolean isValidLocalInputSource(LocalInputSource s) { return s.getBaseDir() != null || !s.getFiles().isEmpty(); }","tryCatchPattern":null,"preventionTips":["Always set baseDir plus filter, or an explicit files list","Validate ingestion specs before submission","Avoid hand-editing specs without re-running schema validation"],"tags":["config","input-source","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}