-
Notifications
You must be signed in to change notification settings - Fork 826
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe your environment
We have a Python 3.11 app using openllmetry 0.38.8
What happened?
We encountered this bug in openllmetry - traceloop/openllmetry#2699
File "/code/python/service/ai_agents/.venv/lib/python3.11/site-packages/opentelemetry/sdk/trace/__init__.py", line 713, in _from_env_if_absent
raise ValueError(err_msg.format(env_var, value))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: cannot switch from manual field specification to automatic field numbering
We still don't know what's causing the original problem, but the error itself is dubious. We should seen a different error that tells us which env var that has the malformed value, but instead run into a ValueError on the error message formatting.
When I checked, it felt like the problem might be on this line -
| err_msg = "{0} must be a non-negative integer but got {}" |
- Unless I've missed something, It feels like the formatting may be the culprit for the ValueError.
- It's not clear how
_from_env_if_absentis even failing in openllmetry, but I suppose fixing the above bug will help us reach that part. We have a gunicorn FastAPI app backing an LLM service in our setup.
Steps to Reproduce
Even a basic python script like the following reproduces the error:
env_var = "test"
value = -1
err_msg = "{0} must be a non-negative integer but got {}"
raise ValueError(err_msg.format(env_var, value))
Expected Result
Should tell us which env var was supplied an incorrect value
Actual Result
ValueError: cannot switch from manual field specification to automatic field numbering
Additional context
No response
Would you like to implement a fix?
None
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working