apache/iceberg · error · UnsupportedOperationException

Chunked encoding not supported

Error message

Chunked encoding not supported

What it means

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.

Solutions

  1. Disable chunked encoding / streaming upload paths when using the remote S3 signer.
  2. Use plain (non-chunked) PutObject requests through S3FileIO.
  3. Fall back to regular AWS credential signing for workloads that require chunked encoding.
  4. Verify Iceberg version — newer releases align signer params with SDK defaults.

Example fix

// before
// chunked-encoded streaming upload through remote signer
transferManager.upload(...).waitForCompletion();
// after
// simple upload via S3OutputStream (non-chunked, remote-signer compatible)
try (PositionOutputStream out = io.newOutputFile(loc).createOrOverwrite()) {
  out.write(bytes);
}
Defensive patterns

Strategy: validation

Validate before calling

// Java
if (signerParams.enableChunkedEncoding()) {
  throw new IllegalStateException("Remote S3 signer requires chunked encoding disabled");
}

Try / catch

// Java
try {
  out.write(data);
} catch (UnsupportedOperationException e) {
  if (e.getMessage().equals("Chunked encoding not supported")) {
    LOG.error("Use non-chunked uploads with the remote S3 signer");
  }
}

Prevention

When it happens

Trigger: SDK-generated signer params enable chunked encoding (common for streaming uploads) while the remote signer's processRequestPayload path runs.

Common situations: Streaming multipart/PutObject operations through the remote signer; SDK defaults enabling aws-chunked encoding; clients mixing S3 TransferManager-style uploads with remote signing.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/834a27cceca91642. Report an issue: GitHub.

Appendix: source

Thrown at aws/src/main/java/org/apache/iceberg/aws/s3/signer/S3V4RestSignerClient.java:391

    headers.remove(CACHE_CONTROL);

    // we need to overwrite whatever headers the server signed/unsigned with the ones from the
    // original request and then put all headers back to the request
    headers.putAll(mutableRequest.headers());
    headers.forEach(mutableRequest::putHeader);
  }

  private boolean canBeCached(Map<String, String> responseHeaders) {
    return CACHE_CONTROL_PRIVATE.equals(responseHeaders.get(CACHE_CONTROL));
  }

  private void checkSignerParams(AwsS3V4SignerParams signerParams) {
    if (signerParams.enablePayloadSigning()) {
      throw new UnsupportedOperationException("Payload signing not supported");
    }

    if (signerParams.enableChunkedEncoding()) {
      throw new UnsupportedOperationException("Chunked encoding not supported");
    }
  }

  @Value.Immutable
  interface Key {
    String method();

    String region();

    String uri();

    static Key from(RemoteSignRequest request) {
      return ImmutableKey.builder()
          .method(request.method())
          .region(request.region())
          .uri(request.uri().toString())
          .build();
    }

View on GitHub (pinned to 86d9c8fc54)