Closed jimmymathews closed 5 months ago
Related, there are times when a lightly-caught exception in the ondemand service is mishandled by the API service:
Host and port (with service "squidpy"): ('fast-counts-server', 8016)
ondemand | 03-18 23:33:34 [ INFO ] ondemand.request_handler: Request: b'co-occurrence\x1dMelanoma intralesional IL2\x1dCD3\x1eCD4\x1dCD20\x1eCD56\x1eCD8\x1eFOXP3\x1eSOX10\x1d100.0'
ondemand | 03-18 23:33:34 [ DEBUG ] ondemand.request_handler:228: ['Melanoma intralesional IL2', 'CD3\x1eCD4', 'CD20\x1eCD56\x1eCD8\x1eFOXP3\x1eSOX10', '100.0']
ondemand | 03-18 23:33:34 [ INFO ] ondemand.request_handler: Query to on-demand computation service could not be handled.
apiserver | INFO: 172.18.0.1:38940 - "GET /request-spatial-metrics-computation-custom-phenotype/?negative_marker=CD20&negative_marker=CD56&negative_marker=CD8&negative_marker=FOXP3&negative_marker=SOX10&positive_marker=CD3&positive_marker=CD4&study=Melanoma+intralesional+IL2&feature_class=co-occurrence&radius=100 HTTP/1.1" 500 Internal Server Error
apiserver | ERROR: Exception in ASGI application
apiserver | Traceback (most recent call last):
apiserver | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 108, in __call__
apiserver | response = await self.dispatch_func(request, call_next)
apiserver | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
...
apiserver | | File "/usr/local/lib/python3.11/site-packages/spatialprofilingtoolbox/apiserver/app/main.py", line 286, in get_squidpy_metrics
apiserver | | metrics = requester.get_squidpy_metrics(
apiserver | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apiserver | | File "/usr/local/lib/python3.11/site-packages/spatialprofilingtoolbox/ondemand/service_client.py", line 169, in get_squidpy_metrics
apiserver | | values=response['metrics'],
apiserver | | ~~~~~~~~^^^^^^^^^^^
apiserver | | KeyError: 'metrics'
apiserver | +------------------------------------
This is obsolete.
In some cases a pending metric that raises a ValueError fails to end the job and wrap up.
This causes infinitely pending metric calculation.