quarkusio/quarkus · error · ErrorDataDecoderException

Error decoding transfer-encoding value (wrapped IOException)

Error message

Error decoding transfer-encoding value (wrapped IOException)

What it means

This ErrorDataDecoderException wraps an IOException thrown by Attribute.getValue() while reading the Content-Transfer-Encoding value when setting up a file upload. Reading the attribute value can fail on I/O problems (e.g. underlying disk attribute in some Netty factories), so the transfer-encoding resolution fails and the decode aborts.

Source

Thrown at independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/multipart/QuarkusMultipartResponseDecoder.java:879

     *
     * @param delimiter
     *        the delimiter to use
     * @return the InterfaceHttpData if any
     * @throws ErrorDataDecoderException on decoder error
     */
    protected InterfaceHttpData getFileUpload(String delimiter) {
        // eventually restart from existing FileUpload
        // Now get value according to Content-Type and Charset
        Attribute encoding = currentFieldAttributes.get(HttpHeaderNames.CONTENT_TRANSFER_ENCODING);
        Charset localCharset = charset;
        // Default
        TransferEncodingMechanism mechanism = TransferEncodingMechanism.BIT7;
        if (encoding != null) {
            String code;
            try {
                code = encoding.getValue().toLowerCase();
            } catch (IOException e) {
                throw new ErrorDataDecoderException(e);
            }
            if (code.equals(TransferEncodingMechanism.BIT7.value())) {
                localCharset = CharsetUtil.US_ASCII;
            } else if (code.equals(TransferEncodingMechanism.BIT8.value())) {
                localCharset = CharsetUtil.ISO_8859_1;
                mechanism = TransferEncodingMechanism.BIT8;
            } else if (code.equals(TransferEncodingMechanism.BINARY.value())) {
                // no real charset, so let the default
                mechanism = TransferEncodingMechanism.BINARY;
            } else {
                throw new ErrorDataDecoderException("TransferEncoding Unknown: " + code);
            }
        }
        Attribute charsetAttribute = currentFieldAttributes.get(HttpHeaderValues.CHARSET);
        if (charsetAttribute != null) {
            try {
                localCharset = Charset.forName(charsetAttribute.getValue());
            } catch (IOException | UnsupportedCharsetException e) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Check the temp/working directory used by the attribute factory exists, is writable, and has free space.
  2. Retry the request; transient I/O failures often resolve on a second attempt.
  3. Configure the factory to use memory-backed attributes for small payloads.
  4. Inspect OS-level issues (disk full, permissions, deleted temp files) reported in the wrapped IOException.

Example fix

// before: default disk attribute factory failing on deleted temp dir
// after: ensure the temp dir exists before decoding
Files.createDirectories(Paths.get(System.getProperty("java.io.tmpdir"), "quarkus-multipart"));
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check attribute readability before decode where possible
try {
    encoding.getValue();
} catch (IOException e) {
    throw new IllegalStateException("Transfer-encoding attribute unreadable: temp storage broken?", e);
}

Try / catch

try {
    parts = decoder.decodeMultipart(status);
} catch (ErrorDataDecoderException e) {
    if (e.getCause() instanceof IOException) {
        // transient/temp-storage problem: safe to retry once
        parts = retryDecodeOnce();
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: getFileUpload() calls encoding.getValue().toLowerCase() on the stored Content-Transfer-Encoding attribute and the underlying attribute read throws IOException.

Common situations: Disk-backed attribute factories hitting file I/O errors; temp directory removed mid-decode; permissions/disk-full conditions during large multipart processing.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/50dc2919d92ea4e3. Report an issue: GitHub.