apache/druid · error · IAE
External HTTP tables must provide only one of a URI or a %s
Error message
External HTTP tables must provide only one of a URI or a %s property
What it means
Thrown by HttpInputSourceDefn.validate when an external HTTP table supplies BOTH a direct URI and a uriTemplate property. The two are mutually exclusive addressing modes: either fixed URIs or a template with per-URI substitution, not both.
Source
Thrown at server/src/main/java/org/apache/druid/catalog/model/table/HttpInputSourceDefn.java:149
@Override
public void validate(ResolvedExternalTable table)
{
final Map<String, Object> sourceMap = table.inputSourceMap;
final boolean hasUri = sourceMap.containsKey(URIS_FIELD);
final String uriTemplate = table.resolvedTable().stringProperty(URI_TEMPLATE_PROPERTY);
final boolean hasTemplate = uriTemplate != null;
final boolean hasFormat = table.inputFormatMap != null;
final boolean hasColumns = !CollectionUtils.isNullOrEmpty(table.resolvedTable().spec().columns());
if (!hasUri && !hasTemplate) {
throw new IAE(
"External HTTP tables must provide either a URI or a %s property",
URI_TEMPLATE_PROPERTY
);
}
if (hasUri && hasTemplate) {
throw new IAE(
"External HTTP tables must provide only one of a URI or a %s property",
URI_TEMPLATE_PROPERTY
);
}
if (hasUri && !hasFormat) {
throw new IAE(
"An external HTTP table with a URI must also provide the corresponding format"
);
}
if (hasUri && !hasColumns) {
throw new IAE(
"An external HTTP table with a URI must also provide the corresponding columns"
);
}
if (hasTemplate) {
// Verify the template
templateMatcher(uriTemplate);View on GitHub (pinned to 9b90983fd2)
Solutions
- Remove the uriTemplate property if fixed URIs are intended
- Remove the uris field from the input source if template-based addressing is intended
- Ensure whichever generation tool writes the table writes only one of the two fields
Example fix
// before
{"type": "http", "uris": ["https://a.com/f.json"]} + tableProperty uriTemplate="https://a.com/{}.json"
// after
{"type": "http", "uris": ["https://a.com/f.json"]} // template removed Defensive patterns
Strategy: validation
Validate before calling
if (uris != null && uriTemplate != null) { throw new IAE("provide only one of uris/uriTemplate"); } Prevention
- When migrating to templates, delete the uris field
- Ensure generators emit exactly one addressing mode
- Add a lint rule for table definitions
When it happens
Trigger: A table definition where the input source has 'uris' and the table also carries a uriTemplate property; validate detects hasUri && hasTemplate simultaneously.
Common situations: Migrating a table from a fixed-URI definition to a template and forgetting to remove the old uris field; merging table definitions where both styles were combined; a UI or script that writes both fields unconditionally.
Related errors
- External HTTP tables must provide either a URI or a %s prope
- An external HTTP table with a URI must also provide the corr
- An external HTTP table with a URI must also provide the corr
- Value [%s] for property %s must include a '{}' placeholder
- One or more URIs is required in parameter %s
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/cfd64a17fd41ea11.
Report an issue: GitHub.