Project

General

Profile

Actions

Bug #16981

closed

"sync-groups" tool doesn't find groups when running on a LoginCluster federation

Added by Lucas Di Pentima over 3 years ago. Updated over 3 years ago.

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

Description

When using arvados-sync-groups on a federated cluster with Login.LoginCluster pointing to other cluster, the tool assumes that the needed groups should be owned by the LoginCluster's system user instead of the local system user.

This affects external groups that were synchronized before setting up the federation, because it will try to create a group named "Externally synchronized groups" and it will collide with the preexisting one.


Subtasks 1 (0 open1 closed)

Task #16986: Review 16981-logincluster-sync-groups-testsResolvedNico César01/08/2021Actions
Actions #1

Updated by Lucas Di Pentima over 3 years ago

Fix at ab9833a2d - branch 16981-logincluster-sync-groups-fix
Test run: developer-run-tests: #2134

  • Fixed the problem by retrieving the local cluster ID from the exported config instead of assuming it from the user's uuid.
Actions #2

Updated by Lucas Di Pentima over 3 years ago

Manual testing was done by setting up a LoginCluster federation with a couple of arvbox instances A (main cluster) and B (satellite cluster)
Previous to setting up the federation, created some users and ran the tool with some groups on the B instance.
Then, set up the federation and ran the migrate users script to migrate B users to A.
As a last step into confirming the bug, ran again the arvados-sync-groups tool with the A's admin user credentials from cluster B. Got the following error:

(venv-arvados) lucas@buster:~/arvados/tools/sync-groups$ ./sync-groups -user-id=username ../../test-groups.csv
2020/10/08 15:11:14 error creating system user owned group named "Externally synchronized groups": request failed: https://172.17.0.3:8000//arvados/v1/groups: 422 Unprocessable Entity: #<ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_groups_on_owner_uuid_and_name" 
DETAIL:  Key (owner_uuid, name)=(x1ejm-tpzed-000000000000000, Externally synchronized groups) already exists.
: INSERT INTO "groups" ("uuid", "owner_uuid", "created_at", "modified_by_user_uuid", "modified_at", "name", "updated_at", "group_class") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"> (req-28280i3qiygt1p4asl8e)

After the fix, the tool started to work again. Did some changes on the CSV files and re-applied; the changes were done correctly.

Actions #3

Updated by Lucas Di Pentima over 3 years ago

  • Target version changed from 2020-10-21 Sprint to 2020-11-04 Sprint
Actions #4

Updated by Lucas Di Pentima over 3 years ago

  • Target version changed from 2020-11-04 Sprint to 2020-11-18
Actions #5

Updated by Lucas Di Pentima over 3 years ago

  • Target version changed from 2020-11-18 to 2020-12-02 Sprint
Actions #6

Updated by Lucas Di Pentima over 3 years ago

  • Target version changed from 2020-12-02 Sprint to 2020-12-16 Sprint
Actions #7

Updated by Lucas Di Pentima over 3 years ago

  • Target version changed from 2020-12-16 Sprint to 2021-01-06 Sprint
Actions #8

Updated by Lucas Di Pentima over 3 years ago

  • Target version changed from 2021-01-06 Sprint to 2021-01-20 Sprint
Actions #9

Updated by Lucas Di Pentima over 3 years ago

Updates at 59e8b47be - branch 16981-logincluster-sync-groups-tests
Test run: developer-run-tests: #2254

  • Extracts arvados-boot based helper functions from lib/controller/integration_test.go into the arvadostest package.
  • Adds federation test on arvados-sync-groups that confirms the tool works on a federated cluster with admin credentials from the LoginCluster.
Actions #10

Updated by Lucas Di Pentima over 3 years ago

Updates at c271137b5
Test run: developer-run-tests: #2255
API Test re-run: developer-run-tests-services-api: #2362

Fixes go import cycle problems.

Actions #11

Updated by Nico César over 3 years ago

review @ c271137b5 LGTM

Actions #12

Updated by Lucas Di Pentima over 3 years ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF