Bug #16613

System Root Token cannot create tokens - null value in column "api_client_id"

Added by Peter Amstutz over 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
08/25/2020
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-
Release relationship:
Auto

Description

Could not create API token for zzzzz-tpzed-fzbnjxd9v7v4l6j: <HttpError 422 when requesting https://api.zzzzz.example.com/arvados/v1/api_client_authorizations?alt=json returned "#<ActiveRecord::StatementInvalid: PG::NotNullViolation: ERROR: null value in column "api_client_id" violates not-null constraint

I think the problem is here:

https://dev.arvados.org/projects/arvados/repository/revisions/master/entry/services/api/app/controllers/arvados/v1/api_client_authorizations_controller.rb#L46

When using system root token, there's no api_client (we create a fake ApiClient object so that this doesn't crash). But when creating a token for another user, it takes the api_client of the current token, which is null.


Subtasks

Task #16692: Review 16613-sys-root-tokResolvedPeter Amstutz


Related issues

Related to Arvados - Bug #16566: [cli] can't create a token when using a token created with create_superuser_token.rbNew

Associated revisions

Revision 5895b271
Added by Peter Amstutz about 1 year ago

Merge branch '16613-sys-root-tok' refs #16613

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <>

History

#1 Updated by Peter Amstutz over 1 year ago

  • Description updated (diff)

#2 Updated by Ward Vandewege over 1 year ago

  • Related to Bug #16566: [cli] can't create a token when using a token created with create_superuser_token.rb added

#3 Updated by Peter Amstutz about 1 year ago

  • Release set to 25

#4 Updated by Peter Amstutz about 1 year ago

  • Assigned To set to Peter Amstutz
  • Subject changed from System Root Token cannot create tokens - null value in column "api_client_id" to System Root Token cannot create tokens - null value in column "api_client_id"

#5 Updated by Peter Amstutz about 1 year ago

  • Status changed from New to In Progress

#6 Updated by Peter Amstutz about 1 year ago

16613-sys-root-tok @ ab767ee94ac40e31d67e1eee8ad0f79fe38ca7ed

https://ci.arvados.org/view/Developer/job/developer-run-tests/2034/

  • Seed the database with a special "SystemRootToken" ApiClient record that is used for the ephemeral SystemRootToken, and any tokens created using the SystemRootToken.

#7 Updated by Lucas Di Pentima about 1 year ago

This LGTM, thanks!

#8 Updated by Peter Amstutz about 1 year ago

  • Target version changed from 2020-08-26 Sprint to 2020-09-09 Sprint

#9 Updated by Peter Amstutz about 1 year ago

  • Status changed from In Progress to Resolved

Also available in: Atom PDF