Skip to content

[REPORT] Error processing document: Error in step 'extract_file_data': unhandled errors in a TaskGroup (1 sub-exception) #26

@lennonjesus

Description

@lennonjesus

Checklist

Before reporting bugs or help requests, please fill out the following checklist:

  • I set the .env file with the necessary keys, including OPENAI_API_KEY, LLAMACLOUD_API_KEY, ELEVENLABS_API_KEY
  • My API keys are all functioning and have at least some credit balance
  • I ran both the scripts in the tools directory
  • I checked that my LlamaCloud Extract Agent and my LlamaCloud Index has been correctly created and are functioning (using the playground functionality in the UI
  • I activated the virtual environment and ensured that all the dependencies are installed properly
  • As a first step, I launched the docker services through docker compose up -d
  • As a second step, I launched the MCP server through uv run src/notebookllama/server.py
  • As a third and last step, I launched the Streamlit app through strealit run src/notebookllama/Home.py

Issue Description

My issue is... Error processing document: Error in step 'extract_file_data': unhandled errors in a TaskGroup (1 sub-exception)

Relevant Traceback

Overriding of current TracerProvider is not allowed
Emitting span Workflow.run-6fc185a2-cc9d-48af-8eed-3df3e37238ab at time: 2025-07-11 12:51:34.087447
Emitting span Workflow.run-6fc185a2-cc9d-48af-8eed-3df3e37238ab at time: 2025-07-11 12:51:34.088089
Emitting span NotebookLMWorkflow.extract_file_data-2aca5cbe-2bb9-40c5-bae4-b3803a5a7eed at time: 2025-07-11 12:51:34.089040
Emitting span NotebookLMWorkflow.extract_file_data-2aca5cbe-2bb9-40c5-bae4-b3803a5a7eed at time: 2025-07-11 12:51:34.089090
Registering a SpanDropEvent event at time: 2025-07-11 12:52:04.183099
Registering a SpanDropEvent event at time: 2025-07-11 12:52:04.188922
Preparing to exit span NotebookLMWorkflow.extract_file_data-2aca5cbe-2bb9-40c5-bae4-b3803a5a7eed with an error at time: 2025-07-11 12:52:04.189194
Preparing to exit span NotebookLMWorkflow.extract_file_data-2aca5cbe-2bb9-40c5-bae4-b3803a5a7eed with an error at time: 2025-07-11 12:52:04.190205
Registering a SpanDropEvent event at time: 2025-07-11 12:52:04.193006
Registering a SpanDropEvent event at time: 2025-07-11 12:52:04.193156
Preparing to exit span Workflow.run-6fc185a2-cc9d-48af-8eed-3df3e37238ab with an error at time: 2025-07-11 12:52:04.193203
Preparing to exit span Workflow.run-6fc185a2-cc9d-48af-8eed-3df3e37238ab with an error at time: 2025-07-11 12:52:04.193379
Exception in callback Dispatcher.span.<locals>.wrapper.<locals>.handle_future_result()() at /Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/llama_index_instrumentation/dispatcher.py:277
handle: <Handle Dispatcher.span.<locals>.wrapper.<locals>.handle_future_result()() at /Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/llama_index_instrumentation/dispatcher.py:277>
  + Exception Group Traceback (most recent call last):
  |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/workflows/context/context.py", line 687, in _step_worker
  |     new_ev = await instrumented_step(**kwargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/llama_index_instrumentation/dispatcher.py", line 365, in async_wrapper
  |     result = await func(*args, **kwargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/src/notebookllama/workflow.py", line 48, in extract_file_data
  |     result = await mcp_client.call_tool(
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |         tool_name="process_file_tool", arguments={"filename": ev.file}
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |     )
  |     ^
  |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/llama_index/tools/mcp/client.py", line 297, in call_tool
  |     async with self._run_session() as session:
  |                ~~~~~~~~~~~~~~~~~^^
  |   File "/Users/lennonjesus/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/lib/python3.13/contextlib.py", line 235, in __aexit__
  |     await self.gen.athrow(value)
  |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/llama_index/tools/mcp/client.py", line 225, in _run_session
  |     async with streamablehttp_client(
  |                ~~~~~~~~~~~~~~~~~~~~~^
  |         self.command_or_url, auth=self.auth, headers=self.headers
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |     ) as (read, write, _):
  |     ^
  |   File "/Users/lennonjesus/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/lib/python3.13/contextlib.py", line 235, in __aexit__
  |     await self.gen.athrow(value)
  |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/mcp/client/streamable_http.py", line 437, in streamablehttp_client
  |     async with anyio.create_task_group() as tg:
  |                ~~~~~~~~~~~~~~~~~~~~~~~^^
  |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
  |     raise BaseExceptionGroup(
  |         "unhandled errors in a TaskGroup", self._exceptions
  |     ) from None
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/mcp/client/streamable_http.py", line 461, in streamablehttp_client
    |     yield (
    |     ...<3 lines>...
    |     )
    |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/llama_index/tools/mcp/client.py", line 228, in _run_session
    |     async with ClientSession(
    |                ~~~~~~~~~~~~~^
    |         read,
    |         ^^^^^
    |     ...<2 lines>...
    |         sampling_callback=self.sampling_callback,
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     ) as session:
    |     ^
    |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/mcp/shared/session.py", line 218, in __aexit__
    |     return await self._task_group.__aexit__(exc_type, exc_val, exc_tb)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
    |     raise BaseExceptionGroup(
    |         "unhandled errors in a TaskGroup", self._exceptions
    |     ) from None
    | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/anyio/streams/memory.py", line 111, in receive
      |     return self.receive_nowait()
      |            ~~~~~~~~~~~~~~~~~~~^^
      |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/anyio/streams/memory.py", line 106, in receive_nowait
      |     raise WouldBlock
      | anyio.WouldBlock
      |
      | During handling of the above exception, another exception occurred:
      |
      | Traceback (most recent call last):
      |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/anyio/_core/_tasks.py", line 115, in fail_after
      |     yield cancel_scope
      |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/mcp/shared/session.py", line 272, in send_request
      |     response_or_error = await response_stream_reader.receive()
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/anyio/streams/memory.py", line 119, in receive
      |     await receive_event.wait()
      |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 1774, in wait
      |     await self._event.wait()
      |   File "/Users/lennonjesus/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/lib/python3.13/asyncio/locks.py", line 213, in wait
      |     await fut
      | asyncio.exceptions.CancelledError: Cancelled by cancel scope 11b050940
      |
      | During handling of the above exception, another exception occurred:
      |
      | Traceback (most recent call last):
      |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/mcp/shared/session.py", line 271, in send_request
      |     with anyio.fail_after(timeout):
      |          ~~~~~~~~~~~~~~~~^^^^^^^^^
      |   File "/Users/lennonjesus/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/lib/python3.13/contextlib.py", line 162, in __exit__
      |     self.gen.throw(value)
      |     ~~~~~~~~~~~~~~^^^^^^^
      |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/anyio/_core/_tasks.py", line 118, in fail_after
      |     raise TimeoutError
      | TimeoutError
      |
      | During handling of the above exception, another exception occurred:
      |
      | Traceback (most recent call last):
      |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/llama_index/tools/mcp/client.py", line 235, in _run_session
      |     yield session
      |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/llama_index/tools/mcp/client.py", line 298, in call_tool
      |     return await session.call_tool(
      |            ^^^^^^^^^^^^^^^^^^^^^^^^
      |         tool_name, arguments=arguments, progress_callback=progress_callback
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |     )
      |     ^
      |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/mcp/client/session.py", line 264, in call_tool
      |     return await self.send_request(
      |            ^^^^^^^^^^^^^^^^^^^^^^^^
      |     ...<12 lines>...
      |     )
      |     ^
      |   File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/mcp/shared/session.py", line 274, in send_request
      |     raise McpError(
      |     ...<8 lines>...
      |     )
      | mcp.shared.exceptions.McpError: Timed out while waiting for response to ClientRequest. Waited 30.0 seconds.
      +------------------------------------

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/lennonjesus/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/lib/python3.13/asyncio/events.py", line 89, in _run
    self._context.run(self._callback, *self._args)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/llama_index_instrumentation/dispatcher.py", line 290, in handle_future_result
    raise exception
  File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/workflows/workflow.py", line 416, in _run_workflow
    raise exception_raised
  File "/Users/lennonjesus/Projetos/MPRJ/notebookllama/.venv/lib/python3.13/site-packages/workflows/context/context.py", line 696, in _step_worker
    raise WorkflowRuntimeError(
        f"Error in step '{name}': {e!s}"
    ) from e
workflows.errors.WorkflowRuntimeError: Error in step 'extract_file_data': unhandled errors in a TaskGroup (1 sub-exception)
Overriding of current TracerProvider is not allowed

Other details

OS: macOS 15.5 Build 24F74 / Mac mini Apple Silicon M1:
uv version: uv 0.7.20 (251420396 2025-07-09)
streamlit version: Streamlit, version 1.46.1
fastmcp version: 2.9.2
llama-index-workflows version:

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions