{"record":{"id":"ba419b8ccd8c7e24","repo":"apache/flink","slug":"failed-to-delegate-to-protoschemaconverter","errorCode":null,"errorMessage":"Failed to delegate to ProtoSchemaConverter","messagePattern":"Failed to delegate to ProtoSchemaConverter","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/protobuf/PatchedProtoWriteSupport.java","lineNumber":878,"sourceCode":" * if present; else implement minimal mapping. To minimize risk, we reflectively invoke the original\n * ProtoSchemaConverter if available.\n */\nclass PatchedProtoSchemaConverter {\n    private final ParquetConfiguration configuration;\n\n    PatchedProtoSchemaConverter(ParquetConfiguration configuration) {\n        this.configuration = configuration;\n    }\n\n    MessageType convert(Descriptor descriptor) {\n        try {\n            Class<?> clazz = Class.forName(\"org.apache.parquet.proto.ProtoSchemaConverter\");\n            Object inst =\n                    clazz.getConstructor(ParquetConfiguration.class).newInstance(configuration);\n            return (MessageType)\n                    clazz.getMethod(\"convert\", Descriptor.class).invoke(inst, descriptor);\n        } catch (Exception e) {\n            throw new RuntimeException(\"Failed to delegate to ProtoSchemaConverter\", e);\n        }\n    }\n}\n","sourceCodeStart":860,"sourceCodeEnd":882,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/protobuf/PatchedProtoWriteSupport.java#L860-L882","documentation":"PatchedProtoSchemaConverter.convert reflectively loads org.apache.parquet.proto.ProtoSchemaConverter and delegates schema conversion. If the class is missing, not constructed with a ParquetConfiguration, or invocation fails, it wraps the cause in RuntimeException('Failed to delegate to ProtoSchemaConverter').","triggerScenarios":"Running the patched write support without parquet-proto's ProtoSchemaConverter on the classpath, or with a parquet-proto version whose ProtoSchemaConverter lacks the ParquetConfiguration constructor or convert(Descriptor) method.","commonSituations":"Shaded/slimer jars that exclude parquet-proto, a parquet-proto version mismatch after a dependency upgrade, or classloader isolation (e.g. SQL connectors, OSGi) hiding the class.","solutions":["Ensure flink-parquet's parquet-proto dependency (and its correct version) is on the runtime classpath","Check the wrapped cause in the stack trace - it names the exact reflective failure (ClassNotFoundException vs NoSuchMethodException)","Avoid repackaging/shading org.apache.parquet.proto classes away from this code path"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"try { Class.forName(\"org.apache.parquet.proto.ProtoSchemaConverter\"); } catch (ClassNotFoundException e) { throw new IllegalStateException(\"parquet-proto missing on classpath\", e); }","typeGuard":null,"tryCatchPattern":"try { schema = converter.convert(descriptor); } catch (RuntimeException e) { // inspect e.getCause(): ClassNotFoundException -> classpath; NoSuchMethodException -> parquet-proto version mismatch }","preventionTips":["Pin a compatible parquet-proto version alongside flink-parquet","Do not shade away org.apache.parquet.proto from the format jar","Fail fast at job start with a Class.forName presence check"],"tags":["parquet","protobuf","classpath","reflection","dependency"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}