grpcurl | Like cURL , but for gRPC : Command-line tool
kandi X-RAY | grpcurl Summary
kandi X-RAY | grpcurl Summary
grpcurl is a command-line tool that lets you interact with gRPC servers. It's basically curl for gRPC servers. The main purpose for this tool is to invoke RPC methods on a gRPC server from the command-line. gRPC servers use a binary encoding on the wire (protocol buffers, or "protobufs" for short). So they are basically impossible to interact with using regular curl (and older versions of curl that do not support HTTP/2 are of course non-starters). This program accepts messages using JSON encoding, which is much more friendly for both humans and scripts. With this tool you can also browse the schema for gRPC services, either by querying a server that supports server reflection, by reading proto source files, or by loading in compiled "protoset" files (files that contain encoded file descriptor protos). In fact, the way the tool transforms JSON request data into a binary encoded protobuf is using that very same schema. So, if the server you interact with does not support reflection, you will either need the proto source files that define the service or need protoset files that grpcurl can use. This repo also provides a library package, github.com/fullstorydev/grpcurl, that has functions for simplifying the construction of other command-line tools that dynamically invoke gRPC endpoints. This code is a great example of how to use the various packages of the protoreflect library, and shows off what they can do. See also the grpcurl talk at GopherCon 2018.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of grpcurl
grpcurl Key Features
grpcurl Examples and Code Snippets
Community Discussions
Trending Discussions on grpcurl
QUESTION
EDIT
It seems that my first error I describe is very easy to reproduce. Actually, Google Run fails to run any GRPC query on a .NET5 GRPC server it seems (at least, it did work before but as of today, February 21st, it seems that something changed). To reproduce:
- Create a .NET5 GRPC server (also fails with .NET6):
ANSWER
Answered 2022-Feb-24 at 08:44It is an actual bug from Envoy and Google Cloud Run. There is a quick fix if you're using .NET6, otherwise it's a bit more hacky. I will just copy here the answer provided by Amanda Tarafa Mas from Google Cloud Platform on the github issue I opened:
Here are the potential fixes:
- When using .NET 6 you can set KestrelServerOptions.AllowAlternateSchemes to true.
- If on a lower .NET version, consider something like GRPC :scheme pseudo-header passed from proxy/loadbalancer causes ConnectionAbortedException dotnet/aspnetcore#30532 (comment). Or consider upgrading to .NET 6.
What's happening:
- Cloud Run has dependency on Envoy, which has a behavior change since 04/15/2021, see "preserve_downstream_scheme" in release notes: https://www.envoyproxy.io/docs/envoy/latest/version_history/v1.18.0 Envoy recently removed the old behaviour: https://www.envoyproxy.io/docs/envoy/latest/version_history/current#removed-config-or-runtime
- In turn, this exposes this .NET issue: GRPC :scheme pseudo-header passed from proxy/loadbalancer causes ConnectionAbortedException dotnet/aspnetcore#30532, for which the Kestrel configuration flag was added, but only for .NET 6. I'm looking into having this documented somewhere. @meteatamel can you update the tutorial so that it uses the Kestrel option?
For me setting KestrelServerOptions.AllowAlternate
was enough to make my GRPC server work again.
As @Craig said, you can track the issue here and see if it gets resolved.
QUESTION
I'm trying to generate Go file from proto file but it doesn't have json definition in the method's input definition. Should I add the json definition by myself or there were something wrong with my script. Thank you, I sincerely appreciate your help.
Proto file
...ANSWER
Answered 2021-Dec-19 at 16:44Since the error is
error getting request data: message type RateRequest has no known field named base
And the json
is
QUESTION
I am getting "HTTP/2 client preface string missing or corrupt."
My thoughts are that it has to do with the headers not being set correctly. It is likely the implementation of WifiClient/WifiSecureClient. I've been thinking about this for over several weeks and I'm stuck. Any advice?
[Updated: Answer below]
The client was generated using the nanopb protocol buffer compiler:
...ANSWER
Answered 2021-Dec-11 at 06:37WiFiClient client;
if (!client.connect(addr, port)) {
QUESTION
- macOS Big Sur
- Python 3.9.5
- main dependencies
ANSWER
Answered 2021-Oct-12 at 10:01According to this GitHub anwser
It is likely a macOS-specific threading issue
On the other hand, according to tkinter's doc. The library may have special event handling logic and threading restrictions, and gRPC Python uses a thread pool to handle incoming requests with gRPC Core handling the IO.
By digging into that doc, we find
A Python interpreter may have many threads associated with it. In Tcl, multiple threads can be created, but each thread has a separate Tcl interpreter instance associated with it. Threads can also create more than one interpreter instance, though each interpreter instance can be used only by the one thread that created it.
Each Tk object created by tkinter contains a Tcl interpreter. It also keeps track of which thread created that interpreter. Calls to tkinter can be made from any Python thread. Internally, if a call comes from a thread other than the one that created the Tk object, an event is posted to the interpreter’s event queue, and when executed, the result is returned to the calling Python thread.
Although I'm not an expert on platform-specific threading models, I do know that macOS is using a "Grand Central Dispatch" task-queue system that hides away a lot of thread-pool details, which is different from Windows.
Thus, without digging into gRPC's thread-pool model, I can't say it's safe to call Tkinter widgets, who keep track of thread that create them, from the volatile gRPC's I/O threads.
QUESTION
I am adding liveness probe and readiness probe using Exec probe.
My config looks like this:
ANSWER
Answered 2021-May-09 at 23:04You need to actually use a shell, since that's a shell feature. sh -c "foo | bar"
or whatever. Also remember that all the relevant commands need to be available in the target image.
QUESTION
I am facing a problem with GRPC and a python client.
Here is what I have:
...ANSWER
Answered 2021-Apr-21 at 17:47You may want to post other parts of the trace log. To debug this issue, we need to:
- Check if the name resolution worked, there should be a log saying the given address has been resolved into ip:port;
- See why each address won't work, like the ip:port is not reachable.
If the problem still can't be solved, I would recommend to post issues to https://github.com/grpc/grpc/issues.
QUESTION
I'm trying to communicate via grpc between two microservices internally on kubernetes, but I'm getting a connection refused error.
These are the yaml files of the services that are trying to communicate.
...ANSWER
Answered 2021-Apr-02 at 16:04QUARKUS_GRPC_SERVER_HOST should be 0.0.0.0 instead of localhost
QUESTION
I have a server-side streaming RPC hosted on Google Cloud Run.
With the following proto definition:
...ANSWER
Answered 2021-Mar-29 at 22:15I needed to enable HTTP/2 Connections in Cloud Run for this to work.
QUESTION
Following this example:
gRPC in Google Cloud Run
https://github.com/grpc-ecosystem/grpc-cloud-run-example/blob/master/golang/README.md
I've deployed a gRPC service with reflection on CloudRun.
Using grpcurl for testing: https://github.com/fullstorydev/grpcurl
...ANSWER
Answered 2021-Mar-07 at 21:49gRPC Reflection requires bidirectional streaming, so make sure to check the Enable HTTP/2 option (--use-http2) while deploying. That will enable bi-di streaming.
Also make sure to use the :443 port and authenticate to the server if needed by adding Authentication metadata (see Service-to-Service authentication documentation).
QUESTION
I have been trying to upload an image in chunks with client side streaming using grpcurl. The service is working without error except that at the server, image data received is 0 bytes.
The command I am using is:
grpcurl -proto image_service.proto -v -d @ -plaintext localhost:3010 imageservice.ImageService.UploadImage < out
This link mentions that the chunk data should be base64 encode and so the contents of my out file are:
...ANSWER
Answered 2021-Feb-03 at 22:05Interesting question. I've not tried streaming messages with (the excellent) grpcurl
.
The documentation does not explain how to do this but this issue shows how to stream using stdin.
I recommend you try it that way first to ensure that works for you.
If it does, then bundling various messages into a file (out
) should also work.
Your follow-on questions suggest you're doing this incorrectly.
chunk_data
is the result of having split the file into chunks; i.e. each of these base64-encoded strings should be a subset of your overall image file (i.e. a chunk).your first message should be
{ "info": "...." }
, subsequent messages will be{ "chunk_data": "" }
until EOF.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install grpcurl
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page