hubmapconsortium / ingest-api

MIT License
0 stars 0 forks source link

Troubleshoot Data Ingest Board call of `/uploads/data-status` #616

Closed yuanzhou closed 2 months ago

yuanzhou commented 2 months ago

Brendan reported that the Data Ingest Board took a while to load the data but the UI yields nothing.

image

Turned out the call to /uploads/data-status returned 500:

[2024-08-19 17:07:59] ERROR in app: Exception on /uploads/data-status [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/hubmap_commons/string_helper.py", line 96, in convert_str_literal
    data = ast.literal_eval(data_str)
  File "/usr/lib64/python3.9/ast.py", line 62, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/usr/lib64/python3.9/ast.py", line 50, in parse
    return compile(source, filename, mode, flags,
  File "<unknown>", line 1
    [Empty directory]
           ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/usr/src/app/src/./app.py", line 1956, in upload_data_status
    results = update_uploads_datastatus()
  File "/usr/src/app/src/./app.py", line 2819, in update_uploads_datastatus
    prop_as_list = string_helper.convert_str_literal(upload[prop])
  File "/usr/local/lib/python3.9/site-packages/hubmap_commons/string_helper.py", line 102, in convert_str_literal
    raise ValueError(f"Invalid expression (string value): {data_str} from ast.literal_eval(); "
ValueError: Invalid expression (string value): [Empty directory] from ast.literal_eval(); specific error: invalid syntax (<unknown>, line 1)
[pid: 121|app: 0|req: 14312/22360] 172.18.0.2 () {70 vars in 1232 bytes} [Mon Aug 19 17:07:59 2024] GET /uploads/data-status => generated 194 bytes in 72 msecs (HTTP/1.0 500) 2 headers in 91 bytes (1 switches on core 0)
yuanzhou commented 2 months ago

Seems to be the same issue from earlier: https://github.com/hubmapconsortium/ingest-api/pull/597 A proper parsing fix should be made to handle similar cases.