elastic/elasticsearch · error · IllegalArgumentException
no data stream actions specified, at least one must be speci
Error message
no data stream actions specified, at least one must be specified
What it means
IllegalArgumentException from the REST handler for _modify_data_streams when the parsed request carries a null or empty 'actions' list. The endpoint requires at least one action (add backing index, delete backing index, etc.) to do anything meaningful.
Source
Thrown at modules/data-streams/src/main/java/org/elasticsearch/datastreams/rest/RestModifyDataStreamsAction.java:64
public List<Route> routes() {
return List.of(new Route(POST, "/_data_stream/_modify"));
}
@Override
protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
ModifyDataStreamsAction.Request modifyDsRequest;
try (XContentParser parser = request.contentParser()) {
modifyDsRequest = ModifyDataStreamsAction.Request.PARSER.parse(
parser,
actions -> new ModifyDataStreamsAction.Request(
RestUtils.getMasterNodeTimeout(request),
RestUtils.getAckTimeout(request),
actions
)
);
}
if (modifyDsRequest.getActions() == null || modifyDsRequest.getActions().isEmpty()) {
throw new IllegalArgumentException("no data stream actions specified, at least one must be specified");
}
boolean hasDeleteIndexAction = modifyDsRequest.getActions()
.stream()
.anyMatch(action -> action.getType() == DataStreamAction.Type.DELETE_BACKING_INDEX);
if (hasDeleteIndexAction) {
if (clusterSupportsFeature.test(DataStreamFeatures.DATA_STREAMS_MODIFY_DELETE_INDEX) == false) {
throw new IllegalArgumentException("delete_backing_index is an unsupported action type for this mixed version cluster");
}
}
return channel -> client.execute(ModifyDataStreamsAction.INSTANCE, modifyDsRequest, new RestToXContentListener<>(channel));
}
@Override
public Set<String> supportedCapabilities() {
return Set.of("data_streams.modify.delete_index");
}
}
View on GitHub (pinned to db6a809a66)
Solutions
- Supply at least one valid action object in the actions array (e.g. {"delete_backing_index":{"data_stream":"...","index":"..."}})
- Validate the actions list is non-empty in the client before sending
Example fix
// before
POST _data_stream/_modify {"actions":[]}
// after
POST _data_stream/_modify
{"actions":[{"delete_backing_index":{"data_stream":"my-logs","index":".ds-my-logs-2024-12-31-000001"}}]} Defensive patterns
Strategy: validation
Validate before calling
// Client-side guard before sending the request:
if (actions == null || actions.isEmpty()) {
throw new IllegalArgumentException("no data stream actions specified, at least one must be specified");
} Prevention
- Validate the actions list is non-empty in client code before serializing
- Add a schema check in test fixtures that build modify requests
- Log when a constructed request has zero actions to catch automation bugs early
When it happens
Trigger: POST /_data_stream/_modify with a body like {"actions":[]} or with the actions field omitted entirely. The parser succeeds but the post-parse guard fails.
Common situations: Automation/template bug generating an empty actions array; client library serializing an empty list; testing the endpoint with a placeholder body.
Related errors
- Cannot create past TSDB backing index for data stream [{}] w
- data stream [{}] does not exist
- Elasticsearch version is missing from properties.
- Expected elasticsearch version to be numbers only of the for
- Invalid qualifier: ${qualifier}
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/17b9fd6e22de4795.
Report an issue: GitHub.