Skip to content
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

API endpoint /queries:run returns HTTP 500 Internal Server Error #350

Closed
eecavanna opened this issue Nov 3, 2023 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@eecavanna
Copy link
Collaborator

eecavanna commented Nov 3, 2023

Swagger UI link:
https://api.microbiomedata.org/docs#/queries/run_query_queries_run_post

The request payload is:

{
"find": "biosample_set",
"filter": {"gold_biosample_identifiers": {"$elemMatch":{"$eq": "gold:Gb0356184"}}}
}

Here's a screenshot of the error response on Swagger UI:

image

The final few lines of the stack trace on the server are:

  File "/code/nmdc_runtime/api/endpoints/queries.py", line 79, in run_query
    cmd_response = _run_query(query, mdb)
  File "/code/nmdc_runtime/api/endpoints/queries.py", line 141, in _run_query
    mdb.query_runs.insert_one(query_run.model_dump(mode="json", exclude_unset=True))
  File "/usr/local/lib/python3.10/site-packages/pydantic/main.py", line 308, in model_dump
    return self.__pydantic_serializer__.to_python(
pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'bson.objectid.ObjectId'>

Full stack trace is on Slack, here:
https://nmdc-group.slack.com/archives/C05966WE4G6/p1698979668327079?thread_ts=1698960484.010949&cid=C05966WE4G6

Originally reported by @mbthornton-lbl on Slack, here:
https://nmdc-group.slack.com/archives/C05966WE4G6/p1698960484010949

CC: @PeopleMakeCulture

@dwinston
Copy link
Collaborator

dwinston commented Nov 6, 2023

fixed by #363

@dwinston dwinston closed this as completed Nov 6, 2023
@github-project-automation github-project-automation bot moved this from Lineup to Scored in Polyneme mixset Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants