Bug #21743
closedRailsAPI UsersController treating include_trash="true" as false
Description
I am seeing this warning repeatedly in a production.log file on a 2.7.2 cluster:
[req-abmr65fqf3c1tvgrv82j] Warning: received non-boolean value "true" for boolean parameter include_trash on Arvados::V1::UsersController, treating as false.
{"method":"GET","path":"/arvados/v1/users/zyxwv-tpzed-000000000000000","format":"html","controller":"Arvados::V1::UsersController","action":"show","status":200,"duration":2.66,"view":0.18,"db":0.5,"ClusterID":"zyxwv","request_id":"req-abmr65fqf3c1tvgrv82j","client_ipaddr":"127.0.0.1","client_auth":"zyxwv-gj3su-…","params":{"include_trash":"true","select":"[\"uuid\"]"},"@timestamp":"2024-05-03T05:55:49.340570476Z","@version":"1","message":"[200] GET /arvados/v1/users/zyxwv-tpzed-000000000000000 (Arvados::V1::UsersController#show)"}
[req-tawpyqr0exoa2p9lb70z] Warning: received non-boolean value "true" for boolean parameter include_trash on Arvados::V1::UsersController, treating as false.
{"method":"GET","path":"/arvados/v1/users/zyxwv-tpzed-…","format":"html","controller":"Arvados::V1::UsersController","action":"show","status":200,"duration":2.55,"view":0.15,"db":0.53,"ClusterID":"zyxwv","request_id":"req-tawpyqr0exoa2p9lb70z","client_ipaddr":"127.0.0.1","client_auth":"zyxwv-gj3su-…","params":{"include_trash":"true","select":"[\"uuid\"]"},"@timestamp":"2024-05-03T05:55:49.387524517Z","@version":"1","message":"[200] GET /arvados/v1/users/zyxwv-tpzed-… (Arvados::V1::UsersController#show)"}
Whatever the original source is, the client is probably expecting trash to actually be included.
Updated by Peter Amstutz almost 2 years ago
The 'users' endpoint doesn't support 'trash', so that is double confusing, it should just ignore it or discard it.
Because groups support trash, it could be coming from code that is looking up both users and groups, and trying to treat them as the same.
Updated by Peter Amstutz over 1 year ago
- Target version set to Development 2024-12-04
Updated by Peter Amstutz over 1 year ago
- Target version changed from Development 2024-12-04 to Development 2024-11-20
Updated by Tom Clegg over 1 year ago
21743-users-include-trash @ dfde8b40de51ee7b6cf5c09e8ff77ad7b5deda66 -- developer-run-tests: #4553
21743-users-include-trash @ dfde8b40de51ee7b6cf5c09e8ff77ad7b5deda66 -- developer-run-tests: #4555
The issue was that the generic ApplicationController code converts "true" to true, etc., only for params that are listed by the subclass's _{action}_requires_parameters, but then find_objects_for_index calls bool_param(:include_trash) whether or not :include_trash was listed. If it wasn't, params[:include_trash] is still a string, so bool_param() logs a warning.
_index_requires_parameters before calling bool_param so that, in controllers where include_trash is not expected/documented,
include_trash=truein query string is ignored without producing a warning log, and{"include_trash":true}in JSON request body is also ignored
Updated by Brett Smith over 1 year ago
Tom Clegg wrote in #note-5:
21743-users-include-trash @ dfde8b40de51ee7b6cf5c09e8ff77ad7b5deda66 -- developer-run-tests: #4555
LGTM, thanks.
Updated by Tom Clegg over 1 year ago
- Status changed from In Progress to Resolved
Applied in changeset arvados|f1d88cfac8b5f4988dba954ccbad1388e3c6c66b.