Skip to content

TRAPI2.0 branch code doesn't work with stream_progress=false #2930

Closed

Description

@saramsey

This bug was brought to my attention by @hodgesf and @edeutsch (thank you!).

The code in the trapi2.0 branch does not seem to work, even for the Example 1 query,

{
    "message":
    {
        "query_graph":
        {
            "edges": {
                "e00": {
                    "subject":   "n00",
                    "object":    "n01",
                    "predicates": ["biolink:interacts_with"]
                }
            },
            "nodes": {
                "n00": {
                    "ids":        ["CHEBI:46195"]
                },
                "n01": {
                    "categories":  ["biolink:Protein"]
                }
            }
        }
    },
    "stream_progress": false
}

via this:

curl-post-json -d \@example1.json https://arax.ncats.io/beta/api/arax/v2.0/query

when the stream_progress field of the request is set to false (which is the default setting). The following uncaught error occurs leading to a 500 status code back to the client:

Traceback (most recent call last):

  File "/mnt/data/orangeboard/beta/RTX/code/ARAX/ARAXQuery/ARAX_query.py",
       line 805, in execute_processing_plan
    expander.apply(response, action['parameters'], mode=mode)

  File "/mnt/data/orangeboard/beta/RTX/code/ARAX/ARAXQuery/ARAX_expander.py",
       line 456, in apply
    kp_answers = loop.run_until_complete(task_group)

  File "/usr/lib/python3.12/asyncio/base_events.py",
       line 663, in run_until_complete
    self._check_running()

  File "/usr/lib/python3.12/asyncio/base_events.py",
       line 624, in _check_running
    raise RuntimeError(

RuntimeError: Cannot run the event loop while another loop is running

If instead the above request is POSTed to the same API with stream_progress=true, the response is a 200:

{"timestamp": "2026-10-21 03:36:48.547331", "level": "INFO", "code": "", "message": "Processing is complete. Transmitting resulting Message back t
o client."}

Activity

  1. self-assigned this
    on Oct 21, 2026
  2. saramsey commented on Oct 21, 2026

    @saramsey
    MemberAuthor

    I've managed to reproduce this bug with the FastAPI application server running locally on my MBP (macOS 27.0.1).

  3. added a commit that references this issue on Oct 21, 2026
  4. saramsey commented on Oct 21, 2026

    @saramsey
    MemberAuthor

    Commit 08f4b5f confirmed to fix it, on my MBP.

  5. saramsey commented on Oct 21, 2026

    @saramsey
    MemberAuthor

    Assigning to @hodgesf for further testing on arax.ncats.io

  6. hodgesf commented on Oct 21, 2026

    @hodgesf
    Collaborator

    I deployed the fix on arax.ncats.io/beta and then tested it via the command line with curl and got a response.

        "resource_id": "ARAX",
        "schema_version": "2.0.0",
        "status": "Success",
        "table_column_names": [
            "score",
            "essence",
            "essence_category"
        ],
        "tool_version": "ARAX 2.0.0",
        "total_results_count": 58,
        "type": "translator_reasoner_response"

    OK to close?

  7. edeutsch commented on Oct 21, 2026

    @edeutsch
    Collaborator

    I think so, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions