RTXteam / RTX

Software repo for Team Expander Agent (Oregon State U., Institute for Systems Biology, and Penn State U.)
https://arax.ncats.io/
MIT License
33 stars 21 forks source link

SmartAPI uptime status for ARAX (dev) showing up as "fail" #1836

Open saramsey opened 2 years ago

saramsey commented 2 years ago

This web page at SmartAPI purports to show an uptime status for ARAX Translator Reasoner (dev), and that status is currently showing as "fail":

Screen Shot 2022-05-10 at 11 26 19 AM

saramsey commented 2 years ago

tagging @edeutsch and @dkoslicki

dkoslicki commented 2 years ago

Any idea how often that is updated? I know there was an odd blip last night that seemed to resolve itself. In case it helps, here is what's causing the fail label:

https://arax.ncats.io/beta/api/arax/v1.2/PubmedMeshNgd/{term1}/{term2}: MissingRequiredParameters
https://arax.ncats.io/beta/api/arax/v1.2/entity: MissingRequiredParameters
https://arax.ncats.io/beta/api/arax/v1.2/query: BAD REQUEST
/query: TypeError
https://arax.ncats.io/beta/api/arax/v1.2/response/{response_id}: MissingRequiredParameters
newgene commented 2 years ago

Some debugging info for the /query endpoint I can see on our end:

DEBUG:utils.uptime.endpoint.make_api_call:https://arax.ncats.io/api/arax/v1.2/query
DEBUG:utils.uptime.endpoint.make_api_call:component path: schemas/Query/example
DEBUG:utils.uptime.endpoint.make_api_call:example {'bypass_cache': False, 'enforce_edge_directionality': False, 'log_level': '', 'max_results': 100, 'message': {'query_graph': {'edges': {'e00': {'object': 'n01', 'predicates': ['biolink:physically_interacts_with'], 'subject': 'n00'}}, 'nodes': {'n00': {'ids': ['CHEMBL.COMPOUND:CHEMBL112']}, 'n01': {'categories': ['biolink:Protein']}}}}, 'operations': '', 'page_number': 1, 'page_size': 100, 'return_minimal_metadata': False, 'stream_progress': False, 'submitter': 'submitter', 'workflow': ['', '']}
DEBUG:utils.uptime.endpoint.make_api_call:post: https://arax.ncats.io/api/arax/v1.2/query, {}, {'bypass_cache': False, 'enforce_edge_directionality': False, 'log_level': '', 'max_results': 100, 'message': {'query_graph': {'edges': {'e00': {'object': 'n01', 'predicates': ['biolink:physically_interacts_with'], 'subject': 'n00'}}, 'nodes': {'n00': {'ids': ['CHEMBL.COMPOUND:CHEMBL112']}, 'n01': {'categories': ['biolink:Protein']}}}}, 'operations': '', 'page_number': 1, 'page_size': 100, 'return_minimal_metadata': False, 'stream_progress': False, 'submitter': 'submitter', 'workflow': ['', '']}, <Response [400]>, {'User-Agent': 'SmartAPI API status monitor', 'Content-Type': 'application/json'}
DEBUG:utils.uptime.endpoint.make_api_call:Error skipping decoding example the JSON object must be str, bytes or bytearray, not NoneType

Particularly the line with "post:" shows the actual POST query and the response (it's a 400). This log line comes from this statement:

logger.debug('post: %s, %s, %s, %s, %s', url, params, example, response, headers)

so you should be able to reproduce this error. Is the example value above the correct one we should be getting from the API metadata?

dkoslicki commented 2 years ago

And some more info from slack:

Marco Cano (Exploring Agent, Service Provider) 36 minutes ago That TypeError looks suspicious and could be the issue, perhaps due to some recent changes in the monitor code I will look into it. The required missing params ones are skipped so I wouldnt think it'd be those.

Chunlei Wu (Exploring Agent, Service Provider) < 1 minute ago Pasted some debug info I saw to the issue: https://github.com/RTXteam/RTX/issues/1836#issuecomment-1123182897 Comment on #1836 SmartAPI uptime status for ARAX (dev) showing up as "fail" Some debugging info for the /query endpoint I can see on our end: DEBUG:utils.uptime.endpoint.make_api_call:https://arax.ncats.io/api/arax/v1.2/query DEBUG:utils.uptime.endpoint.make_api_call:component path: schemas/Query/example DEBUG:utils.uptime.endpoint.make_api_call:example {'bypass_cache': False, 'enforce_edge_directionality': False, 'log_level': '', 'max_results': 100, 'message': {'query_graph': {'edges': {'e00': {'object': 'n01', 'predicates': ['biolink:physically_interacts_with'], 'subject': 'n00'}}, 'nodes': {'n00': {'ids': ['CHEMBL.COMPOUND:CHEMBL112']}, 'n01': {'categories': ['biolink:Protein']}}}}, 'operations': '', 'page_number': 1, 'page_size': 100, 'return_minimal_metadata': Fal… Show more https://github.com/[RTXteam/RTX](https://github.com/RTXteam/RTX)|RTXteam/RTXRTXteam/RTX | Today at 12:48 AM | Added by GitHub

dkoslicki commented 2 years ago

Here's the full thread: https://ncatstranslator.slack.com/archives/C013Q5TVC87/p1652241902893549

finnagin commented 2 years ago

Not sure if this is the issue causing the fail status on SmartAPI but I noticed that on the arax api swagger page if you click "Try It Out" next to the query endpoint the example query it automatically fills out is the following:

{
  "bypass_cache": false,
  "enforce_edge_directionality": false,
  "log_level": "",
  "max_results": 100,
  "message": {
    "query_graph": {
      "edges": {
        "e00": {
          "object": "n01",
          "predicates": [
            "biolink:physically_interacts_with"
          ],
          "subject": "n00"
        }
      },
      "nodes": {
        "n00": {
          "ids": [
            "CHEMBL.COMPOUND:CHEMBL112"
          ]
        },
        "n01": {
          "categories": [
            "biolink:Protein"
          ]
        }
      }
    }
  },
  "operations": "",
  "page_number": 1,
  "page_size": 100,
  "return_minimal_metadata": false,
  "stream_progress": false,
  "submitter": "submitter",
  "workflow": [
    "",
    ""
  ]
}

I see multiple errors in this that might cause a 400 error. So if SmartAPI is using this example query to check if arax is up then that might be why it says fail and they are seeing 400 errors like in the slack thread.

The errors I see above are

  1. The log_level field is an empty string. This should be changes to something like "INFO" or "DEBUG"
  2. The workflow field is a list with 2 empty strings. This should wither be filled out or removed.
  3. The operations field is an empty string. This should also be filled out or removed.

If I do the above steps I get the following query:

{
  "bypass_cache": false,
  "enforce_edge_directionality": false,
  "log_level": "INFO",
  "max_results": 100,
  "message": {
    "query_graph": {
      "edges": {
        "e00": {
          "object": "n01",
          "predicates": [
            "biolink:physically_interacts_with"
          ],
          "subject": "n00"
        }
      },
      "nodes": {
        "n00": {
          "ids": [
            "CHEMBL.COMPOUND:CHEMBL112"
          ]
        },
        "n01": {
          "categories": [
            "biolink:Protein"
          ]
        }
      }
    }
  },
  "page_number": 1,
  "page_size": 100,
  "return_minimal_metadata": false,
  "stream_progress": false,
  "submitter": "submitter"
}

This completes successfully.

edeutsch commented 2 years ago

ah yes, this is due to a badly formed example in the YAML schema. I see the problem and will fix.