-
Notifications
You must be signed in to change notification settings - Fork 817
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
Error during cleanup of server sqlite: Attempted to exit cancel scope in a different task than it was entered in #252
Comments
I got the same error. This is the only example I've seen of using python to manage multiple mcp servers (and it doesn't seem to work). Are there others? |
having the same issue. immediately after receiving an OK response from the LLM, get this error. EDIT: from Claude: The key problem is a violation of a fundamental principle in asynchronous programming. In async frameworks (like Python's asyncio, trio, or curio), a "cancel scope" is a context that manages cancellation of operations. This error indicates the code is trying to exit a cancel scope from a different task than the one where it was created. I may have a solution but I won't be able to test it until about 6 hours time as i have to go out. Fingers crossed. but the solution is from Claude. It's already sent me on a number of wild goose chases w/r/t this exact issue. but i have a better understanding of it now so i should be able to better analyze the proposed fix line by line once i attempt to implement it. I'll keep you posted |
I met the same problem, how did you solve it? |
Many 6 hours have passed now, are you back? |
asyncio.gather() cannot be used since the order of initialization is unknown. we need to know this initialization order since we need to close the servers in reverse initialization order. let me know if there is a way to launch the servers in parallel, since this is a big bottleneck seemingly. |
Describe the bug
When running examples\clients\simple-chatbot\mcp_simple_chatbot\main.py
2025-03-10 19:55:12,391 - ERROR - Error during cleanup of server sqlite: Attempted to exit cancel scope in a different task than it was entered in
2025-03-10 19:55:12,467 - ERROR - an error occurred during closing of asynchronous generator <async_generator object stdio_client at 0x0000014698D39930>
Expected behavior
A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: