Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with the latest grpc version (v1.63.0) #2483

Open
VamsiKrishna1211 opened this issue Apr 30, 2024 · 1 comment · May be fixed by #2484 or VamsiKrishna1211/opentelemetry-python-contrib#1
Open
Labels
bug Something isn't working

Comments

@VamsiKrishna1211
Copy link

VamsiKrishna1211 commented Apr 30, 2024

Describe your environment
When using the Otel grpc auto instrumentation, because of the implementation here in the opentelemetry-python-contrib the following error is thrown in the generated file <proto_package>_pb2_grpc.py file

TypeError: unary_unary() got an unexpected keyword argument '_registered_method'

Steps to reproduce
Install the latest (v1.63.0) grpc python version, generate the files. use them in a grpc client

What is the expected behavior?
There should be no error.

What is the actual behavior?
An error is thrown.

Additional context
Package versions used

opentelemetry-instrumentation-grpc=0.44b0
grpcio=1.63.0
@aminarefzadeh
Copy link

Describe your environment
We have the same problem with Otel grpc instrument. we get the following error:

Traceback (most recent call last):
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 277, in __call__
    response, ignored_call = self._with_call(
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 332, in _with_call
    return call.result(), call
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 171, in result
    raise self._exception
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 315, in continuation
    response, call = self._thunk(new_method).with_call(
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 343, in with_call
    return self._with_call(
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 332, in _with_call
    return call.result(), call
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 171, in result
    raise self._exception
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 315, in continuation
    response, call = self._thunk(new_method).with_call(
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 343, in with_call
    return self._with_call(
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 332, in _with_call
    return call.result(), call
  File "./test/venv/lib/python3.10/site-packages/rpc_lib/grpc/interceptors/custom_future_call.py", line 39, in result
    return self._result_fut_call.result(timeout)
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 171, in result
    raise self._exception
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 315, in continuation
    response, call = self._thunk(new_method).with_call(
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 343, in with_call
    return self._with_call(
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 332, in _with_call
    return call.result(), call
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 171, in result
    raise self._exception
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 315, in continuation
    response, call = self._thunk(new_method).with_call(
  File "./test/venv/lib/python3.10/site-packages/grpc/_interceptor.py", line 696, in <lambda>
    thunk = lambda m: self._channel.unary_unary(
TypeError: _InterceptorChannel.unary_unary() takes from 2 to 4 positional arguments but 5 were given

Steps to reproduce
This happens in Python 3.10.13 with grpcio==v1.63.0 and opentelemetry-instrumentation-grpc==0.45b0. when trying to invoke a RPC while Otel GRPC instrument is on.

What is the expected behavior?
There should be no error.

What is the actual behavior?
An error is thrown.

Additional context
Installing grpcio<=1.62.2 fixes this problem. the error is happening in this line. It seems like in the latest version of grpcio a new argument is being passed to unary_unary method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants