Actions
Bug #19297
closedRailsAPI error when filtering by an inexistent column
Status:
Resolved
Priority:
Normal
Assigned To:
Category:
API
Target version:
Start date:
07/27/2022
Due date:
% Done:
100%
Estimated time:
(Total: 0.00 h)
Story points:
-
Release:
Release relationship:
Auto
Description
Workbench2 since v2.4.1 added arvados#workflow
to the list of object types to include in its properties advanced search. The following is an example of filter passed to the controller:
[["groups.properties.IDTAGANIMALS","contains","IDVALANIMALS2"],["collections.properties.IDTAGANIMALS","contains","IDVALANIMALS2"],["container_requests.properties.IDTAGANIMALS","contains","IDVALANIMALS2"],["properties","exists","IDTAGANIMALS"],["uuid","is_a",["arvados#group","arvados#collection","arvados#containerRequest"]],["uuid","is_a",["arvados#group","arvados#containerRequest","arvados#collection","arvados#workflow"]]]
This generate an error message like: 422 Unprocessable Entity: #<NoMethodError: undefined method `type' for nil:NilClass>
An example of backtrace from ce8i5:
"/var/www/arvados-api/current/lib/record_filters.rb:139:in `block (2 levels) in record_filters' /var/www/arvados-api/current/lib/record_filters.rb:61:in `each' /var/www/arvados-api/current/lib/record_filters.rb:61:in `block in record_filters' /var/www/arvados-api/current/lib/record_filters.rb:32:in `each' /var/www/arvados-api/current/lib/record_filters.rb:32:in `record_filters' /var/www/arvados-api/current/app/models/arvados_model.rb:573:in `apply_filters' /var/www/arvados-api/current/app/controllers/application_controller.rb:227:in `apply_filters' /var/www/arvados-api/current/app/controllers/application_controller.rb:232:in `apply_where_limit_order_params' /var/www/arvados-api/current/app/controllers/arvados/v1/groups_controller.rb:321:in `block in load_searchable_objects' /var/www/arvados-api/current/app/controllers/arvados/v1/groups_controller.rb:266:in `each' ...
The workflows table doesn't currently have a properties
column so it would seem that the code at record_filters.rb
isn't handling this correctly.
Actions