biothings / biothings_explorer

TRAPI service for BioThings Explorer

Home Page:https://api.bte.ncats.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

problem retrieving asyncquery_response

andrewsu opened this issue · comments

I sent the TRAPI query below to https://bte.ci.transltr.io/v1/asyncquery. The response snippet from the end of the logs https://bte.ci.transltr.io/v1/asyncquery_status/6N1qt9ReUn:

    {
      "timestamp": "2023-12-05T01:33:36.675Z",
      "level": "INFO",
      "message": "Execution Summary: (524) nodes / (6010) edges / (500) results; (59/85) queries returned results from(7) unique API",
      "code": null
    },
    {
      "timestamp": "2023-12-05T01:33:36.676Z",
      "level": "INFO",
      "message": "APIs: BioThings SEMMEDDB API, BioThings IDISK API, MyChem.info API, MyDisease.info API, BioThings DISEASES API, BioThings DGIdb API, Text Mining Targeted Association API ",
      "code": null
    },
    {
      "timestamp": "2023-12-05T01:33:36.705Z",
      "level": "INFO",
      "message": "job results available at: https://bte.ci.transltr.io/v1/asyncquery_response/6N1qt9ReUn",
      "code": null
    }
  ]
}

But when I try to retrieve results from https://bte.ci.transltr.io/v1/asyncquery_response/6N1qt9ReUn, I get the following error:

{
  "status": 500,
  "description": "TypeError: Cannot read properties of null (reading 'logs')"
}

Same query on prod works fine (https://bte.transltr.io/v1/asyncquery_response/0SwgqkNTEN), as did the equivalent call on the synchronous /query endpoint.

Also replicated the error on CI with a different TRAPI query (with MONDO:0000004):

 

TRAPI query
{
    "message": {
        "query_graph": {
            "edges": {
                "t_edge": {
                    "knowledge_type": "inferred",
                    "object": "on",
                    "predicates": [
                        "biolink:treats"
                    ],
                    "subject": "sn"
                }
            },
            "nodes": {
                "on": {
                    "categories": [
                        "biolink:Disease"
                    ],
                    "ids": [
                        "MONDO:0005709"
                    ],
                    "is_set": false
                },
                "sn": {
                    "categories": [
                        "biolink:ChemicalEntity"
                    ],
                    "is_set": false
                }
            }
        }
    }
}

Possibly related to #751 -- I'm looking into it.

@tokebe

I'm wondering if the error I encountered in #770 is the same as this issue. The error message is different.


EDIT

I sent a request to BTE CI asyncquery directly with the same TRAPI creative-mode query as issue 770...

https://bte.ci.transltr.io/v1/asyncquery_status/OjTUOBGAPi seems okay, it shows all the logs from BTE's execution.
But the linked response URLhttps://bte.ci.transltr.io/v1/asyncquery_response/OjTUOBGAPi leads to the same error message {"error":"Response expired. Responses are kept 30 days."}

VS I tried running things locally and there were no problems. #770 (comment)

The error is related -- I changed the endpoint's behavior a little bit which resulted in a different error message. In correct circumstances, BTE should give that message when there's no response at that ID, but clearly something's causing that ID/some section of data related to it to be missing early...

Removed this issue from deployment as it's decidedly not resolved by existing fixes. This issue appears to stem from some sort of Redis or Bull error, but requires further investigation.

Looks fixed to me! I was running more queries #770 (comment) and https://bte.ci.transltr.io/v1/asyncquery_response/n3qiSfynpS seems to work as-intended, getting BTE's full response


EDIT: even previous links that didn't work before - they seem to work now too! like https://bte.ci.transltr.io/v1/asyncquery_response/ruPFWCI12w from #770 (comment)

Relevant changes deployed to Prod.