{"record":{"id":"7b489a28bf88ded6","repo":"prestodb/presto","slug":"druid-deep-storage-error","errorCode":"DRUID_DEEP_STORAGE_ERROR","errorMessage":"Failed to create page source on ${segmentInfo.getDeepStoragePath()}","messagePattern":"Failed to create page source on (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-druid/src/main/java/com/facebook/presto/druid/DruidPageSourceProvider.java","lineNumber":93,"sourceCode":"        DruidSegmentInfo segmentInfo = druidSplit.getSegmentInfo().get();\n        try {\n            Path segmentPath = new Path(segmentInfo.getDeepStoragePath());\n            FileSystem fileSystem = segmentPath.getFileSystem(hadoopConfiguration);\n            long fileSize = fileSystem.getFileStatus(segmentPath).getLen();\n            FSDataInputStream inputStream = fileSystem.open(segmentPath);\n            DataInputSourceId dataInputSourceId = new DataInputSourceId(segmentPath.toString());\n            HdfsDataInputSource dataInputSource = new HdfsDataInputSource(dataInputSourceId, inputStream, fileSize);\n            IndexFileSource indexFileSource = new ZipIndexFileSource(dataInputSource);\n            SegmentColumnSource segmentColumnSource = new SmooshedColumnSource(indexFileSource);\n            SegmentIndexSource segmentIndexSource = new V9SegmentIndexSource(segmentColumnSource);\n\n            return new DruidSegmentPageSource(\n                    dataInputSource,\n                    columns,\n                    new DruidSegmentReader(segmentIndexSource, columns));\n        }\n        catch (IOException e) {\n            throw new PrestoException(DRUID_DEEP_STORAGE_ERROR, \"Failed to create page source on \" + segmentInfo.getDeepStoragePath(), e);\n        }\n    }\n}\n","sourceCodeStart":75,"sourceCodeEnd":97,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-druid/src/main/java/com/facebook/presto/druid/DruidPageSourceProvider.java#L75-L97","documentation":"DruidPageSourceProvider.createPageSource wraps IOException from opening/reading a Druid segment's deep-storage file and rethrows it as DRUID_DEEP_STORAGE_ERROR with the failing deepStoragePath. It means the connector could not create a page source over the segment data fetched from deep storage (S3/HDFS/local), so the scan of that segment fails.","triggerScenarios":"A query scans a Druid segment whose deep storage path cannot be read: the object is missing/deleted, credentials are wrong, network to S3/HDFS fails, the file is corrupt/truncated, or the dataInputSource factory cannot open the URI.","commonSituations":"Segments retained in Druid metadata but already cleaned up from deep storage (retention/kill rules); expired or misconfigured S3 credentials/IAM role for the Presto worker; HDFS NameNode unreachable; segment files moved by compaction or migration.","solutions":["Verify the segment file exists at the printed deepStoragePath in deep storage and that retention/kill policies have not deleted it.","Check deep-storage credentials and connectivity from the Presto worker (S3 access keys/IAM role, HDFS config), then retry the query.","Confirm Druid's deep storage configuration and that Presto's druid.client / data source settings match the same storage location.","Re-ingest or re-publish the affected segment if the file is corrupt or missing, then re-run the query."],"exampleFix":"// before (typical misconfig: wrong bucket/region so open() throws IOException)\ndruid.deep-storage.type=s3\ndruid.s3.bucket=old-bucket\n// after\ndruid.deep-storage.type=s3\ndruid.s3.bucket=current-bucket\ndruid.s3.region=us-east-1  # must match segment location; also ensure IAM read access","handlingStrategy":"retry","validationCode":"// Pre-check segment availability before scanning (conceptual):\n// 1. Confirm the object exists at segmentInfo.getDeepStoragePath() via the storage client\n// 2. Verify worker credentials can read it\nboolean readable = storageClient.exists(deepStoragePath) && storageClient.canRead(deepStoragePath);\nif (!readable) {\n    throw new IllegalStateException(\"Segment unreadable at \" + deepStoragePath + \": fix deep-storage config/credentials before querying\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    return query(sql);\n}\ncatch (PrestoException e) {\n    if (\"DRUID_DEEP_STORAGE_ERROR\".equals(e.getErrorCode().getName())) {\n        // transient network blips: bounded retry; do NOT retry missing/corrupt segments\n        return retryWithBackoff(() -> query(sql), 3);\n    }\n    throw e;\n}","preventionTips":["Keep Druid retention/kill rules aligned with how long Presto may query old segments.","Verify Presto worker IAM/credentials have read access to the Druid deep-storage bucket/path.","Monitor deep-storage availability (S3 errors, HDFS NameNode health) before blaming the connector.","After Druid compaction/migration, confirm segment deep-storage paths are updated in metadata.","Log and alert on this error code; the message includes the exact path to inspect."],"tags":["druid","deep-storage","io","segment-read"],"backgroundTag":"deep-storage-read-failure","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}