apache/flink · error · IOException

Corrupt Maxwell JSON message '%s'.

Error message

Corrupt Maxwell JSON message '%s'.

What it means

The outermost catch in MaxwellJsonDeserializationSchema.deserialize(byte[], Collector) wraps any Throwable raised while deserializing the raw JSON into a RowData and extracting 'data'/'old'/'type'. With ignore-parse-errors = false this becomes an IOException('Corrupt Maxwell JSON message ...') carrying the original cause; with ignore-parse-errors = true the message is skipped (debug-logged) and no rows are emitted.

Source

Thrown at flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/maxwell/MaxwellJsonDeserializationSchema.java:190

                genericRowDataList.add(handleRow(row, delete));
            } else {
                if (!ignoreParseErrors) {
                    throw new IOException(
                            format(
                                    "Unknown \"type\" value \"%s\". The Maxwell JSON message is '%s'",
                                    type, new String(message)));
                }
                if (LOG.isDebugEnabled()) {
                    LOG.debug(
                            "Unknown \"type\" value '{}'. The Maxwell JSON message is '{}'.",
                            type,
                            new String(message));
                }
            }
        } catch (Throwable t) {
            // a big try catch to protect the processing.
            if (!ignoreParseErrors) {
                throw new IOException(
                        format("Corrupt Maxwell JSON message '%s'.", new String(message)), t);
            }
            if (LOG.isDebugEnabled()) {
                LOG.debug("Corrupt Maxwell JSON message '{}'.", new String(message), t);
            }
        }
        for (GenericRowData genericRowData : genericRowDataList) {
            out.collect(genericRowData);
        }
    }

    private GenericRowData handleRow(GenericRowData rootRow, GenericRowData physicalRow) {
        // shortcut in case no output projection is required
        if (!hasMetadata) {
            return physicalRow;
        }
        final int metadataArity = metadataConverters.length;
        final GenericRowData producedRow =

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Inspect the cause chain and the printed message bytes to identify whether it is malformed JSON or a schema mismatch.
  2. Align the DDL column types with the Maxwell 'data' payload types (or use 'maxwell-json.timestamp-format' / schema inference via 'maxwell-json.schema-include' where applicable).
  3. Enable 'maxwell-json.ignore-parse-errors' = true only if skipping bad records is acceptable.
Defensive patterns

Strategy: try-catch

Try / catch

try { schema.deserialize(message, collector); } catch (IOException e) { metrics.corruptMessages.inc(); deadLetterQueue.write(message, e.getCause()); }

Prevention

When it happens

Trigger: Malformed JSON bytes on the topic; a message that parses as JSON but does not match the expected Maxwell structure (missing 'data' object, wrong types) causing ClassCastException/NullPointer inside the try block; a payload that fails the table's declared physical schema conversion.

Common situations: Mixing plain JSON and Maxwell JSON on one topic; declaring a table schema whose field types cannot hold the JSON values (e.g. INT column receiving a string); truncated messages from a misbehaving producer.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/1c30f354649ea995. Report an issue: GitHub.