{"record":{"id":"6e3cfed56e4184ba","repo":"elastic/elasticsearch","slug":"data-stream-not-found","errorCode":null,"errorMessage":"Data stream [{}] not found","messagePattern":"Data stream \\[(.+?)\\] not found","errorType":"exception","errorClass":"ResourceNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/TransportPastTimeSeriesIndexCreationAction.java","lineNumber":519,"sourceCode":"            return sortedTimeWindows;\n        }\n\n        public void init() {\n            clusterService.getClusterSettings()\n                .addSettingsUpdateConsumer(PAST_TSDB_INDEX_INTERVAL, tv -> indexIntervalMillis = tv.millis());\n        }\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();","sourceCodeStart":501,"sourceCodeEnd":537,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/TransportPastTimeSeriesIndexCreationAction.java#L501-L537","documentation":"Thrown by validateDataStream in TransportPastTimeSeriesIndexCreationAction when the named data stream does not exist in the current project metadata. It is a ResourceNotFoundException surfaced before any further validation of mode/replicated/system status.","triggerScenarios":"Calling the past TSDB index creation task with a data stream name that resolves to null in projectState.metadata().dataStreams(). Wrong project context, typo, or a stream that was never created.","commonSituations":"Cross-project request routed to the wrong project; typo in the data stream name; stream deleted between task enqueue and execution; restore that renamed the stream.","solutions":["Verify the data stream exists with GET _data_stream/<name> in the same project.","Correct the name in the request to match an existing stream.","If restored/renamed, use the new name."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"DataStream ds = project.metadata().dataStreams().get(dataStreamName);\nif (ds == null) {\n  throw new ResourceNotFoundException(\"Data stream [\" + dataStreamName + \"] not found\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["GET _data_stream/<name> in the same project before issuing the past-index-creation task.","Confirm project context and stream name spelling."],"tags":["data-streams","not-found","past-index-creation","elasticsearch"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}