Skip to content

ERROR:opentelemetry.context:Failed to detach context #1670

@pawan-dream11

Description

@pawan-dream11

** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.

Describe the bug
We have deployed our agent. and getting this issue -

Traceback (most recent call last):
File "/home/myuser/.local/lib/python3.11/site-packages/opentelemetry/context/init.py", line 155, in detach
_RUNTIME_CONTEXT.detach(token)
File "/home/myuser/.local/lib/python3.11/site-packages/opentelemetry/context/contextvars_context.py", line 53, in detach
self._current_context.reset(token)
ValueError: <Token var=<ContextVar name='current_context' default={} at 0x3e20a81529d0> at 0x3e209c1a1340> was created in a different Context

dependencies list in requirements.txt is as follow:-

python-dotenv>=1.0.0
asyncio
google-adk==1.4.2
absl-py==2.2.1
cloudpickle==3.1.1
flake8-pyproject==1.2.3
aiohttp==3.10.11
uv==0.7.14
requests>=2.32.3

To Reproduce
Steps to reproduce the behavior:

  1. Install above dependencies
  2. Run adk web
  3. Open '....'
  4. See error

Desktop (please complete the following information):

  • Python version(python -V): 13.3
  • ADK version(pip show google-adk): 1.4.2

Model Information:
For example, which model is being used. gemini-2.5-pro

Metadata

Metadata

Assignees

Labels

bot triaged[Bot] This issue is triaged by ADK bottracing[Component] This issue is related to OpenTelemetry tracing

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions