{"record":{"id":"2774c741156f920a","repo":"apache/pulsar","slug":"no-key-schema-info-or-value-schema-info-key","errorCode":null,"errorMessage":"No key schema info or value schema info : key = ${keySchema.getSchemaInfo()}, value = ${valueSchema.getSchemaInfo()}","messagePattern":"No key schema info or value schema info : key = (.+?), value = (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/KeyValueSchemaImpl.java","lineNumber":304,"sourceCode":"\n    @Override\n    public void configureSchemaInfo(String topicName,\n                                    String componentName,\n                                    SchemaInfo schemaInfo) {\n        if (schemaInfo == null) {\n            log.info().attr(\"topic\", topicName)\n                    .log(\"KeyValueSchema starting from null SchemaInfo.\"\n                            + \" This means that the topic still has\"\n                            + \" not a schema\");\n            return;\n        }\n        KeyValue<SchemaInfo, SchemaInfo> kvSchemaInfo = KeyValueSchemaInfo.decodeKeyValueSchemaInfo(schemaInfo);\n        keySchema.configureSchemaInfo(topicName, \"key\", kvSchemaInfo.getKey());\n        valueSchema.configureSchemaInfo(topicName, \"value\", kvSchemaInfo.getValue());\n        configureKeyValueSchemaInfo();\n\n        if (null == this.schemaInfo) {\n            throw new RuntimeException(\n                \"No key schema info or value schema info : key = \" + keySchema.getSchemaInfo()\n                    + \", value = \" + valueSchema.getSchemaInfo());\n        }\n    }\n\n    @Override\n    public Schema<KeyValue<K, V>> clone() {\n        return KeyValueSchemaImpl.of(keySchema.clone(), valueSchema.clone(), keyValueEncodingType);\n    }\n\n    private void buildKeyValueSchemaInfo() {\n        this.schemaInfo = KeyValueSchemaInfo.encodeKeyValueSchemaInfo(\n                keySchema, valueSchema, keyValueEncodingType\n        );\n    }\n\n    private void configureKeyValueSchemaInfo() {\n        buildKeyValueSchemaInfo();","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/KeyValueSchemaImpl.java#L286-L322","documentation":"After decoding the KeyValueSchemaInfo from the topic schema, KeyValueSchemaImpl.configureSchemaInfo pushes the key/value SchemaInfo into the subschemas and then derives its own schemaInfo. If that derivation yields null, the key or value schema info was missing/invalid, so it throws a RuntimeException naming both schema infos.","triggerScenarios":"Calling configureSchemaInfo(topicName, schemaInfo) (via fetchSchemaIfNeeded) with a KeyValue SchemaInfo whose decoded key or value SchemaInfo is null or has a null/unknown type, so configureKeyValueSchemaInfo() cannot build a schemaInfo.","commonSituations":"A KeyValue schema uploaded with a malformed/empty key or value SchemaInfo; schema info lost when copying schema metadata between topics; client versions producing subtly different KeyValueSchemaInfo encodings.","solutions":["Inspect the topic's schema info (admin schemas get) and re-upload a well-formed KeyValue schema with non-null key and value SchemaInfo","Ensure both key and value schemas have valid SchemaType and properties when building KeyValueSchemaInfo.encodeKeyValueSchemaInfo","Upgrade/align the client version so KeyValueSchemaInfo encoding/decoding matches what the broker stored"],"exampleFix":"// before\nSchemaInfo kvInfo = SchemaInfoImpl.builder().schema(KeyValueSchemaInfo.encodeKeyValueSchemaInfo(null, null)).build(); // null sub-schema infos\n// after\nSchemaInfo kvInfo = SchemaInfoImpl.builder().schema(KeyValueSchemaInfo.encodeKeyValueSchemaInfo(keySchemaInfo, valueSchemaInfo)).build();","handlingStrategy":"try-catch","validationCode":"KeyValue<SchemaInfo, SchemaInfo> kv = KeyValueSchemaInfo.decodeKeyValueSchemaInfo(schemaInfo);\nif (kv == null || kv.getKey() == null || kv.getValue() == null) throw new IllegalStateException(\"KeyValue schema info missing key or value SchemaInfo\");","typeGuard":null,"tryCatchPattern":"try { schema.configureSchemaInfo(topic, \"key_value\", schemaInfo); } catch (RuntimeException e) { if (e.getMessage().startsWith(\"No key schema info or value schema info\")) { reUploadSchema(topic); } else throw e; }","preventionTips":["Inspect `pulsar-admin schemas get` output before relying on a topic's KeyValue schema","Re-upload the KeyValue schema if key/value sub-infos are empty","Keep client versions consistent across producers and consumers"],"tags":["schema","keyvalue","schema-info"],"backgroundTag":"missing-schema-info","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}