quarkusio/quarkus · error · RuntimeException

RuntimeException(e)

Error message

RuntimeException(e)

What it means

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.

Source

Thrown at extensions/grpc/cli/src/main/java/io/quarkus/grpc/cli/GcurlBaseCommand.java:63

    protected abstract void execute(MutinyServerReflectionGrpc.MutinyServerReflectionStub stub);

    protected void log(String msg) {
        System.out.println(msg);
    }

    protected void err(String msg) {
        System.err.println(msg);
    }

    protected static List<Descriptors.FileDescriptor> getFileDescriptorsFromProtos(List<ByteString> protos) {
        try {
            Map<String, DescriptorProtos.FileDescriptorProto> all = protos
                    .stream()
                    .map(bs -> {
                        try {
                            return DescriptorProtos.FileDescriptorProto.parseFrom(bs);
                        } catch (InvalidProtocolBufferException e) {
                            throw new RuntimeException(e);
                        }
                    })
                    .collect(Collectors.toMap(DescriptorProtos.FileDescriptorProto::getName, Function.identity(), (a, b) -> a));
            List<Descriptors.FileDescriptor> fds = new ArrayList<>();
            Map<String, Descriptors.FileDescriptor> resolved = new HashMap<>();
            for (DescriptorProtos.FileDescriptorProto fdp : all.values()) {
                fds.add(toFileDescriptor(fdp, all, resolved));
            }
            return fds;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    private static Descriptors.FileDescriptor toFileDescriptor(DescriptorProtos.FileDescriptorProto fdp,
            Map<String, DescriptorProtos.FileDescriptorProto> all, Map<String, Descriptors.FileDescriptor> resolved) {
        int n = fdp.getDependencyCount();
        ProtocolStringList list = fdp.getDependencyList();

View on GitHub (pinned to e1c734241f)

Solutions

  1. Check the caused-by InvalidProtocolBufferException message for offset/details
  2. Confirm server reflection works with grpcurl before using quarkus gcurl
  3. Bypass proxies or TLS-terminating middlewares and connect directly to the gRPC port

Example fix

// before
} catch (InvalidProtocolBufferException e) {
    throw new RuntimeException(e);
}
// after
} catch (InvalidProtocolBufferException e) {
    throw new RuntimeException("Server returned an invalid FileDescriptorProto; check reflection/proxy", e);
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
    quarkus grpc gcurl MyService/MyMethod;
} catch (RuntimeException e) {
    if (e.getCause() instanceof InvalidProtocolBufferException ipbe) {
        System.err.println("Invalid descriptor bytes: " + ipbe.getMessage());
    }
}

Prevention

When it happens

Trigger: `quarkus grpc gcurl` against a server whose reflection response contains invalid protocol buffer bytes; truncated or corrupted transport of the descriptor set.

Common situations: Server behind a proxy that mangles responses; gRPC server implementing reflection incorrectly; network interruption producing partial payloads.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/fc4fda50825a0384. Report an issue: GitHub.