439 questions
1
vote
0
answers
128
views
Fault Tolerant Services for GRPC on K3s Cluster
Setup: I have a five node RPI Cluster connected with K3s (Specifically a PicoCluster 5H with 5 RPI4 8GB) in high Availability mode with embedded DB, 3 master nodes, and 2 worker nodes. I have been ...
0
votes
1
answer
1k
views
Python protofub: how to pass response message from one grpc call to another
I'm new to grpc/protobuf so please excuse any terminology errors in my question.
I need to take a response from one gRPC request and feed it into the next request. I can't figure out how to populate ...
0
votes
1
answer
1k
views
How to detect gRPC server is down from gRPC AIO python client
I've been facing this issue where I have a gRPC AIO python client sending bunch of configuration changes to the gRPC server, though it's a bi-directional RPC, client is not expecting any message from ...
0
votes
1
answer
542
views
Is there a way to sort python grpc response without using jSON?
Long story short I am building a python grpc client that interacts with another team's GRPC server. Does python's grpc module have any sorting features?
response = client_stub.get_grpc_templates_stub(...
2
votes
0
answers
2k
views
AttributeError: 'NoneType' object has no attribute 'enum_types_by_name'
I am trying to run this code sample code
import streamlit as st
from PIL import Image
import pandas as pandas
from clarifai_grpc.grpc.api import service_pb2, resources_pb2
from clarifai_grpc.grpc.api....
0
votes
1
answer
841
views
How to interrupt a grpc call gracefully in the client side?
I wrote a client which starts multiple connections to a grpc server to request something. I want to stop all the other grpc call once I got a reply. I use an Event to control this process.
However, I ...
1
vote
0
answers
368
views
"Failed parsing HTTP/2" error calling grpc .net service from python
We are currently experimenting with grpc and json transcoding to enable a delphi client to make server calls. In our stack we have python 3.10 and .net services.
The json transcoding is done using ....
2
votes
1
answer
2k
views
WHat is the difference between the filename_pb2_grpc.py and the filename_pb2.py files?
From what I understand, the pb2.py file is code from the protoc file and the pb2_grpc.py file is code generated by protoc from the .proto file. But I don't understand what that means. I am very ...
4
votes
0
answers
2k
views
"grpc_message":"Stream removed","grpc_status":2
I am running a python grpc server and using envoy to connect to it through client. The envoy is deployed in GKE. I am attaching the envoy deployment yaml.
apiVersion: apps/v1
kind: Deployment
metadata:...
0
votes
1
answer
761
views
Python how to build dictionary from nested protobuf definitions
This is my first time working with grpc/protobuf tech. So far, so good I have coded grpc methods for simple (flat?) protobuf definitions. However I have run into nested protobuf declarations and have ...
0
votes
0
answers
1k
views
gRPC "Socket closed" error in python client
my python client code is:
def run():
try:
channel = grpc.insecure_channel('api-auth.uid.ir')
stub = session_api_pb2_grpc.SessionServiceStub(channel)
response = stub....
0
votes
0
answers
1k
views
Client could not find service in gRPC server
https://pastebin.com/7vqdrHyg greet.proto
https://pastebin.com/4PYDYZ6Q greet_grpc.pb.go
https://pastebin.com/2n6n8JjS greet_pb.go
https://pastebin.com/FPpCJEGR main.go
https://pastebin.com/CXuxG5fB ...
1
vote
1
answer
2k
views
Error: Unauthorized: Your client does not have permission to the requested URL while sending gRPC request to service hosted on Cloud Run
I would like to deploy my grpc service to Cloud Run and send authenticated requests to it via Python3. I have followed various Documents regarding setting establishing authentication to Google Cloud ...
0
votes
1
answer
513
views
How to send stream commit message in gRPC Python Client
I have a gRPC server on Go Lang and the client is in python. I have one RPC call in which the client initiates a progress stream and after completing the progress it sends a completion message to the ...
0
votes
0
answers
938
views
How to keep bi-directional gRPC channel open from python client
I have defined a bi-dir gRPC streaming RPC for exchanging some configuration information with the server.
Server: Implemented in C++
Client: Implemented in python 3.10
The client opens channel with ...
0
votes
1
answer
706
views
In gRPC python, the Service class and the Serve method are always in the same file, why?
In gRPC python, the Service-class and the Serve method are always in the same file, why?
for example -
the service class - link and the serve() - link
Similarly - service-class and serve()
I am new to ...
1
vote
1
answer
4k
views
'Task was destroyed but it is pending' when running multiple tasks inside one asyncio loop
Inside a microservice I am running two separate asyncio tasks; one for incoming grpc calls and one for reading a redis queue. The main looks kinda like this:
if __name__ == "__main__":
...
1
vote
1
answer
974
views
Call shared gRPC method inside same service
I have a situation where I want one gRPC method to call another gRPC method within the same service. Reason being, there are two services that rely on this one common method. What's the best way to do ...
0
votes
1
answer
355
views
gRPC Unidirectional stream too chatty
I enabled GRPC_TRACE=all and GRPC_VERBOSITY=DEBUG in my python gRPC client. My server is written in Java. The client establishes a unidirectional stream connection with server and waits for the server ...
5
votes
3
answers
2k
views
GRPC_TOOLS.PROTOC generates broken pb2 python file
I am trying to build an application using gRPC in Python. I have the following directory layout:
service/
├─ auth/
│ ├─ auth_pb2_grpc.py
│ ├─ auth_pb2.py
│ ├─ auth.py
│ ├─ client.py
├─ flask/...
1
vote
1
answer
2k
views
python proto is not generating classes?
I am trying to generate python code from a proto file, with a proto like this.
syntax="proto3";
service EmailInferencing {
rpc Infer (EmailInferRequest) returns (EmailInferResponse) {}
}
...
0
votes
1
answer
406
views
How does grpc-python maxworker work when handling request
I was wondered that how does python grpc maxworker work. If I set maxworker 10
grpc.server(futures.ThreadPoolExecutor(max_workers=int)
Does it mean if I send 15 req to the grpc server, it will only ...
0
votes
0
answers
2k
views
Can I manually specify a host for a gRPC server using Python?
I'm developing a gRPC application using Python and the basic grpc library as well as proto. In my client I can easily specify a port and host when creating a channel, but when creating a server like ...
2
votes
2
answers
8k
views
protoc-gen-gprc_python: program not found or is not executable
When I try to generate proto files using Python's grpc_tools.protoc library:
python -m grpc_tools.protoc -I protos --python_out=. --gprc_python_out=. protos/test.proto
it fails with the error
protoc-...
0
votes
1
answer
2k
views
Python grpc: AttributeError 'NoneType' object has no attribute 'unary_unary'
My first time playing around with Python and grpc. I have been troubleshooting for a while now and cant seem to get past the below issue.
I am getting the following error by running: venv/bin/python ...
0
votes
2
answers
143
views
share variable that change after import between main process and child processes
I've a project in gRPC where the main.py spawns grpc servers as subprocesses.
Also in the project I've settings.py that contains some configurations, like:
some_config = {"foo": "bar&...
0
votes
1
answer
683
views
Use KrakenD CE + python 3.xx for gRPC-backend and manipulate responses from two or more backends
I am using a KrakenD community edition to implement an aggregator pattern where an endpoint: /abc is sent to KrakenD API gateway that will call the end-points /a, /b & /c. It will then combine the ...
1
vote
1
answer
326
views
Start a grpc.aio.server within tkinter gui
Starting Async Grpc Server and wait_for_termination will blocking the tkinter mainloop and vice versa, the tkinter mainloop will not allow the running of the Async Grpc Server wait_for_termination. It ...
0
votes
1
answer
1k
views
Python grpc fail : PicklingError: Can't pickle <class 'demo_pb2.msg'>: import of module demo_pb2 failed
It is not possible to import python modules generated by protobuf. Here's the code.
error message
here is the error message after run python main.py.
# python main.py
Traceback (most recent call ...
1
vote
0
answers
2k
views
Will gRPC automatically start supporting HTTP/3 protocol or will coders/developers have to make changes?
The question is self-explanatory. I'd like to ask if the libraries for C++, Python, etc. will of gRPC will automatically use HTTP/3 once it's introduced?
0
votes
0
answers
515
views
how to create skeleton rpc error for pytest
so, I'm paching a method in pytest and I want to it to return rpc error with custom status code and message. I tried
my_error = grpc.RpcError()
my_error.code = ???
my_error.details = ???
so, there's ...
1
vote
0
answers
643
views
How to get the exact JSON structure returned in the gRPC response
This is an example illustrating the issue where I'm using Struct Class as datasets type:
import "google/protobuf/struct.proto";
message Datasets {
string meta_field = 1;
google.protobuf....
0
votes
0
answers
270
views
how Python gRPC stream server spawn two clients that connect other same gRPC server
1、proto
service RouteGuide {
rpc RouteChat(stream RouteNote) returns (stream RouteNote) {}
}
message RouteNote {
// The location from which the message is sent.
Point location = 1;
// The ...
0
votes
1
answer
315
views
MLServer GRPC cannot reshape array of size 347 into shape (1,)
I am following the example to serve sklearn model https://github.com/SeldonIO/MLServer/blob/master/docs/examples/sklearn/README.md
I am able to train and genreate the model, and then do a REST call ...
0
votes
1
answer
1k
views
How to parse a nested protobuf message, python
I created the following protobuf object:
message House {
message Room {
message Attributes {
string bed = 1;
string desk = 2;
}
}
message Kitchen {
...
0
votes
1
answer
2k
views
How to configure `MAX_CONNECTION_AGE` on Python gRPC server?
I noticed that a maintainer of gRPC suggested using MAX_CONNECTION_AGE to load balance long lived gRPC streams in their video, Using gRPC for Long-lived and Streaming RPCs - Eric Anderson, Google. I ...
2
votes
0
answers
177
views
Python external gRPC request using wrong protocal
I am writing an API for a website that involves making a request to their API. The link looks like this - https://search.api.company.com/company.content.search.v1.Search/Search.
The data looks very ...
0
votes
1
answer
1k
views
how to run grpc client in python and server in cpp?
I am trying to work with client.py , server.cpp and a make file. I am not understanding how to run the files and work on grpc with these files. Is it possible for anyone to help me understand this ...
2
votes
1
answer
6k
views
How to log request and response activity on a python gRPC server?
I went through the gRPC tutorial and got a successful response from the server.
However the server did not log anything from the command line. I was expecting to see something like request received - ...
2
votes
1
answer
3k
views
Error with stubgen and generic used by mypy-protobuf
When I use the protoc-gen-mypy plugin from mypy-protobuf with protoc to generate mypy stubs for my gRPC Greeter service, I get an error about generics.
Here is the command I used to generate the ...
0
votes
1
answer
1k
views
I want to use "." in message field name of .proto file
I defined .proto file like:
syntax = "proto3";
message networkSliceArray
{
int32 DRB.UEThpDl.SNSSAI = 1;
int32 DRB.UEThpUl.SNSSAI = 2;
string networkSliceIdentifier = 3;
}
I want ...
0
votes
1
answer
2k
views
My gRPC client could not connect to my Containerised gRPC Server hosted on the same machine
I am implementing a gRPC client and server application where my gRPC server is containerised. The idea is to use Unix domain sockets to communicate between the client and the server. My application ...
17
votes
2
answers
11k
views
Apple M1 - Symbol not found: _CFRelease while running Python app
I wanna run my app without any problem, but I got this attached error. Could someone help or point me in the right direction regarding why this is happening?
Traceback (most recent call last):
File &...
0
votes
1
answer
195
views
how we can parse proto file if it having "." and "-" sign
I create one proto file using java and another using python when I put "." and "-" sign in proto file message field name it shows error that is "missing field number". I ...
9
votes
2
answers
5k
views
can protocol buffer be used without gRPC?
Hello everyone I am getting my hands dirty with gRPC and protocol buffers and have came across an article which has mentioned that the binary protobuf file for a message is 5 times smaller than Json ...
3
votes
3
answers
2k
views
gRPC/protobuf generated Python files use incorrect import statements
I have a grpc repo included in a python project repo as a submodule at src/grpc/protobuf with the following example structure:
protobuf/
|
|-data_structs/
| |-example_structA.proto
| |-...
0
votes
2
answers
1k
views
gRPC streaming in the separate process get stuck
I'm trying to create a client for testing my grpc server. In my grpc server I have a rpc NotificationStreaming() which streams a notification (unary-stream). Also I have bunch of synchronous rpc ...
9
votes
4
answers
28k
views
How to open a secure channel in python gRPC client without a client SSL certificate
I have a grpc server (in Go) that has a valid TLS certificate and does not require client side TLS. For some reason I can not implement the client without mTLS in Python, even though I can do so in ...
3
votes
1
answer
4k
views
How to stop listening on a stream in python gRPC client
I am listening in a python thread on a gRPC stream that never ends:
responses = some_grpc_stub.FunctionThatReturnsStream()
for response in responses:
on_event(response)
I want to do this for a ...
1
vote
1
answer
2k
views
What is the last grpcio version to support Python 2.7?
The company I'm working for is still in the process of going over from Python 2.7 to Python 3, so I'm stuck with Python 2.7 even though it is officially already end of life.
For a project I'm looking ...