Project

General

Profile

Actions

Bug #19297

closed

RailsAPI error when filtering by an inexistent column

Added by Lucas Di Pentima over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
API
Target version:
Story points:
-
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.


Subtasks 1 (0 open1 closed)

Task #19304: Review 19297-inexistent-field-filter-fixResolvedLucas Di Pentima07/27/2022Actions
Actions

Also available in: Atom PDF