Bug #18801
closedRequesting ApiClientAuthorization object with select=["uuid"] returns 422
100%
Description
We've received a report about arvados-ws
getting errors from the API server.
This is what happens:
$ curl -k -G --data-urlencode 'select=["uuid"]' -H "Authorization: OAuth2 ---token---" https://example-host/arvados/v1/api_client_authorizations/some-valid-uuid {"errors":["//railsapi.internal/arvados/v1/api_client_authorizations/some-valid-uuid?select=%5B%22uuid%22%5D: 422 Unprocessable Entity: #\u003cActiveModel::MissingAttributeError: missing attribute: api_token\u003e (req-c2h9urh6s0p0xvowm555)"]}
The arvados-ws
services does a request like this and it has been doing it since 2017 (line 80):
RailsAPI attempts to access the api_token
field in an after_initialize
hook:
...but because the request does a select=["uuid"]
, that field isn't available.
Manual testing with arvbox
determined that this is a regression introduced in the 2.3.0 release.
Updated by Lucas Di Pentima almost 3 years ago
It seems that this could be the cause of the regression: https://dev.arvados.org/issues/18122
Updated by Lucas Di Pentima almost 3 years ago
Updates at 36c6d8e6b - branch 18801-aca-req-select-uuid
Test run: developer-run-tests: #2931
- Ignores the
ActiveModel::MissingAttributeError
when theapi_token
field isn't present, because of usingselect=[...]
. - Adds test.
Updated by Lucas Di Pentima almost 3 years ago
- Status changed from In Progress to Resolved
Applied in changeset arvados-private:commit:arvados|0dcb211b2c2511b86d9bd55c1e059bf44342ca91.
Updated by Lucas Di Pentima almost 3 years ago
Cherry-picked into branch 2.3-release
at 0336418