galaxyproject / galaxy

Data intensive science for everyone.
https://galaxyproject.org
Other
1.38k stars 992 forks source link

Uncaught exception in exposed API method: KeyError: 'name' when loading the bakta tool #18749

Open sanjaysrikakulam opened 1 month ago

sanjaysrikakulam commented 1 month ago

In the EU, a user encounters a KeyError: 'name' when loading the bakta tool in Galaxy. The error occurs consistently for this specific tool, regardless of the Galaxy history used (attempted with a different history). Other tools load without issues.

Galaxy version:

{
  "version_major": "24.1",
  "version_minor": "2.dev0"
}

Traceback

Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]: uvicorn.access INFO 2024-08-30 09:08:38,238 [pN:main.4,p:832442,tN:MainThread] X.X.X.X:0 - "GET /history/current_history_json?since=2024-08-02T04:38:55.342267 HTTP/1.0" 200
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]: galaxy.web.framework.decorators ERROR 2024-08-30 09:08:38,257 [pN:main.3,p:832409,tN:WSGI_1] Uncaught exception in exposed API method:
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]: Traceback (most recent call last):
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:   File "/opt/galaxy/server/lib/galaxy/web/framework/decorators.py", line 346, in decorator
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:     rval = func(self, trans, *args, **kwargs)
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:   File "/opt/galaxy/server/lib/galaxy/webapps/galaxy/api/tools.py", line 247, in build
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:     return tool.to_json(trans, kwd.get("inputs", kwd), history=history)
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:   File "/opt/galaxy/server/lib/galaxy/tools/__init__.py", line 2510, in to_json
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:     populate_state(request_context, self.inputs, params.__dict__, state_inputs, state_errors)
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:   File "/opt/galaxy/server/lib/galaxy/tools/parameters/__init__.py", line 412, in populate_state
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:     _populate_state_legacy(
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:   File "/opt/galaxy/server/lib/galaxy/tools/parameters/__init__.py", line 525, in _populate_state_legacy
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:     state[input.name] = input.get_initial_value(request_context, context)
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:   File "/opt/galaxy/server/lib/galaxy/tools/parameters/grouping.py", line 233, in get_initial_value
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:     rval[child_input.name] = child_input.get_initial_value(trans, child_context)
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:   File "/opt/galaxy/server/lib/galaxy/tools/parameters/basic.py", line 1118, in get_initial_value
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:     options = list(self.get_options(trans, other_values))
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:   File "/opt/galaxy/server/lib/galaxy/tools/parameters/basic.py", line 970, in get_options
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:     return self.options.get_options(trans, other_values)
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:   File "/opt/galaxy/server/lib/galaxy/tools/parameters/dynamic_options.py", line 888, in get_options
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:     options = self.get_fields(trans, other_values)
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:   File "/opt/galaxy/server/lib/galaxy/tools/parameters/dynamic_options.py", line 760, in get_fields
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:     options += self.get_user_options(trans.user)
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:   File "/opt/galaxy/server/lib/galaxy/tools/parameters/dynamic_options.py", line 787, in get_user_options
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:     field_entry.append(data_table_entry[column_key])
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]:                        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]: KeyError: 'name'
Aug 30 09:08:38 sn06.galaxyproject.eu gunicorn[818768]: uvicorn.access INFO 2024-08-30 09:08:38,279 [pN:main.3,p:832409,tN:MainThread] X.X.X.X:0 - "HEAD /api/tools/toolshed.g2.bx.psu.edu/repos/iuc/bakta/bakta/1.9.3%2Bgalaxy0/build?version=latest&tool_version=latest HTTP/1.0" 500

They get the same error via cURL as well

$ curl -I 'https://usegalaxy.eu/api/tools/toolshed.g2.bx.psu.edu/repos/iuc/bakta/bakta/1.9.3+galaxy0/build?version=latest&tool_version=latest' -H 'Cookie: galaxysession=<SESSION TOKEN>'

HTTP/2 500
...
{"err_msg": "Uncaught exception in exposed API method:", "err_code": 0}
sanjaysrikakulam commented 1 month ago

ping @bebatut

abretaud commented 1 month ago

I think this tool had some changes in the columns of its data table, since one of the last versions, maybe it comes from that

bebatut commented 1 month ago

But everyone else can load the tool and it works when I am not logged in

abretaud commented 1 month ago

oh ah yes... so you're doomed I guess :/

bebatut commented 1 month ago

It works now after I deleted some old histories. In some of these histories, I ran previous versions of Bakta when there were some issues with the changes in the data table. Could that be the error?