apache/druid · error · IAE
A local input source requires one property of %s or %s
Error message
A local input source requires one property of %s or %s
What it means
LocalInputSourceDefn.validate requires a local input source to specify at least one of baseDir or files. Without either, Druid has nothing to read. Thrown as IllegalArgumentException during table validation.
Source
Thrown at server/src/main/java/org/apache/druid/catalog/model/table/LocalInputSourceDefn.java:88
return LocalInputSource.TYPE_KEY;
}
@Override
protected Class<? extends InputSource> inputSourceClass()
{
return LocalInputSource.class;
}
@Override
public void validate(ResolvedExternalTable table)
{
final Map<String, Object> sourceMap = new HashMap<>(table.inputSourceMap);
final boolean hasBaseDir = sourceMap.containsKey(BASE_DIR_FIELD);
final boolean hasFiles = !CollectionUtils.isNullOrEmpty(CatalogUtils.safeGet(sourceMap, FILES_FIELD, List.class));
final boolean hasFilter = !Strings.isNullOrEmpty(CatalogUtils.getString(sourceMap, FILTER_FIELD));
if (!hasBaseDir && !hasFiles) {
throw new IAE(
"A local input source requires one property of %s or %s",
BASE_DIR_FIELD,
FILES_FIELD
);
}
if (!hasBaseDir && hasFilter) {
throw new IAE(
"If a local input source sets property %s, it must also set property %s",
FILTER_FIELD,
BASE_DIR_FIELD
);
}
if (hasBaseDir && hasFiles) {
throw new IAE(
"A local input source accepts only one of %s or %s",
BASE_DIR_FIELD,
FILES_FIELD
);View on GitHub (pinned to 9b90983fd2)
Solutions
- Set the baseDir property to the directory containing the files
- Or provide a non-empty files list of explicit paths
- Re-run validation after adding one of the two properties
Example fix
// before
{"type":"local","filter":"*.csv"}
// after
{"type":"local","baseDir":"/data/incoming","filter":"*.csv"} Defensive patterns
Strategy: validation
Validate before calling
Map<String,Object> src = table.getInputSourceMap();
if (!src.containsKey("baseDir")
&& (src.get("files") == null || ((List<?>) src.get("files")).isEmpty())) {
throw new IllegalArgumentException("local source needs baseDir or files");
} Try / catch
try { defn.validate(table); } catch (IAE e) { if (e.getMessage().contains("requires one property")) { /* set baseDir or files */ } else { throw e; } } Prevention
- Always pair local source config with either baseDir or a files list
- Template checks: fail fast when both path variables are empty
- Validate source JSON before catalog save
When it happens
Trigger: Validating a local ResolvedExternalTable whose inputSourceMap contains neither the baseDir field nor a non-empty files list.
Common situations: Local source config created programmatically with neither property set; switching from another source type and deleting paths without adding new ones; partial edits to the source JSON.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- An inline input source must provide a format.
- An inline input source must provide one or more columns
- If a local input source sets property %s, it must also set p
- A local input source accepts only one of %s or %s
- '%s' must be a string or an array of strings
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/7006ec7a83a6baac.
Report an issue: GitHub.