biolink / information-resource-registry

The information resource registry is a listing of data sources present in the NCATS Data Translator system. Each information resource has an identifier, a short description, and an URL to more information about that resource.
https://biolink.github.io/information-resource-registry/
Apache License 2.0
1 stars 12 forks source link

Update Aragorn kp script to not use kp registry #32

Closed maximusunc closed 2 weeks ago

andrewsu commented 3 weeks ago

@maximusunc I get periodic errors when accessing https://strider.renci.org/kps. If I reload a couple times it seems to work, but fyi...

{"message":{},"logs":[{"message":"Exception in Strider: AttributeError(\"'NoneType' object has no attribute 'values'\")","level":"ERROR","timestamp":"2024-10-14T17:00:27.108719","stack":"Traceback (most recent call last):\n  File \"/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py\", line 159, in call_next\n    message = await recv_stream.receive()\n              ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/site-packages/anyio/streams/memory.py\", line 111, in receive\n    return self.receive_nowait()\n           ^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/site-packages/anyio/streams/memory.py\", line 104, in receive_nowait\n    raise EndOfStream\nanyio.EndOfStream\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"/app/strider/server.py\", line 129, in catch_exceptions_middleware\n    return await call_next(request)\n           ^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py\", line 165, in call_next\n    raise app_exc\n  File \"/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py\", line 151, in coro\n    await self.app(scope, receive_or_disconnect, send_no_error)\n  File \"/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py\", line 85, in __call__\n    await self.app(scope, receive, send)\n  File \"/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py\", line 65, in __call__\n    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)\n  File \"/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py\", line 64, in wrapped_app\n    raise exc\n  File \"/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py\", line 53, in wrapped_app\n    await app(scope, receive, sender)\n  File \"/usr/local/lib/python3.12/site-packages/starlette/routing.py\", line 756, in __call__\n    await self.middleware_stack(scope, receive, send)\n  File \"/usr/local/lib/python3.12/site-packages/starlette/routing.py\", line 776, in app\n    await route.handle(scope, receive, send)\n  File \"/usr/local/lib/python3.12/site-packages/starlette/routing.py\", line 297, in handle\n    await self.app(scope, receive, send)\n  File \"/usr/local/lib/python3.12/site-packages/starlette/routing.py\", line 77, in app\n    await wrap_app_handling_exceptions(app, request)(scope, receive, send)\n  File \"/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py\", line 64, in wrapped_app\n    raise exc\n  File \"/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py\", line 53, in wrapped_app\n    await app(scope, receive, sender)\n  File \"/usr/local/lib/python3.12/site-packages/starlette/routing.py\", line 72, in app\n    response = await func(request)\n               ^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/site-packages/fastapi/routing.py\", line 278, in app\n    raw_response = await run_endpoint_function(\n                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/site-packages/fastapi/routing.py\", line 191, in run_endpoint_function\n    return await dependant.call(**values)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/app/strider/server.py\", line 694, in get_kps\n    for kp in registry.values()\n              ^^^^^^^^^^^^^^^\nAttributeError: 'NoneType' object has no attribute 'values'\n"}]}
maximusunc commented 3 weeks ago

I'm aware of this issue. Our KP registry is stored in a redis db, and it seems like Strider fails to connect to it fairly frequently. Error doesn't happen locally or in the other environments, so I'm a little stumped as to why it happens in DEV. Maybe I'll change this URL to the CI environment...