Project

General

Profile

Actions

Bug #21743

closed

RailsAPI UsersController treating include_trash="true" as false

Added by Brett Smith 7 months ago. Updated 9 days ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
API
Target version:
Story points:
-

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.


Subtasks 1 (0 open1 closed)

Task #22309: Review 21743-users-include-trashResolvedBrett Smith11/12/2024Actions
Actions #1

Updated by Peter Amstutz 7 months 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.

Actions #2

Updated by Peter Amstutz 17 days ago

  • Target version set to Development 2024-12-04
Actions #3

Updated by Peter Amstutz 14 days ago

  • Target version changed from Development 2024-12-04 to Development 2024-11-20
Actions #4

Updated by Peter Amstutz 14 days ago

  • Assigned To set to Tom Clegg
Actions #5

Updated by Tom Clegg 10 days 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.

This fix checks _index_requires_parameters before calling bool_param so that, in controllers where include_trash is not expected/documented,
  • include_trash=true in query string is ignored without producing a warning log, and
  • {"include_trash":true} in JSON request body is also ignored
Actions #6

Updated by Tom Clegg 10 days ago

  • Status changed from New to In Progress
Actions #7

Updated by Brett Smith 9 days ago

Tom Clegg wrote in #note-5:

21743-users-include-trash @ dfde8b40de51ee7b6cf5c09e8ff77ad7b5deda66 -- developer-run-tests: #4555

LGTM, thanks.

Actions #8

Updated by Tom Clegg 9 days ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF