Project

General

Profile

Actions

Bug #12671

closed

scripts/create_superuser_token.rb returns existing superuser tokens rather than creating a new one

Added by Joshua Randall over 6 years ago. Updated about 4 years ago.

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

Description

The installation docs on installing the crunch dispatcher (http://doc.arvados.org/install/crunch2-slurm/install-dispatch.html) say:

Create an Arvados superuser token for use by the dispatcher. If you have multiple dispatch processes, you should give each one a different token.

However, when the command `RAILS_ENV=production bundle exec ./script/create_superuser_token.rb` is called as directed, it returns the same superuser token each time. There does not appear to be any way to get that script to generate multiple different tokens using that script.

Worse, if I try to use the script to set an API token to one I have generated (by passing the token as the first argument to `create_superuser_token.rb`), but a superuser token already exists on the server, it returns the existing one rather than the one I have specified on the command line.

Actions #1

Updated by Joshua Randall over 6 years ago

A workaround is to delete the penultimate block in lib/create_superuser_token.rb:

#        api_client_auth =
#          ApiClientAuthorization.
#          where(user_id: system_user.id).
#          where(api_client_id: apiClient.id).
#          where_serialized(:scopes, ['all']).
#          where('(expires_at IS NULL OR expires_at > CURRENT_TIMESTAMP)').
#          first

I'm really not sure what the purpose of that block is, other than to cause problems for people trying to create multiple tokens.

Actions #2

Updated by Peter Amstutz about 4 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF