apache/seatunnel · warning
Elasticsearch Source config warn: when both 'index' and…
Error message
Elasticsearch Source config warn: when both 'index' and 'index_list' are present in the configuration, only the 'index_list' configuration will take effect
What it means
When an Elasticsearch source config contains both 'index' and 'index_list', the connector logs this warning because only 'index_list' is honored and the 'index' value is silently ignored. This prevents ambiguous multi/single-source setup.
Solutions
- Remove the 'index' key when 'index_list' is present
- Or remove 'index_list' if you actually want a single index read
- Confirm in logs which index set will be used
Example fix
// before index = "orders_v1" index_list = ["orders_v1", "orders_v2"] // after (multi-index) index_list = ["orders_v1", "orders_v2"]
Defensive patterns
Strategy: validation
Validate before calling
// reject configs with both keys
if (config.hasPath("index") && config.hasPath("index_list")) {
throw new IllegalArgumentException("Set only one of 'index' or 'index_list'");
} Prevention
- Keep a single canonical index key per job config
- When scaling to multi-index, delete the old 'index' entry
- Add a config lint step in CI for ES job files
When it happens
Trigger: Setting index = "..." and index_list = [...] simultaneously in the Elasticsearch source configuration, e.g. after extending a single-index job to multiple indices.
Common situations: Copy-pasted configs where the old single-index key was not removed; templated configs that always emit both keys.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- Invalid runtime field configuration
- SQL search_type does not support slicing. slice_max will be…
- SQL search_type does not support slicing. slice_max will be…
- The schema config in ElasticSearch source/sink is…
- accessId and accesskey must be provided when sts_token is…
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/6b67dff9870eda26.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSource.java:79
@Slf4j
public class ElasticsearchSource
implements SeaTunnelSource<
SeaTunnelRow, ElasticsearchSourceSplit, ElasticsearchSourceState>,
SupportParallelism,
SupportColumnProjection {
private final List<ElasticsearchConfig> elasticsearchConfigList;
private final ReadonlyConfig connectionConfig;
public ElasticsearchSource(ReadonlyConfig config) {
this.connectionConfig = config;
boolean multiSource = config.getOptional(ElasticsearchSourceOptions.INDEX_LIST).isPresent();
boolean singleSource = config.getOptional(ElasticsearchSourceOptions.INDEX).isPresent();
if (multiSource && singleSource) {
log.warn(
"Elasticsearch Source config warn: when both 'index' and 'index_list' are present in the configuration, only the 'index_list' configuration will take effect");
}
if (multiSource) {
this.elasticsearchConfigList = createMultiSource(config);
} else {
this.elasticsearchConfigList =
Collections.singletonList(parseOneIndexQueryConfig(config));
}
}
private List<ElasticsearchConfig> createMultiSource(ReadonlyConfig config) {
List<Map<String, Object>> configMaps = config.get(ElasticsearchSourceOptions.INDEX_LIST);
List<ReadonlyConfig> configList =
configMaps.stream().map(ReadonlyConfig::fromMap).collect(Collectors.toList());
List<ElasticsearchConfig> elasticsearchConfigList = new ArrayList<>(configList.size());
for (ReadonlyConfig readonlyConfig : configList) {
// NOTE: per-entry configs inside `index_list` are NOT validated by the factory's
// OptionRule (which only validates the top-level config). If an entry is missing
// `index`, or sets `search_type=SQL` without `sql_query`, parseOneIndexQueryConfigView on GitHub (pinned to cf67b549a7)