{"record":{"id":"834a27cceca91642","repo":"apache/iceberg","slug":"chunked-encoding-not-supported","errorCode":null,"errorMessage":"Chunked encoding not supported","messagePattern":"Chunked encoding not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"aws/src/main/java/org/apache/iceberg/aws/s3/signer/S3V4RestSignerClient.java","lineNumber":391,"sourceCode":"    headers.remove(CACHE_CONTROL);\n\n    // we need to overwrite whatever headers the server signed/unsigned with the ones from the\n    // original request and then put all headers back to the request\n    headers.putAll(mutableRequest.headers());\n    headers.forEach(mutableRequest::putHeader);\n  }\n\n  private boolean canBeCached(Map<String, String> responseHeaders) {\n    return CACHE_CONTROL_PRIVATE.equals(responseHeaders.get(CACHE_CONTROL));\n  }\n\n  private void checkSignerParams(AwsS3V4SignerParams signerParams) {\n    if (signerParams.enablePayloadSigning()) {\n      throw new UnsupportedOperationException(\"Payload signing not supported\");\n    }\n\n    if (signerParams.enableChunkedEncoding()) {\n      throw new UnsupportedOperationException(\"Chunked encoding not supported\");\n    }\n  }\n\n  @Value.Immutable\n  interface Key {\n    String method();\n\n    String region();\n\n    String uri();\n\n    static Key from(RemoteSignRequest request) {\n      return ImmutableKey.builder()\n          .method(request.method())\n          .region(request.region())\n          .uri(request.uri().toString())\n          .build();\n    }","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aws/src/main/java/org/apache/iceberg/aws/s3/signer/S3V4RestSignerClient.java#L373-L409","documentation":"checkSignerParams() also rejects AwsS3V4SignerParams with enableChunkedEncoding()=true. Chunked (streaming) signature encoding cannot be used with the remote REST signer, which computes signatures over complete requests.","triggerScenarios":"SDK-generated signer params enable chunked encoding (common for streaming uploads) while the remote signer's processRequestPayload path runs.","commonSituations":"Streaming multipart/PutObject operations through the remote signer; SDK defaults enabling aws-chunked encoding; clients mixing S3 TransferManager-style uploads with remote signing.","solutions":["Disable chunked encoding / streaming upload paths when using the remote S3 signer.","Use plain (non-chunked) PutObject requests through S3FileIO.","Fall back to regular AWS credential signing for workloads that require chunked encoding.","Verify Iceberg version — newer releases align signer params with SDK defaults."],"exampleFix":"// before\n// chunked-encoded streaming upload through remote signer\ntransferManager.upload(...).waitForCompletion();\n// after\n// simple upload via S3OutputStream (non-chunked, remote-signer compatible)\ntry (PositionOutputStream out = io.newOutputFile(loc).createOrOverwrite()) {\n  out.write(bytes);\n}","handlingStrategy":"validation","validationCode":"// Java\nif (signerParams.enableChunkedEncoding()) {\n  throw new IllegalStateException(\"Remote S3 signer requires chunked encoding disabled\");\n}","typeGuard":null,"tryCatchPattern":"// Java\ntry {\n  out.write(data);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().equals(\"Chunked encoding not supported\")) {\n    LOG.error(\"Use non-chunked uploads with the remote S3 signer\");\n  }\n}","preventionTips":["Avoid TransferManager/streaming chunked uploads behind the remote signer","Use S3OutputStream (plain PutObject/multipart) with remote signing","Keep chunked-encoding SDK defaults disabled for signer-managed requests"],"tags":["s3","signer","chunked-encoding","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}