apache/flink · critical · IOException

Unrecognized version

Error message

Unrecognized version: {}

What it means

Thrown by SimpleTypeSerializerSnapshot.readSnapshot in its default switch branch. The snapshot format only recognizes readVersion 2 (legacy, with a class-name field that is read and discarded) and readVersion 3 (current, no payload). Any other version indicates the snapshot was written by an incompatible format revision or the data is corrupt.

Solutions

  1. Restore the checkpoint with the Flink version that created it, then take a fresh savepoint and migrate.
  2. Check the Flink release notes for state backward-compatibility guarantees between your source and target versions.
  3. If the data is corrupt rather than version-incompatible, re-create the checkpoint from a known-good state.
Defensive patterns

Strategy: validation

Validate before calling

// Verify the Flink version supports the snapshot version in your checkpoints
// SimpleTypeSerializerSnapshot supports readVersion 2 and 3 only (version 1 is pre-1.7.x)

Try / catch

try {
    backend.restore(checkpointPath);
} catch (IOException e) {
    if (e.getMessage().contains("Unrecognized version")) {
        log.error("Snapshot version not supported by this Flink version.");
    }
    throw e;
}

Prevention

When it happens

Trigger: Restoring a checkpoint that contains a SimpleTypeSerializerSnapshot written with a version other than 2 or 3. Version 1 is reserved for the legacy ParameterlessTypeSerializerConfig and is not handled here. A version above 3 would come from a future or forked Flink. Corrupt data can also produce an arbitrary version integer.

Common situations: Restoring a very old savepoint (pre-1.7.x, version 1) on a modern Flink. Restoring a checkpoint from a newer/custom Flink fork that bumped CURRENT_VERSION. Corrupted snapshot bytes where the version field holds garbage.

Related errors


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

Appendix: source

Thrown at flink-core/src/main/java/org/apache/flink/api/common/typeutils/SimpleTypeSerializerSnapshot.java:110

    }

    @Override
    public void readSnapshot(int readVersion, DataInputView in, ClassLoader classLoader)
            throws IOException {
        switch (readVersion) {
            case 3:
                {
                    break;
                }
            case 2:
                {
                    // we don't need the classname any more; read and drop to maintain compatibility
                    in.readUTF();
                    break;
                }
            default:
                {
                    throw new IOException("Unrecognized version: " + readVersion);
                }
        }
    }

    // ------------------------------------------------------------------------
    //  standard utilities
    // ------------------------------------------------------------------------

    @Override
    public final boolean equals(Object obj) {
        return obj != null && obj.getClass() == getClass();
    }

    @Override
    public final int hashCode() {
        return getClass().hashCode();
    }

View on GitHub (pinned to 2f3c205e92)