google / google/adk-docs

I have Custom MCP Server and Custom frontend UI for AI Agent. But I am facing this error. Please help.

Open
#319 11 comments 1 reaction 0 assignees View on GitHub
mcp
Dominant language
Shell
Stars
1.5k
Forks
1.3k
Avg merge
7d 1h
Merged PRs (30d)
34

Description

Django version 4.2.10, using settings 'core.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Request received
[24/May/2025 22:47:54] "POST /agents/api/agent/ HTTP/1.1" 500 145
Performing system checks...

System check identified no issues (0 silenced).

You have 58 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, django_celery_beat, emailsync, quickbook, sessions, social_django, user_management.
Run 'python manage.py migrate' to apply them.
May 24, 2025 - 22:48:50
Django version 4.2.10, using settings 'core.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Request received
Initializing Agent
Creating Agent
Agent created
Agent initialized
an error occurred during closing of asynchronous generator
asyncgen:
Traceback (most recent call last):
File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.11/site-packages/httpx_sse/_api.py", line 70, in aconnect_sse
yield EventSource(response)
GeneratorExit

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.11/site-packages/httpx_sse/_api.py", line 69, in aconnect_sse
async with client.stream(method, url, headers=headers, **kwargs) as response:
File "/usr/local/Cellar/python@3.11/3.11.12_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 267, in __aexit__
raise RuntimeError("generator didn't stop after athrow()")
RuntimeError: generator didn't stop after athrow()
an error occurred during closing of asynchronous generator
asyncgen:
Traceback (most recent call last):
File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.11/site-packages/mcp/client/sse.py", line 57, in sse_client
async with aconnect_sse(
File "/usr/local/Cellar/python@3.11/3.11.12_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 267, in __aexit__
raise RuntimeError("generator didn't stop after athrow()")
RuntimeError: generator didn't stop after athrow()

During handling of the above exception, another exception occurred:

+ Exception Group Traceback (most recent call last):
| File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 767, in __aexit__
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.11/site-packages/mcp/client/sse.py", line 154, in sse_client
| yield read_stream, write_stream
| GeneratorExit
|
| During handling of the above exception, another exception occurred:
|
| Traceback (most recent call last):
| File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.11/site-packages/mcp/client/sse.py", line 57, in sse_client
| async with aconnect_sse(
| File "/usr/local/Cellar/python@3.11/3.11.12_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 267, in __aexit__
| raise RuntimeError("generator didn't stop after athrow()")
| RuntimeError: generator didn't stop after athrow()
+------------------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.11/site-packages/mcp/client/sse.py", line 53, in sse_client
async with anyio.create_task_group() as tg:
File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 773, in __aexit__
if self.cancel_scope.__exit__(type(exc), exc, exc.__traceback__):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/priyanshu-internship/Desktop/North Astra/finance-agent-backend/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 456, in __exit__
raise RuntimeError(
RuntimeError: Attempted to exit cancel scope in a different task than it was entered in
[24/May/2025 22:49:00] "POST /agents/api/agent/ HTTP/1.1" 500 145

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]: Mac OS
- Python version(python -V): 3.11
- ADK version(pip show google-adk): 1.0.0

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.