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

[BUG] Phoenix throwing protobuf error upon import #2695

Closed
brycecf opened this issue Mar 26, 2024 · 17 comments · Fixed by #2948
Closed

[BUG] Phoenix throwing protobuf error upon import #2695

brycecf opened this issue Mar 26, 2024 · 17 comments · Fixed by #2948
Assignees
Labels
bug Something isn't working

Comments

@brycecf
Copy link

brycecf commented Mar 26, 2024

Describe the bug
Running the one-click Arise Phoenix integration with LlamaIndex results in the following protobuf error:

TypeError: Descriptors cannot 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).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

To Reproduce
Steps to reproduce the behavior:

  1. import phoenix as px
  2. See error

Expected behavior
Import should be successful.

Environment (please complete the following information):

  • OS: Sonoma 14.3.1
  • Notebook Runtime: jupyterlab=4.1.5
  • Browser: Safari 17.3.1
  • Version: arize-phoenix=3.17.1, llama-index-core=0.10.22, llama-index-callbacks-arize-phoenix=0.1.4, openinference-instrumentation-llama-index=1.2.1

Additional context

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[3], line 7
----> 1 import phoenix as px
     2set_global_handler("arize_phoenix")

File [~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/phoenix/__init__.py:11](http://localhost:8888/~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/phoenix/__init__.py#line=10)
      9 from .datasets.schema import EmbeddingColumnNames, RetrievalEmbeddingColumnNames, Schema
     10 from .session.client import Client
---> 11 from .session.evaluation import log_evaluations
     12 from .session.session import NotebookEnvironment, Session, active_session, close_app, launch_app
     13 from .trace.fixtures import load_example_traces

File [~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/phoenix/session/evaluation.py:29](http://localhost:8888/~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/phoenix/session/evaluation.py#line=28)
     27 from phoenix.session.client import Client
     28 from phoenix.trace.dsl.helpers import get_qa_with_reference, get_retrieved_documents
---> 29 from phoenix.trace.exporter import HttpExporter
     30 from phoenix.trace.span_evaluations import Evaluations
     32 __all__ = [
     33     "get_retrieved_documents",
     34     "get_qa_with_reference",
     35     "add_evaluations",
     36 ]

File [~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/phoenix/trace/exporter.py:11](http://localhost:8888/~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/phoenix/trace/exporter.py#line=10)
      8 from urllib.parse import urljoin
     10 import requests
---> 11 from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
     12 from requests import Session
     13 from typing_extensions import TypeAlias, assert_never

File [~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py:40](http://localhost:8888/~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py#line=39)
     38 from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
     39 from opentelemetry.exporter.otlp.proto.http import Compression
---> 40 from opentelemetry.exporter.otlp.proto.http.trace_exporter.encoder import (
     41     _ProtobufEncoder,
     42 )
     43 from opentelemetry.util.re import parse_headers
     46 _logger = logging.getLogger(__name__)

File [~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/opentelemetry/exporter/otlp/proto/http/trace_exporter/encoder/__init__.py:19](http://localhost:8888/~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/opentelemetry/exporter/otlp/proto/http/trace_exporter/encoder/__init__.py#line=18)
     16 from collections import abc
     17 from typing import Any, List, Optional, Sequence
---> 19 from opentelemetry.proto.collector.trace.v1.trace_service_pb2 import (
     20     ExportTraceServiceRequest as PB2ExportTraceServiceRequest,
     21 )
     22 from opentelemetry.proto.common.v1.common_pb2 import AnyValue as PB2AnyValue
     23 from opentelemetry.proto.common.v1.common_pb2 import (
     24     ArrayValue as PB2ArrayValue,
     25 )

File [~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py:14](http://localhost:8888/~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py#line=13)
      9 # @@protoc_insertion_point(imports)
     11 _sym_db = _symbol_database.Default()
---> 14 from opentelemetry.proto.trace.v1 import trace_pb2 as opentelemetry_dot_proto_dot_trace_dot_v1_dot_trace__pb2
     17 DESCRIPTOR = _descriptor.FileDescriptor(
     18   name='opentelemetry[/proto/collector/trace/v1/trace_service.proto](http://localhost:8888/proto/collector/trace/v1/trace_service.proto)',
     19   package='opentelemetry.proto.collector.trace.v1',
   (...)
     24   ,
     25   dependencies=[opentelemetry_dot_proto_dot_trace_dot_v1_dot_trace__pb2.DESCRIPTOR,])
     30 _EXPORTTRACESERVICEREQUEST = _descriptor.Descriptor(
     31   name='ExportTraceServiceRequest',
     32   full_name='opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest',
   (...)
     58   serialized_end=240,
     59 )

File [~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/opentelemetry/proto/trace/v1/trace_pb2.py:14](http://localhost:8888/~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/opentelemetry/proto/trace/v1/trace_pb2.py#line=13)
      9 # @@protoc_insertion_point(imports)
     11 _sym_db = _symbol_database.Default()
---> 14 from opentelemetry.proto.common.v1 import common_pb2 as opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2
     15 from opentelemetry.proto.resource.v1 import resource_pb2 as opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2
     18 DESCRIPTOR = _descriptor.FileDescriptor(
     19   name='opentelemetry[/proto/trace/v1/trace.proto](http://localhost:8888/proto/trace/v1/trace.proto)',
     20   package='opentelemetry.proto.trace.v1',
   (...)
     25   ,
     26   dependencies=[opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2.DESCRIPTOR,opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2.DESCRIPTOR,])

File [~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/opentelemetry/proto/common/v1/common_pb2.py:36](http://localhost:8888/~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/opentelemetry/proto/common/v1/common_pb2.py#line=35)
     11 _sym_db = _symbol_database.Default()
     16 DESCRIPTOR = _descriptor.FileDescriptor(
     17   name='opentelemetry[/proto/common/v1/common.proto](http://localhost:8888/proto/common/v1/common.proto)',
     18   package='opentelemetry.proto.common.v1',
   (...)
     22   serialized_pb=b'\n*opentelemetry[/proto/common/v1/common.proto](http://localhost:8888/proto/common/v1/common.proto)\x12\x1dopentelemetry.proto.common.v1\"\x8c\x02\n\x08\x41nyValue\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x14\n\nbool_value\x18\x02 \x01(\x08H\x00\x12\x13\n\tint_value\x18\x03 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x04 \x01(\x01H\x00\x12@\n\x0b\x61rray_value\x18\x05 \x01(\x0b\x32).opentelemetry.proto.common.v1.ArrayValueH\x00\x12\x43\n\x0ckvlist_value\x18\x06 \x01(\x0b\x32+.opentelemetry.proto.common.v1.KeyValueListH\x00\x12\x15\n\x0b\x62ytes_value\x18\x07 \x01(\x0cH\x00\x42\x07\n\x05value\"E\n\nArrayValue\x12\x37\n\x06values\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.AnyValue\"G\n\x0cKeyValueList\x12\x37\n\x06values\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\"O\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.opentelemetry.proto.common.v1.AnyValue\";\n\x16InstrumentationLibrary\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t:\x02\x18\x01\"5\n\x14InstrumentationScope\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\tB[\n io.opentelemetry.proto.common.v1B\x0b\x43ommonProtoP\x01Z(go.opentelemetry.io[/proto/otlp/common/v1b](http://localhost:8888/proto/otlp/common/v1b)\x06proto3'
     23 )
     28 _ANYVALUE = _descriptor.Descriptor(
     29   name='AnyValue',
     30   full_name='opentelemetry.proto.common.v1.AnyValue',
     31   filename=None,
     32   file=DESCRIPTOR,
     33   containing_type=None,
     34   create_key=_descriptor._internal_create_key,
     35   fields=[
---> 36     _descriptor.FieldDescriptor(
     37       name='string_value', full_name='opentelemetry.proto.common.v1.AnyValue.string_value', index=0,
     38       number=1, type=9, cpp_type=9, label=1,
     39       has_default_value=False, default_value=b"".decode('utf-8'),
     40       message_type=None, enum_type=None, containing_type=None,
     41       is_extension=False, extension_scope=None,
     42       serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
     43     _descriptor.FieldDescriptor(
     44       name='bool_value', full_name='opentelemetry.proto.common.v1.AnyValue.bool_value', index=1,
     45       number=2, type=8, cpp_type=7, label=1,
     46       has_default_value=False, default_value=False,
     47       message_type=None, enum_type=None, containing_type=None,
     48       is_extension=False, extension_scope=None,
     49       serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
     50     _descriptor.FieldDescriptor(
     51       name='int_value', full_name='opentelemetry.proto.common.v1.AnyValue.int_value', index=2,
     52       number=3, type=3, cpp_type=2, label=1,
     53       has_default_value=False, default_value=0,
     54       message_type=None, enum_type=None, containing_type=None,
     55       is_extension=False, extension_scope=None,
     56       serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
     57     _descriptor.FieldDescriptor(
     58       name='double_value', full_name='opentelemetry.proto.common.v1.AnyValue.double_value', index=3,
     59       number=4, type=1, cpp_type=5, label=1,
     60       has_default_value=False, default_value=float(0),
     61       message_type=None, enum_type=None, containing_type=None,
     62       is_extension=False, extension_scope=None,
     63       serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
     64     _descriptor.FieldDescriptor(
     65       name='array_value', full_name='opentelemetry.proto.common.v1.AnyValue.array_value', index=4,
     66       number=5, type=11, cpp_type=10, label=1,
     67       has_default_value=False, default_value=None,
     68       message_type=None, enum_type=None, containing_type=None,
     69       is_extension=False, extension_scope=None,
     70       serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
     71     _descriptor.FieldDescriptor(
     72       name='kvlist_value', full_name='opentelemetry.proto.common.v1.AnyValue.kvlist_value', index=5,
     73       number=6, type=11, cpp_type=10, label=1,
     74       has_default_value=False, default_value=None,
     75       message_type=None, enum_type=None, containing_type=None,
     76       is_extension=False, extension_scope=None,
     77       serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
     78     _descriptor.FieldDescriptor(
     79       name='bytes_value', full_name='opentelemetry.proto.common.v1.AnyValue.bytes_value', index=6,
     80       number=7, type=12, cpp_type=9, label=1,
     81       has_default_value=False, default_value=b"",
     82       message_type=None, enum_type=None, containing_type=None,
     83       is_extension=False, extension_scope=None,
     84       serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
     85   ],
     86   extensions=[
     87   ],
     88   nested_types=[],
     89   enum_types=[
     90   ],
     91   serialized_options=None,
     92   is_extendable=False,
     93   syntax='proto3',
     94   extension_ranges=[],
     95   oneofs=[
     96     _descriptor.OneofDescriptor(
     97       name='value', full_name='opentelemetry.proto.common.v1.AnyValue.value',
     98       index=0, containing_type=None,
     99       create_key=_descriptor._internal_create_key,
    100     fields=[]),
    101   ],
    102   serialized_start=78,
    103   serialized_end=346,
    104 )
    107 _ARRAYVALUE = _descriptor.Descriptor(
    108   name='ArrayValue',
    109   full_name='opentelemetry.proto.common.v1.ArrayValue',
   (...)
    135   serialized_end=417,
    136 )
    139 _KEYVALUELIST = _descriptor.Descriptor(
    140   name='KeyValueList',
    141   full_name='opentelemetry.proto.common.v1.KeyValueList',
   (...)
    167   serialized_end=490,
    168 )

File [~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/google/protobuf/descriptor.py:621](http://localhost:8888/~/Library/Caches/pypoetry/virtualenvs/.../lib/python3.11/site-packages/google/protobuf/descriptor.py#line=620), in FieldDescriptor.__new__(cls, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options, serialized_options, has_default_value, containing_oneof, json_name, file, create_key)
    615 def __new__(cls, name, full_name, index, number, type, cpp_type, label,
    616             default_value, message_type, enum_type, containing_type,
    617             is_extension, extension_scope, options=None,
    618             serialized_options=None,
    619             has_default_value=True, containing_oneof=None, json_name=None,
    620             file=None, create_key=None):  # pylint: disable=redefined-builtin
--> 621   _message.Message._CheckCalledFromGeneratedFile()
    622   if is_extension:
    623     return _message.default_pool.FindExtensionByName(full_name)

TypeError: Descriptors cannot 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).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
@brycecf brycecf added bug Something isn't working triage issues that need triage labels Mar 26, 2024
@github-project-automation github-project-automation bot moved this to 📘 Todo in phoenix Mar 26, 2024
Copy link

dosubot bot commented Mar 26, 2024

Hey @brycecf! Great to see you back here, navigating the exciting yet sometimes bumpy roads of technology with us. How's it going?

Based on the error message you're encountering, it seems like there might be a compatibility issue with the protobuf version you're using. The error message suggests regenerating the code with protoc >= 3.19.0 or downgrading the protobuf package to 3.20.x or lower.

Given the versions of the packages you're using, it's possible that there's a conflict between these packages or a missing dependency. Here are some steps you can take to resolve this issue:

  1. Ensure Compatibility: Verify that all the packages and their dependencies are compatible with each other. This might involve checking the documentation or release notes for each package for any known compatibility issues.

  2. Update Packages: If there are any updates available for the packages you're using, consider updating them. Sometimes, bugs related to compatibility or other issues are fixed in newer versions.

  3. Reinstall the arize-phoenix Package with Extras: The provided code snippet suggests installing arize-phoenix with the evals extra if the phoenix.evals package is needed but not installed. You can do this by running the command provided in the error message:

    pip install 'arize-phoenix[evals]'
    

    This will ensure that any optional dependencies required by the evals feature are installed.

  4. Check for Missing Dependencies: Ensure that all required dependencies for the arize-phoenix, llama-index-core, llama-index-callbacks-arize-phoenix, and openinference-instrumentation-llama-index packages are correctly installed. You might need to consult the documentation for each package to verify the list of dependencies.

  5. Environment Isolation: If the issue persists, consider creating a new virtual environment and reinstalling the packages there. This can help isolate the issue from any potential conflicts in your current Python environment.

If after following these steps the issue remains unresolved, it might be helpful to consult the documentation or support forums for the specific packages involved for more targeted advice.

Regarding the protobuf version, the exact version being used in your environment is not specified in your message. However, based on the Arize Phoenix repository's pyproject.toml file, the protobuf version specified under the [tool.hatch.envs.default] section is 3.20. If you're using a different version, it might be causing the issue you're experiencing.

I hope this helps! If you have any other questions or need further clarification, feel free to ask.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@mikeldking
Copy link
Contributor

Thanks for the report @brycecf ! We'll dive in in the next few days

@MartinoMensio
Copy link
Contributor

I also have the same problem here. I am forced to set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python in the environment before running python.
Downgrading protobuf does not seem like a good option with the dependency version declared here:

"protobuf>=3.20, <6.0",

This issue is related to protocolbuffers/protobuf#10051

Let me know when there is some news or if I can provide more details!

@RogerHYang
Copy link
Contributor

Is protobuf v5+ installed? Can it be downgraded to v4?

The call stack trace above indicates that the problem package is opentelemetry-proto, but it has an upper bound on protobuf at <5.0, and the last 4.0 release of protobuf was from Feb 15 last month.

@RogerHYang RogerHYang self-assigned this Mar 28, 2024
@MartinoMensio
Copy link
Contributor

MartinoMensio commented Mar 28, 2024

pip show protobuf --> 5.26.1

Downgrade to protobuf <5.0

pip show protobuf --> 4.25.3
--> same error

Traceback (most recent call last):
  File "/mnt/c/Users/mensiom/code/foo/main.py", line 10, in <module>
    from agents.utils.tracing import setup_tracing
  File "/mnt/c/Users/mensiom/code/foo/tracing.py", line 6, in <module>
    from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
  File "/home/martino/.cache/pypoetry/virtualenvs/agents--eQpfXtl-py3.10/lib/python3.10/site-packages/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py", line 40, in <module>
    from opentelemetry.exporter.otlp.proto.http.trace_exporter.encoder import (
  File "/home/martino/.cache/pypoetry/virtualenvs/agents--eQpfXtl-py3.10/lib/python3.10/site-packages/opentelemetry/exporter/otlp/proto/http/trace_exporter/encoder/__init__.py", line 19, in <module>
    from opentelemetry.proto.collector.trace.v1.trace_service_pb2 import (
  File "/home/martino/.cache/pypoetry/virtualenvs/agents--eQpfXtl-py3.10/lib/python3.10/site-packages/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py", line 14, in <module>
    from opentelemetry.proto.trace.v1 import trace_pb2 as opentelemetry_dot_proto_dot_trace_dot_v1_dot_trace__pb2
  File "/home/martino/.cache/pypoetry/virtualenvs/agents--eQpfXtl-py3.10/lib/python3.10/site-packages/opentelemetry/proto/trace/v1/trace_pb2.py", line 14, in <module>
    from opentelemetry.proto.common.v1 import common_pb2 as opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2
  File "/home/martino/.cache/pypoetry/virtualenvs/agents--eQpfXtl-py3.10/lib/python3.10/site-packages/opentelemetry/proto/common/v1/common_pb2.py", line 36, in <module>
    _descriptor.FieldDescriptor(
  File "/home/martino/.cache/pypoetry/virtualenvs/agents--eQpfXtl-py3.10/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 553, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot 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).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

downgrade to protobuf <4.0

pip show protobuf --> 3.20.3
--> works

@RogerHYang
Copy link
Contributor

Thanks, @MartinoMensio! I'm glad you got it to work.

Incidentally, I'm not really sure what the root cause is.

@RogerHYang
Copy link
Contributor

Since this has been shown to be a third-party issue, I'm closing this ticket for now.

The workaround indicated above is to install protobuf <4.

@github-project-automation github-project-automation bot moved this from 📘 Todo to ✅ Done in phoenix Mar 28, 2024
@MartinoMensio
Copy link
Contributor

After further investigation, I managed to get it working also with protobuf v4:

The main problem was with the version of opentelemetry-exporter-otlp.
In the phoenix dependencies, it is not constrained, and for some strange reasons when I installed my project it pulled the version 1.11.1.
By adding a constraint on that library: opentelemetry-exporter-otlp = ">=1.21.0" the packages installed changed in the following way:

  • Downgrading protobuf (5.26.1 -> 4.25.3)
  • Updating opentelemetry-proto (1.11.1 -> 1.23.0)
  • Installing opentelemetry-exporter-otlp-proto-common (1.23.0)
  • Updating opentelemetry-exporter-otlp-proto-grpc (1.11.1 -> 1.23.0)
  • Updating opentelemetry-exporter-otlp-proto-http (1.11.1 -> 1.23.0)
  • Updating opentelemetry-exporter-otlp (1.11.1 -> 1.23.0)

And now I am able to run without the exception above with protobuf v4

@RogerHYang
Copy link
Contributor

Thanks, @MartinoMensio, for the detailed investigation.

@RogerHYang
Copy link
Contributor

RogerHYang commented Mar 29, 2024

The source code of opentelemetry-proto 1.11.1 shows that it only requires protobuf>=3.13.0. So pip probably had backtracked to that old version for compatibility during the installation process in a system where protobuf v5+ is already installed.

@dhirajsuvarna
Copy link

is this fixed for llama-index-callbacks-arize-phoenix package too?
I am using the latest package but getting this issue.

@mikeldking
Copy link
Contributor

is this fixed for llama-index-callbacks-arize-phoenix package too?

I am using the latest package but getting this issue.

@dhirajsuvarna sorry to hear you are facing issues. llama-index-callbacks-arize-phoenix is just a wrapper around https://pypi.org/project/openinference-instrumentation-llama-index/ so I think trying some of the above steps around otel dependencies would be my first line of investigation. We keep our dependencies pretty relaxed just so that it doesn't conflict with any pre-existing dependencies

@dhirajsuvarna
Copy link

Well I did following changes and got it working

  • Updated opentelemetry-proto to latest (1.11.1 -> 1.25.0) this downgraded protobuf from 5.27.0 to 4.25.3
  • Updated opentelemetry-exporter-otlp-proto-grpc to latest (1.11.1 -> 1.25.0)
  • Updated opentelemetry-exporter-otlp-proto-http to latest (1.11.1 -> 1.25.0)
  • Updated opentelemetry-exporter-otlp to latest (1.11.1 -> 1.25.0)

These changes got the stuff working.
But how do i make these changes premanent so that my other devs dont face this issue as the default installation of llama-index-callbacks-arize-phoenix seems to be broken

@mikeldking
Copy link
Contributor

Well I did following changes and got it working

  • Updated opentelemetry-proto to latest (1.11.1 -> 1.25.0) this downgraded protobuf from 5.27.0 to 4.25.3

  • Updated opentelemetry-exporter-otlp-proto-grpc to latest (1.11.1 -> 1.25.0)

  • Updated opentelemetry-exporter-otlp-proto-http to latest (1.11.1 -> 1.25.0)

  • Updated opentelemetry-exporter-otlp to latest (1.11.1 -> 1.25.0)

These changes got the stuff working.

But how do i make these changes premanent so that my other devs dont face this issue as the default installation of llama-index-callbacks-arize-phoenix seems to be broken

Does storing these pinned dependencies in a requirements.txt or poetry lock not work? llama-index-callbacks-arize-phoenix doesn't actually have these deps I think but I'll check the llama-index repo on Monday

@dhirajsuvarna
Copy link

@mikeldking - Well i am using poetry, so theoratically it would be possible to change the poetry.lock file manually, but its not suggested to be manually edited.

In my opinion, lets spend some time on finding the root cause, before we go down that route.

@mikeldking
Copy link
Contributor

@mikeldking - Well i am using poetry, so theoratically it would be possible to change the poetry.lock file manually, but its not suggested to be manually edited.

In my opinion, lets spend some time on finding the root cause, before we go down that route.

@dhirajsuvarna in general I think it's better for you to pin the OTel versions directly in your requirements rather than rely on the version range specified by Phoenix. In general Phoenix cannot have hard dependencies on specific versions of open telemetry since it needs to support various instrumentations and client environments.I would recommend a setup like this to specify your dependencies. This will give you the deterministic environment that you're looking for https://github.com/Arize-ai/openinference/blob/85d6c0a3e148fcc50018873e06a9dbd38f5d5b06/python/examples/llama-index/backend/pyproject.toml

@RogerHYang
Copy link
Contributor

looks like this issue will be fixed very soon open-telemetry/opentelemetry-python#3931 (comment)

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
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants