quarkusio/quarkus · error · ErrorDataDecoderException

No Multipart delimiter found

Error message

No Multipart delimiter found

What it means

findMultipartDelimiter scans the undecoded chunk for the next multipart boundary. If it consumes the chunk without finding the expected '--boundary' delimiter, it resets the reader index and throws ErrorDataDecoderException('No Multipart delimiter found').

Source

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

            return null;
        }
        if (newline.equals(delimiter)) {
            currentStatus = dispositionStatus;
            return decodeMultipart(dispositionStatus);
        }
        if (newline.equals(delimiter + "--")) {
            // CLOSEDELIMITER or MIXED CLOSEDELIMITER found
            currentStatus = closeDelimiterStatus;
            if (currentStatus == MultiPartStatus.HEADERDELIMITER) {
                // MIXEDCLOSEDELIMITER
                // end of the Mixed part
                currentFieldAttributes = null;
                return decodeMultipart(MultiPartStatus.HEADERDELIMITER);
            }
            return null;
        }
        undecodedChunk.readerIndex(readerIndex);
        throw new ErrorDataDecoderException("No Multipart delimiter found");
    }

    /**
     * Find the next Disposition
     *
     * @return the next InterfaceHttpData if any
     * @throws ErrorDataDecoderException
     */
    private InterfaceHttpData findMultipartDisposition() {
        int readerIndex = undecodedChunk.readerIndex();
        if (currentStatus == MultiPartStatus.DISPOSITION) {
            currentFieldAttributes = new TreeMap<>(CaseIgnoringComparator.INSTANCE);
        }
        // read many lines until empty line with newline found! Store all data
        while (!skipOneLine()) {
            String newline;
            try {
                skipControlCharacters(undecodedChunk);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Compare the boundary in the response Content-Type with the actual delimiters in the body and fix the server/proxy mismatch
  2. Disable any body-rewriting (compression, charset transcoding) between server and client
  3. Verify the response body really is multipart before decoding
  4. Catch ErrorDataDecoderException and fall back to raw body handling

Example fix

// before (server)
Content-Type: multipart/mixed; boundary=A
body delimiters: --B
// after
Content-Type: multipart/mixed; boundary=B
Defensive patterns

Strategy: try-catch

Validate before calling

String boundary = extractBoundary(response.headers().get(HttpHeaderNames.CONTENT_TYPE));
if (boundary != null && !bodyContains("--" + boundary)) { /* body/header mismatch: don't decode */ }

Try / catch

try { decoder.offer(chunk); } catch (ErrorDataDecoderException e) { if (e.getMessage().contains("No Multipart delimiter")) { /* fall back to raw body */ } }

Prevention

When it happens

Trigger: The stream contains data that does not match the boundary declared in the response Content-Type — e.g. boundary changed mid-stream, body is not actually multipart despite the header, or the boundary line is corrupted.

Common situations: Proxy/gateway rewriting the body but not the boundary; server using a different boundary than advertised; binary corruption (compression/charset translation) of the body; response is actually not multipart.

Related errors


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