Fix db error reporting - #1
Conversation
| @@ -137,7 +137,7 @@ async def get_artifacts_by_task(self, request): | |||
| ) | |||
There was a problem hiding this comment.
self._async_table.get_artifact_in_task(...) returns a DBResponse with .body attribute of type string and a .response_code of 500, indicating an error. The string-type body is set in db_utils.aiopg_exception_handling.
ArtifactsApi._filter_artifacts_by_attempt_id(...) expects artifacts.body to be a list, which is what get_artifact_in_task returns when no error has occurred (and fetch_single==False, which is the case in get_artifact_in_task). In the event of no error, .response_code == 200.
|
If this works for us, will we create the same pull request for the main project? |
Yeah, I think that's the plan. Tim has fixed the underlying problem that caused an error to be raised in the first place, so I think that fix and this will go into a single PR for Netflix's repo. Tim's fix changed the db schema slightly (adding an index appropriate for the SFN runs), so he said he would need to define a migration as well. |
|
Sorry I thought I approved this with my earlier comment. |
|
Oops, this was on the backburner. I'm just going to put in a PR with metaflow-service. Thanks for reviewing it. |
|
Here is the PR: Netflix#93 |
From what I can tell, this will fix the obfuscation of the error message contained in the
DBResponse.body.Some context, from Tim:
I'm trying to take a look at the artifacts associated with one of our SFN executions but when trying to call:
We run into the following error:
Looking at the logs from our metadata service, I see the following error:
From what I can tell, this can only occur when the result of this call: https://github.com/Netflix/metaflow-service/blob/b656d42cfb946b5ec64ef15b4f5e86a1505a4e90/services/data/postgres_async_db.py#L112-L156 returns a
DBResponseobject with a body of type string. And it looks like this would only happen in the case of error handling. Unfortunately it looks like the underlying error message is obfuscated by this error.