Skip to content

Condition text search: ValueError 'MPATH' is not a valid OntologyService #1603

Description

@davmlaw

🤖 Written by Claude

Condition text search hits ValueError: 'MPATH' is not a valid OntologyService when normalising a term whose prefix (MPATH) isn't in the OntologyService enum.

Seen on sharianttest and another deployment. Either add MPATH to the supported services or handle/skip unknown prefixes gracefully in condition text search.

Location: classification/models/condition_text_search.py:22ontology/models/models_ontology.py:308 (normalize)

Rollbar:

(Filed from a 6-month Rollbar triage.)


Second failure mode in the same function (added during triage):

condition_text_search() also calls .json() directly on the Monarch API response with no guard. The Monarch /v3/api/search endpoint intermittently returns errors or a non-JSON error page (e.g. a 502 HTML page), so .json() raises JSONDecodeError: Expecting value: line 2 column 1 and aborts the whole condition search before normalize() is ever reached.

Both are fragilities in the same condition_text_search() function and are addressed together in #1607.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions