Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Eric Anderson
    @legopiraat, that error should not be impacted by what the remote does. If you are seeing it on the server, then the server is calling onCompleted before onNext. I'd make sure you don't accidentally re-use a StreamObserver from a previous call and similar bugs.
    Làm sao để nó chạy được trên điện thoại của mình chỉ mình với cảm ơn admin
    Yuriy Panarin
    If some one need generate proto in github action
    Marcello de Sales
    or configured with
    that's a great start
    Edgar Romero

    Hi, I am have encountered issues on Android and iOS clients after proxying gRPC via HAProxy. From the clients we get UNKOWN status coming from Http2ClientStreamTransportState exceptions. The logs show

    1. "missing GRPC status in response”
    2. "UNKNOWN: HTTP status code 200 missing GRPC status, inferred error from HTTP status code”
    3. UNKNOWN: HTTP status code 200 invalid content-type: null …

    For #3 we sometimes get headers and sometimes trailers logged. In both cases the data is clearly corrupted.
    I get multiple entries for keys like “grpc-encoding”, “commerce-details-bin” with values that belong to other keys. furthermore I have values that are base64 encoded that are encoding “<life-feed><tab-delimiter>{status_code} {error_description}<line-terminator>{request-id}”
    Most worrying is that in a single log I have multiple request-ids from other requests.

    Edgar Romero

    This started happening 8 hours after we started proxying routing some of the traffic to another backend. The backend has been used internally for weeks without issue. The traffic has been flowing through HAProxy at layer 7 for months without issue.

    Originally the issue pointed to HAProxy but I don’t know how a proxy could possibly get 3 metadata values into a base64 value. That would be encoded only in the server.

    Eric Anderson
    @alfasapy, that's bizarre. Since it impacts both Android and iOS, that means the client is very likely fine...
    Are you using something like grpc-gateway or grpc-web that does translation?
    Edgar Romero
    no gateway
    and correct, it rules out the clients. I am trying to figure out if I can rule out HAProxy which is proxying at Layer7 or the gRPC server
    Eric Anderson
    That feels like HPACK-related bugs... But I would have expected such a bug to not appear "randomly."
    Edgar Romero
    The fact that the gRPC server did not affect the internal client makes me want to rule out the server. But the way that those trailers are corrupted makes me think it has to be the server. How could I have a binary value (base64 encoded) that has 3 ASCII trailer values. The encoding is in the server right?
    Eric Anderson
    @alfasapy, HPACK has a table where it can reference previous headers to repeat them in the current header. It's for compression.
    Edgar Romero
    oh, I remember reading that now. You are right, that does sound like the it is related.
    Eric Anderson
    That said, this seems pretty broken. For an HPACK implementation to be that broken, I'm not sure how it wouldn't have been noticed earlier.
    I'm going off to a meeting.
    Jennifer Cwagenberg

    Hi All, I’m looking for a good example of using AsyncAuthInterceptor in c#
    i’m testing locally on a grpc server that doesn’t have ssl setup currently, and i can see that my asyncauthinterceptor never gets called, thus my authorization token is never applied to my header

    var asyncAuthInterceptor = new AsyncAuthInterceptor(async (context, metadata) =>
    await Task.Delay(100).ConfigureAwait(false); // make sure the operation is asynchronous.
    metadata.Add("authorization", "SECRET_TOKEN");

    _callCredentials = CallCredentials.FromInterceptor(asyncAuthInterceptor);
    _channel = new Channel(grpcServerURL, ChannelCredentials.Insecure);
    _client = new Publisher.PublisherClient(_channel);

    private void Publish(PublishRequest request)
    var callOptions = new CallOptions(credentials: _callCredentials);
    var response = _client.Publish(request, callOptions);

    Console.WriteLine($"Response: {response}");

    Edgar Romero
    @ejona86 thank you for your help yesterday. The mangling of the trailers seems to be caused by haproxy.
    Yuriy Panarin
    @marcellodesales it was both options for gitlab and github
    Marcello de Sales
    ohh thank you @PxyUp
    I'm building CLIs and I need to get Evans REPL output in a CLI... is it possible to call Evans with params to display current package, show services, etc?
    for instance, I'd like to show all services, messages from a given proto file users.v1.Users@> show service +---------+----------+--------------+------------------+ | SERVICE | RPC | REQUEST TYPE | RESPONSE TYPE | +---------+----------+--------------+------------------+ | Users | Register | NewUser | RegisterResponse | +---------+----------+--------------+------------------+
    Aditya Prerepa

    Hello, new contributor here. I decided the best way to start contributing is to write unit tests here and there. This is on grpc-java. When I try to run unit tests however, I get the following error.

    /home/aditya/grpc-java/context/src/main/java/io/grpc/Context.java:511: error: An unhandled exception was thrown by the Error Prone static analysis plugin.

    Not sure why, anyone know?

    Gautham Bhat K
    Hi All, I have an use case where a client connects to multiple servers, how can I achieve this? Is it possible to use single channel for multiple server connections ? Can someone please help. I am using C++.
    Armand Smit (Agilit-e)
    Good day everyone, I'm new here and new to gRPC for NodeJS. I will be looking for a lot of help and advice in the near future. :D
    Marc Allen
    Hi, I am working with gRPC in C# and using Grpc.Core.Server to launch a Service in Windows. The gRPC server launches async and runs in the background. I have a sleep loop to let the service run. How would I check that the gRPC server is running without problems.
    Marc Allen
    @maa1dz Am using the following: Channel channel;
    channel = new Channel("", ChannelCredentials.Insecure);
    var state = channel.State;
    Eric Anderson
    @adiprerepa, huh. That's weird. What version of the JDK are you using? I think we commonly run with JDK 8 and 11. Might you be using 12?
    @maa1dz, what do you mean by "without problems"?
    Herb Stahl
    has anyone gotten ChannelCredentials.Insecure to work with "Grpc.Net.Client" Version="0.2.23-pre2" I can make calls when its https://localhost:55001, but no go with http
    Ryan Richard
    Anyone have experience with grpc-web (commonjs client), grpc-go (server), envoy proxy and server side streaming? I'm getting en error in the client after some time following the first streamed message that hasn't been very googlable
    specifically, the error in the client console is net::ERR_INCOMPLETE_CHUNKED_ENCODING
    and this setting is already present; https://github.com/grpc/grpc-web/pull/311/commits
    Danny Shemesh
    Hey everyone, I was wondering if anyone here had the chance to incorporate grpc with an API management / gateway solution that handles cross cutting concerns (mainly, TLS termination, metrics / tracing, OIDC auth, ...) ? I'm having a hard time finding a (cloud) solution that support grpc out of the box and I'm wondering if there are any best practices that I could employ and I'm missing
    Ryan Richard
    @dany74q Google cloud Endpoints works with grpc (https://cloud.google.com/endpoints/docs/grpc/about-grpc) and I'd expect envoy proxy to handle some of those requirements. Apigee also supports grpc via Istio (https://docs.apigee.com/api-platform/istio-adapter/concepts) but that's probably a heavy lift. Just some thoughts
    Danny Shemesh
    Thanks @doublerr !
    Matt Mitchell
    Curious if anyone knows of examples or even libraries that help with building long-lived bi-directional streaming services/clients?
    Jigar Joshi

    I am working to build a middleware that has following capabilities

    • intercepts all unary calls
    • has ability to read the full request message
    • has ability to generate response from interceptor and short circuit the response (skips the rest of the interceptors and service execution)

    Any example pointers on how to implement 2 & 3, will be helpful.

    This is for Java
    Atılhan Emre Dursunoğlu

    Hello, I have implemented grpc.lb.v1.load_balancer.proto, however my client can't connect it.
    To test load balancer, I am using a simple python client:

    def create_channel(conn): 
        opts = [("grpc.lb_policy_name", "grpclb"), ("grpc.dns_enable_srv_queries", True)]  
        channel = grpc.insecure_channel(conn, opts)  
        return testservice_grpc.testStub(channel) 
    t = create_channel("ns.ourdomain.com")

    However I am getting this error:

    _Rendezvous: <_Rendezvous of RPC that terminated with:
        status = StatusCode.UNAVAILABLE
        details = "connections to all backends failing"
        debug_error_string = "{"created":"@1569236325.444837337","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3818,"referenced_errors":[{"created":"@1569236325.444770342","description":"connections to all backends failing","file":"src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc","file_line":328,"grpc_status":14}]}"

    As you can see from error, it is trying to use round robin even though our srv record's service name is grpclb. Our srv record for load balancer is below:

    $ dig srv _grpclb._tcp.ourdomain.com
    ; <<>> DiG 9.14.6 <<>> srv _grpclb._tcp.ourdomain.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50996
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 3
    ; EDNS: version: 0, flags:; udp: 4096
    ; COOKIE: xxxxxx (good)
    ;_grpclb._tcp.ourdomain.com. IN    SRV
    _grpclb._tcp.ourdomain.com. 60 IN SRV    0 0 5667 lb.ati.com.

    lb.ati.com points to a local ip address in my hosts file.

    Jigar Joshi
    @ejona86 https://stackoverflow.com/a/47872505/3833308 similar to this how can I generate response from server interceptor and return it from there (without going further deep in interceptor chain and service execution)
    Or if there is a way to implement a global service that handles all the requests
    Jigar Joshi
    alternate is to go for HTTP 2 server and bind a servlet at / and handle the POSTs (by re-doing lots of gRPC server for UNARY)
    Eric Anderson

    @JigarJoshi, you can just call serverCall.sendMessage(). I think there are some caching interceptors floating around. This is client-side, and complicated, but still may be helpful. https://github.com/grpc/grpc-java/blob/master/examples/android/clientcache/app/src/main/java/io/grpc/clientcacheexample/SafeMethodCachingInterceptor.java

    You can implement a global service via HandlerRegistry and pass it to serverBuilder.fallbackHandlerRegistry()

    Jigar Joshi
    Thanks @ejona86
    hello, how can i get a request.socket_id with python grpcio?