Skip to content

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

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

Closed
VamsiKrishna1211 opened this issue Apr 30, 2024 · 2 comments · Fixed by #2484 · May be fixed by VamsiKrishna1211/opentelemetry-python-contrib#1
Closed

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

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

Comments

@VamsiKrishna1211
Copy link
Contributor

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

@ArpanSriv
Copy link

Facing the exact same issue.

tsmith023 added a commit to weaviate/weaviate-python-client that referenced this issue Jun 26, 2024
helperbot-recidiviz pushed a commit to Recidiviz/pulse-data that referenced this issue Jan 17, 2025
## Description of the change

A recent Pipfile lock update Recidiviz/recidiviz-data#36129 introduced upstream bug
open-telemetry/opentelemetry-python-contrib#2483
into our image. As a result it needed to be reverted. The bug has been
fixed upstream, so if we unpin OpenTelemetry, we can re-lock our
Pipfile.

OpenTelemetry is currently pinned due to a cost increase seen in
open-telemetry/opentelemetry-pythonRecidiviz/recidiviz-data#3959.

When we investigated earlier this year, it seemed that the main increase
in cost was the `http.client.duration` metric, which we don't
necessarily need.

This ticket tracks the following tasks:
- [ ] Unpin OpenTelemetry to unblock the Pipfile lock update
- [ ] Monitor increased metric costs
- [ ] Drop any unused metrics that are deemed too expensive
- [ ] Try changing preferred temporality of Histogram metrics as
mentioned in open-telemetry/opentelemetry-pythonRecidiviz/recidiviz-data#3959

The Pipfile update introduced a bunch of new MyPy errors, so those are
fixed in this PR.

## Type of change

> All pull requests must have at least one of the following labels
applied (otherwise the PR will fail):

| Label | Description |
|-----------------------------
|-----------------------------------------------------------------------------------------------------------
|
| Type: Bug | non-breaking change that fixes an issue |
| Type: Feature | non-breaking change that adds functionality |
| Type: Breaking Change | fix or feature that would cause existing
functionality to not work as expected |
| Type: Non-breaking refactor | change addresses some tech debt item or
prepares for a later change, but does not change functionality |
| Type: Configuration Change | adjusts configuration to achieve some end
related to functionality, development, performance, or security |
| Type: Dependency Upgrade | upgrades a project dependency - these
changes are not included in release notes |

## Related issues

Recidiviz/recidiviz-data#36750

## Checklists

### Development

**This box MUST be checked by the submitter prior to merging**:
- [x] **Double- and triple-checked that there is no Personally
Identifiable Information (PII) being mistakenly added in this pull
request**

These boxes should be checked by the submitter prior to merging:
- [ ] Tests have been written to cover the code changed/added as part of
this pull request

### Code review

These boxes should be checked by reviewers prior to merging:

- [x] This pull request has a descriptive title and information useful
to a reviewer
- [x] Potential security implications or infrastructural changes have
been considered, if relevant

---------

Co-authored-by: Helper Bot <[email protected]>
GitOrigin-RevId: 34d1c626b78f26ed9a5c6325d6d4eb2450887d76
helperbot-recidiviz pushed a commit to Recidiviz/pulse-data that referenced this issue Feb 28, 2025
## Description of the change

A recent Pipfile lock update Recidiviz/recidiviz-data#36129 introduced upstream bug
open-telemetry/opentelemetry-python-contrib#2483
into our image. As a result it needed to be reverted. The bug has been
fixed upstream, so if we unpin OpenTelemetry, we can re-lock our
Pipfile.

OpenTelemetry is currently pinned due to a cost increase seen in
open-telemetry/opentelemetry-pythonRecidiviz/recidiviz-data#3959.

When we investigated earlier this year, it seemed that the main increase
in cost was the `http.client.duration` metric, which we don't
necessarily need.

This ticket tracks the following tasks:
- [ ] Unpin OpenTelemetry to unblock the Pipfile lock update
- [ ] Monitor increased metric costs
- [ ] Drop any unused metrics that are deemed too expensive
- [ ] Try changing preferred temporality of Histogram metrics as
mentioned in open-telemetry/opentelemetry-pythonRecidiviz/recidiviz-data#3959

The Pipfile update introduced a bunch of new MyPy errors, so those are
fixed in this PR.

## Type of change

> All pull requests must have at least one of the following labels
applied (otherwise the PR will fail):

| Label | Description |
|-----------------------------
|-----------------------------------------------------------------------------------------------------------
|
| Type: Bug | non-breaking change that fixes an issue |
| Type: Feature | non-breaking change that adds functionality |
| Type: Breaking Change | fix or feature that would cause existing
functionality to not work as expected |
| Type: Non-breaking refactor | change addresses some tech debt item or
prepares for a later change, but does not change functionality |
| Type: Configuration Change | adjusts configuration to achieve some end
related to functionality, development, performance, or security |
| Type: Dependency Upgrade | upgrades a project dependency - these
changes are not included in release notes |

## Related issues

Recidiviz/recidiviz-data#36750

## Checklists

### Development

**This box MUST be checked by the submitter prior to merging**:
- [x] **Double- and triple-checked that there is no Personally
Identifiable Information (PII) being mistakenly added in this pull
request**

These boxes should be checked by the submitter prior to merging:
- [ ] Tests have been written to cover the code changed/added as part of
this pull request

### Code review

These boxes should be checked by reviewers prior to merging:

- [x] This pull request has a descriptive title and information useful
to a reviewer
- [x] Potential security implications or infrastructural changes have
been considered, if relevant

---------

Co-authored-by: Helper Bot <[email protected]>
GitOrigin-RevId: 34d1c626b78f26ed9a5c6325d6d4eb2450887d76
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
3 participants