Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    I've ensured that I'm referencing protobuf and abseil from my grpc build.
    Here is the basic CMakeLists.txt which still results in the duplicate symbols error:
    find_package(Protobuf CONFIG REQUIRED)
    find_package(absl CONFIG REQUIRED)
    find_package(gRPC REQUIRED)
    # ... 
    # ----------------------
    # Protobuf + GRPC
    # -----------------------
    set(proto_dir "${CMAKE_CURRENT_SOURCE_DIR}/protobuf")
    set(proto_inputs ...)
        LANGUAGE cpp
       PROTOS ${proto_inputs}
       IMPORT_DIRS ${proto_dir}
    add_library(my-app-proto-iface STATIC ${PROTO_SRCS})
    target_link_libraries(my-app-proto-iface PUBLIC protobuf::libprotobuf)
    grpc_generate_cpp(GRPC_SRCS GRPC_HDRS ${CMAKE_CURRENT_BINARY_DIR} "${proto_dir}/grpc-services.proto")
    add_library(my-app-grpc-iface STATIC ${GRPC_SRCS} ${GRPC_HDRS})
    target_link_libraries(my-app-grpc-iface PUBLIC
    # ----------
    # App Server
    add_executable(my-app-server ...)
    target_link_libraries(my-app-server PUBLIC
    # ...
    I made a test project that DOES work however:
    cmake_minimum_required(VERSION 3.14)
    find_package(Protobuf CONFIG REQUIRED)
    find_package(absl CONFIG REQUIRED)
    find_package(gRPC REQUIRED)
    set(proto_dir "${CMAKE_CURRENT_SOURCE_DIR}/protobuf")
    set(Protobuf_IMPORT_DIRS "${proto_dir}")
        LANGUAGE cpp
        TARGET grpc-test
        PROTOS "${proto_dir}/test.proto" "${proto_dir}/helloworld.proto"
        IMPORT_DIRS ${Protobuf_IMPORT_DIRS}
    target_include_directories(grpc-test PRIVATE
        # HACK!
    target_link_libraries(grpc-test PRIVATE
    In both CMake Cache is set to the following:
    //The directory containing a CMake configuration file for Protobuf.
    //The directory containing a CMake configuration file for absl.
    //The directory containing a CMake configuration file for gRPC.
    the conflicting libraries are libgrpc.a, libupb.a, and libgpr.a
    Continuing on this... Looking at the cmake for grpc i can see that grpc::grpc explicitly links grpc::upb and grpc::gpr which causes the conflicts...
    1 reply
    set_target_properties(gRPC::grpc PROPERTIES
      INTERFACE_LINK_LIBRARIES "gRPC::zlibstatic;gRPC::cares;gRPC::address_sorting;gRPC::re2;gRPC::upb;m;Threads::Threads;absl::flat_hash_map;absl::inlined_vector;absl::bind_front;absl::hash;absl::statusor;absl::variant;absl::utility;gRPC::gpr;gRPC::ssl;gRPC::crypto;gRPC::address_sorting;-framework CoreFoundation"
    Bogdan Boamfa

    Hello! I have a gRPC server that streams data for an indefinite amount of time. It spawns a child process that retrieves some hardware resources stats.

    What I want is to cancel the gRPC call from the client so that I can kill the spawned process. Another solution would be a way to detect on the server when the client disconnects so that I can kill the process.

    I am using grpc-node for both the client and the server. Do you know how I can do this?

    1 reply
    Robin Liu
    Hello. I want to merge branch in github. And I signed CNCF document. But still can't accessed by EasyCLA bot. How can I do?
    Robin Liu
    Sorry to interrupt. solved. :)
    Question about grpc-js and tryShutdown. I'd expect that when I run tryShutdown it would let any running unary grpc calls finish successfully, and close the server. But instead it actually cancels the stream, which makes the other end think that something went wrong, even after sending a successful response.
    6 replies
    Daniel Wahlqvist
    I'm using grpc-java and I've implemented ClientResponseObserver giving me the ability to do cancel on the request. When I do cancel the server successfully cancels and I get an error back to the ClientResponseObserver, the error simply says "CANCELLED". This seems pretty normal to me but my colleague thinks the error is a problem. Is it? Or is the error how it's supposed to be?
    5 replies
    Hello! I have a gRPC stream JAVA client consuming from an event bus like gRPC stream. Occasionally, the stream crash with error Caused by: java.lang.IllegalArgumentException: null frame before EOS after calling clientStub.onNext(...). Is there a way to resolve this?
    4 replies
    Karol Janik
    Hello! Do you guys have some repository with examples of usage pagination in grpc, following the aip.dev standards (https://google.aip.dev/158)?
    Ujjwal Jha
    Hi All, Can we call a rest Api from gRPC server and if so can someone help how to do it?
    Karol Janik
    @UjjwalJ31245321_twitter PTAL at https://github.com/grpc-ecosystem/grpc-gateway :)
    Ujjwal Jha
    @karol-janik Thanks for the help, how to add the HTTPheaders in Option's GET method?
    Ujjwal Jha
    Hi All, can anyone please help me to call a rest api through GRPC using java?
    1 reply
    what could be the reason for the following code occasionally stucked:
                        var connectTask = channel.ConnectAsync(connectDeadline)
                        await connectTask; // this line stucks
    var connectDeadline = DateTime.UtcNow.AddSeconds(ConnectTimeutInSec);
    Daniel Wahlqvist
    I get an error INTERNAL and trying to figure out what the problem is. At first I thought this must happen on the server but when reading here https://grpc.github.io/grpc/core/md_doc_statuscodes.html it seems this can be a client error as well? How do I figure out where this error code originated? I'm running grpc-java on the client and the server is golang (I can't debug the server though)
    12 replies
    Can I build a python web server that can hold onto at least tens of thousands of POST requests while sending the payloads to workers who return the results, and autoscaling workers based on request / worker ratio, using gRPC for Python?
    i want to sign the CLA, how do i do that exactly?
    Ivan Hristov

    Hello! The benchmarks of python pb show an immense performance boost while using the option with c++ generated code. I tried searching for docs on how to use it but found none except a thread dating back to 2010. I then tried the solution but no significant change in performance occurred. Hence I'd like to know if:

    1. the option is still relevant and viable?
    2. there is any proper guide on how to implement it?

    Thanks in advance and please forgive me if this is the wrong place to ask. I believe this could be a big boost.

    2 replies
    Is there a good way to write an interceptor (middleware) to handle auth in node.js? I've looked at the few packages I can find, and it seems like you can add auth for things like logging, but I don't see a good way to stop a call that fails authorization.
    HI, I'm building out a client which connects to a grpc-java service and was wondering when a Managed channel should be configured with an executor. I haven't been able to find much documentation about this executor or when to provide a custom one.
    1 reply
    Hi, I'm trying to call grpc endpoint running on EC2 from AWS Lambda. I'm stuck with this error while calling grpc API - rpc error: code = Unavailable desc = connection closed before server preface received
    Is it some network issue?

    Save the date for the gRPC Community Meetup! Add this event to your calendar: https://bit.ly/37DUcJy

    Performance Testing gRPC services by Mostafa Moradian

    gRPC has gained a lot of attention as well as a wide adoption since it was first released. With the release of k6 v0.29.0, a native client for gRPC communication is introduced. In this talk, I'll go through the basics of performance testing in general and load testing gRPC services in particular.

    Subhdeep Saha
    Is there any reference to how gRPC allocates memory buffer when receiving messages ?
    I want to increase MaxCallRecvMsgSize for larger payloads, what memory implication will it have ?
    9 replies
    Vitya Chyzhyk
    Hi everyone, could someone help me with GRPC default values memory allocation. What if we have a message and in the client for example we do not set some fields. So, my question is: do these fields with default values take some memory in the transport layer or they're ignored and set to the default values on the server-side?
    3 replies
    Hello guys, i am learning gRPC and would like to play around with it. Are there any publicly available gRPC endpoints? I couldn't find any googling so far :( I don't want to create my own service, but learning how to use one and test it with my own client or grpcurl.
    1 reply
    i need help accessing this variable
    its _result
    in the class ServerResponse

    Hi everyone, I'm trying to setup the grpc project building from source with python. I've successfully installed grpc but while running the tests with python tools/run_tests/run_tests.py -l python the tests are failing due to the error -

    Traceback (most recent call last):
      File "/Users/s.sushmita@zomato.com/grpc/src/python/grpcio_tests/setup.py", line 21, in <module>
        import grpc_tools.command
    ModuleNotFoundError: No module named 'grpc_tools'
    FAILED: py38.native.unit._server_shutdown_test.ServerShutdown [ret=1, pid=14880, time=0.1sec]

    Can anyone help with this?

    Thoughts on this error? Googling hasn't provided any information. We see this very infrequently, and would just like to understand if this is a true error or not, and how to resolve if possible. HTTP/2 error code: INTERNAL_ERROR, debug data: byte distribution write error Thanks in advance!
    2 replies
     io.grpc.StatusRuntimeException: INTERNAL: Connection closed after GOAWAY. HTTP/2 error code: INTERNAL_ERROR, debug data: byte distribution write error
    at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262) ~[grpc-stub-1.42.2.jar:1.42.2]
    at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243) ~[grpc-stub-1.42.2.jar:1.42.2]
    at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156) ~[grpc-stub-1.42.2.jar:1.42.2]
    at com.rachio.api.device.DeviceServiceGrpc$DeviceServiceBlockingStub.getDeviceState(DeviceServiceGrpc.java:5946) ~[proto-1.0.272.jar:1.0.272]
    at com.rachio.api.authentication.V3OpenAPIBridge.getDevice(V3OpenAPIBridge.java:270) ~[classes/:na]
    at com.rachio.api.authentication.V3OpenAPIBridge.getPerson(V3OpenAPIBridge.java:210) ~[classes/:na]
    at com.rachio.api.resource.rest.OpenAPIResource.getPerson(OpenAPIResource.java:177) ~[classes/:na]
    at sun.reflect.GeneratedMethodAccessor219.invoke(Unknown Source) ~[na:na]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_322]
    Iwan Aucamp
    Is there some libraries for processing proto files in Python?
    Jiawen Wang
    Hi everyone, I'm trying to test my gRPC service using ghz, and I found there are many error requests with error code "Unavailable desc = transport is closing". Does anyone know the reason? Thanks in advance!
    Hi, I just built the latest version of grpc using bazel. Does bazel have an "install" command similar to cmake's make install to install the resulted grpc library?
    Clint Olsen

    I'm using Python with grpc and the simple request/response borrowed from the helloworld example. This works fine, however I would like to facilitate a client notification in the event of a server shutdown.

    What's the best way to make this happen? It seems like bidirectional streaming is the best (only) way? I'm not sure if this kind of event is supported when the client initiates all the activity.

    Martin Mok
    Hi do anyone know some tools to generate openapi spec from proto?
    1 reply
    Hello, guys! We are live at the gRPC Community Meetup! Join us now: https://meet.google.com/rnf-vyyi-qtb?pli=1&authuser=4
    Scenario: Multiple clients request to a broker to send themselves large batches of file data stored in the broker.
    Multiple clients connect to a broker, then the clients send request commands (small data) to the broker, and the broker receives the command requests from these clients via poll (the broker code is socks = poll()), with socks indicating the clients that initiated the command requests. Then, the broker needs to send the requested bulk file data to these clients.
    I can think of two ways for the broker to send these large amounts of file data to the clients.
    1. the broker sends the bulk file data directly to each requesting client using the socks above.
    2. the broker creates a connect socket for each client and connects to the socket binded on each client side. Then the broker sends the bulk file data to each client through this connect socket.
      Which is the better solution? Is it more common?
    6 replies
    Michal Zalecki
    Hi! Do you know what's the state of ALTS? Is per-pod identity available for everyone or you need to be part of Early Access Program? If so, what's the beast way to reach out and request access?
    Jakob M
    Hey y'all.
    For my bachelor thesis I've done some kind of gRPC vs. REST (or at least HTTP/1.1 with JSON) performance Benchmark.
    If you are interested, you can take a look here: https://github.com/JakobMei/ba_grpc_rest
    Its a maven project with multiple modules: One Spring Boot server with the REST and gRPC-API, one proto module for code generation and one client with the Java Microbenchmarking Harness to test it.
    I guess its probably fairly naive and not 100% scientific correct but if you have any feedback, feel free ;)
    3 replies