{"record":{"id":"fc4fda50825a0384","repo":"quarkusio/quarkus","slug":"runtimeexception-e-fc4fda","errorCode":null,"errorMessage":"RuntimeException(e)","messagePattern":"RuntimeException\\(e\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/grpc/cli/src/main/java/io/quarkus/grpc/cli/GcurlBaseCommand.java","lineNumber":63,"sourceCode":"    protected abstract void execute(MutinyServerReflectionGrpc.MutinyServerReflectionStub stub);\n\n    protected void log(String msg) {\n        System.out.println(msg);\n    }\n\n    protected void err(String msg) {\n        System.err.println(msg);\n    }\n\n    protected static List<Descriptors.FileDescriptor> getFileDescriptorsFromProtos(List<ByteString> protos) {\n        try {\n            Map<String, DescriptorProtos.FileDescriptorProto> all = protos\n                    .stream()\n                    .map(bs -> {\n                        try {\n                            return DescriptorProtos.FileDescriptorProto.parseFrom(bs);\n                        } catch (InvalidProtocolBufferException e) {\n                            throw new RuntimeException(e);\n                        }\n                    })\n                    .collect(Collectors.toMap(DescriptorProtos.FileDescriptorProto::getName, Function.identity(), (a, b) -> a));\n            List<Descriptors.FileDescriptor> fds = new ArrayList<>();\n            Map<String, Descriptors.FileDescriptor> resolved = new HashMap<>();\n            for (DescriptorProtos.FileDescriptorProto fdp : all.values()) {\n                fds.add(toFileDescriptor(fdp, all, resolved));\n            }\n            return fds;\n        } catch (Exception e) {\n            throw new RuntimeException(e);\n        }\n    }\n\n    private static Descriptors.FileDescriptor toFileDescriptor(DescriptorProtos.FileDescriptorProto fdp,\n            Map<String, DescriptorProtos.FileDescriptorProto> all, Map<String, Descriptors.FileDescriptor> resolved) {\n        int n = fdp.getDependencyCount();\n        ProtocolStringList list = fdp.getDependencyList();","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/grpc/cli/src/main/java/io/quarkus/grpc/cli/GcurlBaseCommand.java#L45-L81","documentation":"GcurlBaseCommand.getFileDescriptorsFromProtos parses raw FileDescriptorProto bytes obtained via gRPC reflection. InvalidProtocolBufferException (malformed bytes) is converted to RuntimeException and propagated. This indicates the bytes received from the server are not a valid FileDescriptorProto.","triggerScenarios":"`quarkus grpc gcurl` against a server whose reflection response contains invalid protocol buffer bytes; truncated or corrupted transport of the descriptor set.","commonSituations":"Server behind a proxy that mangles responses; gRPC server implementing reflection incorrectly; network interruption producing partial payloads.","solutions":["Check the caused-by InvalidProtocolBufferException message for offset/details","Confirm server reflection works with grpcurl before using quarkus gcurl","Bypass proxies or TLS-terminating middlewares and connect directly to the gRPC port"],"exampleFix":"// before\n} catch (InvalidProtocolBufferException e) {\n    throw new RuntimeException(e);\n}\n// after\n} catch (InvalidProtocolBufferException e) {\n    throw new RuntimeException(\"Server returned an invalid FileDescriptorProto; check reflection/proxy\", e);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    quarkus grpc gcurl MyService/MyMethod;\n} catch (RuntimeException e) {\n    if (e.getCause() instanceof InvalidProtocolBufferException ipbe) {\n        System.err.println(\"Invalid descriptor bytes: \" + ipbe.getMessage());\n    }\n}","preventionTips":["Verify reflection output with grpcurl before using quarkus gcurl","Bypass middlewares that could truncate or modify gRPC responses","Use matching protobuf versions on client CLI and server"],"tags":["grpc","cli","protobuf-parsing"],"backgroundTag":"protobuf-descriptor-parse-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}