Open antoni0z opened 3 weeks ago
Thanks @antoni0z. This issue is caused by inconsistent types on metadata values. PyArrow is not able to handle.
As a quick fix for people who may experience the same error i managed to not get this error if I narrow it down using
filtered_query = SpanQuery("span_kind == 'LLM'").select(input = "input.value", output = "output.value", metadata = "metadata")
spans = client.query_spans(filtered_query)
This way if you exclude the problematic ones from the conversion to pyarrow it doesnt cause that error.
Bug Report
Describe the bug
When attempting to retrieve traces or spans from a Phoenix server using the Python client, a 500 Internal Server Error is encountered. This occurs when executing
client.get_trace_dataset()
orclient.get_spans_dataframe()
in a notebook environment.To Reproduce
Steps to reproduce the behavior:
Set up a Phoenix server using Docker with version 4.31.0. Use the following Docker Compose configuration:
Start the Docker container using
docker-compose up
.Install the Phoenix client with the following specification:
In a Python notebook, execute the following code:
Observe the 500 Internal Server Error.
Expected behavior
The
client.get_trace_dataset()
call should successfully retrieve trace data from the Phoenix server without encountering an internal server error.Screenshots
Environment
Additional context
Server logs show the following error:
This suggests a data type conversion issue when processing the trace data, specifically with the 'attributes.metadata' column.
The error occurs in the following file:
/phoenix/env/phoenix/server/api/routers/v1/spans.py
, line 120The client also receives a warning: "The Phoenix server has an unknown version and may have warnings.warn("
Server trace logging configuration:
This configuration sets up the trace logging using OpenTelemetry and LangChain instrumentation.
There's a FutureWarning in the server logs about pandas Series.getitem behavior:
This warning suggests that the server code might be using an outdated pandas method, which could potentially lead to issues in future versions.