{"record":{"id":"6e6fd08a47562922","repo":"elastic/elasticsearch","slug":"cannot-create-past-tsdb-backing-index-for-system-d","errorCode":null,"errorMessage":"Cannot create past TSDB backing index for system data stream [{}]","messagePattern":"Cannot create past TSDB backing index for system data stream \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/TransportPastTimeSeriesIndexCreationAction.java","lineNumber":525,"sourceCode":"        }\n    }\n\n    record CoveredTimeWindow(long start, long end) {\n\n        CoveredTimeWindow(Instant start, Instant end) {\n            this(start.toEpochMilli(), end.toEpochMilli());\n        }\n    }\n\n    private static void validateDataStream(String dataStreamName, DataStream dataStream, ProjectMetadata project) {\n        if (dataStream == null) {\n            throw new ResourceNotFoundException(\"Data stream [\" + dataStreamName + \"] not found\");\n        }\n        if (dataStream.isReplicated()) {\n            throw new IllegalArgumentException(\"Cannot create past TSDB backing index for replicated data stream [\" + dataStreamName + \"]\");\n        }\n        if (dataStream.isSystem()) {\n            throw new IllegalArgumentException(\"Cannot create past TSDB backing index for system data stream [\" + dataStreamName + \"]\");\n        }\n\n        if (IndexMode.isTsdb(dataStream.getIndexMode()) == false) {\n            throw new IllegalArgumentException(\n                \"Cannot create past TSDB backing index for data stream [\"\n                    + dataStreamName\n                    + \"] with mode [\"\n                    + dataStream.getIndexMode()\n                    + \"], it needs to be a time series data stream.\"\n            );\n        }\n        Index writeIndex = dataStream.getWriteIndex();\n        IndexMetadata writeIndexMetadata = writeIndex == null ? null : project.index(writeIndex);\n        if (writeIndexMetadata == null || IndexMode.isTsdb(writeIndexMetadata.getIndexMode()) == false) {\n            throw new IllegalStateException(\n                \"Cannot create past TSDB backing index for data stream [\"\n                    + dataStreamName\n                    + \"] because it requires to have yet at least one time series backing index. Please rollover first.\"","sourceCodeStart":507,"sourceCodeEnd":543,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/TransportPastTimeSeriesIndexCreationAction.java#L507-L543","documentation":"Thrown by validateDataStream when the data stream exists but isSystem() returns true. System data streams are managed internally by Elasticsearch and do not allow user-initiated past TSDB backing index creation; their lifecycle is controlled by the owning feature.","triggerScenarios":"Calling the past TSDB index creation API on a system data stream (e.g. logs-* or metrics-* system streams created by Elastic features). The check runs after the replicated check.","commonSituations":"Bulk backfill job that targets a wildcard catching system streams; user mistakenly treating a system stream as a normal one.","solutions":["Exclude system data streams from past TSDB index creation requests.","If backfill into that data is genuinely required, use the user-facing ingest APIs the owning feature provides rather than the low-level past-index-creation action."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (dataStream.isSystem()) {\n  throw new IllegalArgumentException(\"Cannot create past TSDB backing index for system data stream\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Exclude system data streams from past-index-creation requests.","Use the owning feature's user-facing APIs to ingest into system streams."],"tags":["data-streams","system-stream","past-index-creation","elasticsearch"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}