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

opencensus-ext-azure doesn't support protobuf > 3.20 #1171

Open
urucoder opened this issue Oct 28, 2022 · 1 comment · May be fixed by #1178
Open

opencensus-ext-azure doesn't support protobuf > 3.20 #1171

urucoder opened this issue Oct 28, 2022 · 1 comment · May be fixed by #1178
Labels

Comments

@urucoder
Copy link

Describe your environment.

Python: 3.9.x
Packages:
opencensus==0.11.0
opencensus-context==0.1.3
opencensus-ext-azure==1.1.7
protobuf==4.21.9

Steps to reproduce.
Create an environment with the packages defined above and try the following import
from opencensus.ext.azure.trace_exporter import AzureExporter

What is the expected behavior?
AzureExporter is imported successfully

What is the actual behavior?
It crashes with the following error

Exception has occurred: TypeError (note: full exception trace is shown but execution is paused at: _run_module_as_main)
Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
@urucoder urucoder added the bug label Oct 28, 2022
basnijholt added a commit to basnijholt/opencensus-python that referenced this issue Jan 6, 2023
@basnijholt basnijholt linked a pull request Jan 6, 2023 that will close this issue
@lzchen
Copy link
Contributor

lzchen commented Jan 9, 2023

This does not seem an issue with the opencensus-ext-azure package specifically. The opencensus package has a dependency on google-api-core, which in turn takes a dependency on a version of protobuf. I've tested the versions of protobuf and it looks like protobuf v4.x will break opencensus. We should probably pin protobuf in opencensus instead. @aabmass thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants