{"record":{"id":"9b966e9ce9d3f52c","repo":"apache/iceberg","slug":"failed-to-create-s3-analytics-accelerator-input-st","errorCode":null,"errorMessage":"Failed to create S3 analytics accelerator input stream for: %s","messagePattern":"Failed to create S3 analytics accelerator input stream for: (.+?)","errorType":"exception","errorClass":"RuntimeIOException","httpStatus":null,"severity":"error","filePath":"aws/src/main/java/org/apache/iceberg/aws/s3/AnalyticsAcceleratorUtil.java","lineNumber":68,"sourceCode":"                          Pair<S3AsyncClient, S3FileIOProperties>, S3SeekableInputStreamFactory>)\n                      (key, factory, cause) -> close(factory))\n              .build();\n\n  private AnalyticsAcceleratorUtil() {}\n\n  public static SeekableInputStream newStream(S3InputFile inputFile) {\n    S3URI uri = S3URI.of(inputFile.uri().bucket(), inputFile.uri().key());\n\n    S3SeekableInputStreamFactory factory =\n        STREAM_FACTORY_CACHE.get(\n            Pair.of(inputFile.asyncClient(), inputFile.s3FileIOProperties()),\n            AnalyticsAcceleratorUtil::createNewFactory);\n\n    try {\n      S3SeekableInputStream seekableInputStream = factory.createStream(uri);\n      return new AnalyticsAcceleratorInputStreamWrapper(seekableInputStream, inputFile.metrics());\n    } catch (IOException e) {\n      throw new RuntimeIOException(\n          e, \"Failed to create S3 analytics accelerator input stream for: %s\", inputFile.uri());\n    }\n  }\n\n  private static S3SeekableInputStreamFactory createNewFactory(\n      Pair<S3AsyncClient, S3FileIOProperties> cacheKey) {\n    ConnectorConfiguration connectorConfiguration =\n        new ConnectorConfiguration(cacheKey.second().s3AnalyticsacceleratorProperties());\n    S3SeekableInputStreamConfiguration streamConfiguration =\n        S3SeekableInputStreamConfiguration.fromConfiguration(connectorConfiguration);\n    ObjectClientConfiguration objectClientConfiguration =\n        ObjectClientConfiguration.fromConfiguration(connectorConfiguration);\n\n    ObjectClient objectClient = new S3SdkObjectClient(cacheKey.first(), objectClientConfiguration);\n    return new S3SeekableInputStreamFactory(objectClient, streamConfiguration);\n  }\n\n  private static void close(S3SeekableInputStreamFactory factory) {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aws/src/main/java/org/apache/iceberg/aws/s3/AnalyticsAcceleratorUtil.java#L50-L86","documentation":"RuntimeIOException thrown by AnalyticsAcceleratorUtil.newStream when the S3 analytics accelerator factory fails to create the seekable input stream for a file (IOException from factory.createStream). The analytics accelerator wraps S3 reads with a prefetching/caching layer; a failure to initialize the stream for the given S3 URI is surfaced as an unchecked RuntimeIOException with the file URI in the message.","triggerScenarios":"S3FileIO opening a data/metadata file with analytics accelerator enabled (s3.analytics-accelerator.* properties) while factory.createStream(uri) throws IOException — e.g. accelerator client initialization failure or invalid/unsupported URI.","commonSituations":"Misconfigured analytics accelerator options (bucket/region mismatch, credentials for the accelerator's async client); accelerator library version incompatibility; object missing or inaccessible when the stream is created; bad s3:// URI format.","solutions":["Check the underlying IOException cause for the accelerator's real failure (credentials, region, object access).","Disable the analytics accelerator by unsetting s3.analytics-accelerator.* properties to fall back to the default S3InputStream.","Verify the S3 URI and that the object exists and is readable by the configured credentials.","Align the analytics-accelerator library version with the Iceberg AWS module version in use."],"exampleFix":"// before\nMap<String, String> props = Map.of(\n    S3FileIOProperties.ANALYTICS_ACCELERATOR_ENABLED, \"true\",\n    \"s3.analytics-accelerator.bucket.REGION_MISMATCH\", \"us-west-1\"); // stream creation fails\n// after\nMap<String, String> props = Map.of(); // default S3 input stream, or fix accelerator region config","handlingStrategy":"fallback","validationCode":"if (properties.containsKey(\"s3.analytics-accelerator.enabled\")) {\n  // verify accelerator config/credentials before enabling\n}","typeGuard":null,"tryCatchPattern":"try {\n  stream = AnalyticsAcceleratorUtil.newStream(inputFile, props);\n} catch (RuntimeIOException e) {\n  LOG.warn(\"Accelerator stream failed, falling back to default S3 stream\", e);\n  stream = new S3InputStream(...); // default path\n}","preventionTips":["Validate accelerator credentials/region configuration before enabling","Test S3 object accessibility with plain S3FileIO first","Pin compatible analytics-accelerator library versions","Keep the default (non-accelerator) path as an operational fallback"],"tags":["aws","s3","io","analytics-accelerator"],"backgroundTag":"file-open-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}