Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User assignments-list gets longer after every restart on default users #3432

Closed
AlexAndBear opened this issue Mar 31, 2022 · 3 comments · Fixed by #5826
Closed

User assignments-list gets longer after every restart on default users #3432

AlexAndBear opened this issue Mar 31, 2022 · 3 comments · Fixed by #5826
Labels

Comments

@AlexAndBear
Copy link
Contributor

Describe the bug

User assignments-list gets longer after every restart on default users
image

Steps to reproduce

Steps to reproduce the behavior:

  1. Start ocis
  2. POST https://localhost:9200/api/v0/settings/assignments-list with payload { "account_uuid": "058bff95-6708-4fe5-91e4-9ea3d377588b" }
  3. Observe the length of the assignments
  4. Kill ocis
  5. Start ocis
  6. POST https://localhost:9200/api/v0/settings/assignments-list with payload { "account_uuid": "058bff95-6708-4fe5-91e4-9ea3d377588b" }
  7. Observe that the assignment list have more items, than before

Expected behavior

The assignment list should not have more items after kill and start ocis for no reason

Actual behavior

User assignments-list gets longer after every restart on default users

Setup

Please describe how you started the server and provide a list of relevant environment variables.

OCIS_VERSION=vX.X.X
BRANCH=vX.X.X
STORAGE_FRONTEND_UPLOAD_DISABLE_TUS=false

Additional context

Add any other context about the problem here.

@rhafer
Copy link
Contributor

rhafer commented May 3, 2022

Some notes: This only happens when using the "metadata" storage for settings (which is our default since a few weeks). When using "metadata" the default assignments are only created when processing the first (wrirte) request on the settings API.

@wkloucek
Copy link
Contributor

wkloucek commented Nov 25, 2022

could not reproduce on 7f68049 (post 2.0.0rc.1)

@rhafer
Copy link
Contributor

rhafer commented Nov 28, 2022

This but is definitely still present in current master:

ocis/bin/ocis init --insecure true --ap admin
PROXY_ENABLE_BASIC_AUTH=true ocis/bin/ocis server

now list assignments:

curl -XPOST "https://localhost:9200/api/v0/settings/assignments-list" -d'{"account_uuid": "me"}' -uadmin:admin -k | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   334  100   312  100    22   2310    162 --:--:-- --:--:-- --:--:--  2492
{
  "assignments": [
    {
      "id": "8129e0fc-8956-47cc-b997-157667bd316c",
      "accountUuid": "09a0500d-f175-4778-9f4d-c1ec1d69b5e5",
      "roleId": "71881883-1768-46bd-a24d-a356a2afdf7f"
    },
    {
      "id": "1a638431-a524-4e51-bbe5-ef53e5193a2c",
      "accountUuid": "09a0500d-f175-4778-9f4d-c1ec1d69b5e5",
      "roleId": "71881883-1768-46bd-a24d-a356a2afdf7f"
    }
  ]
}

Having the admin role assigment twice is already a bug. But when you restart restart ocis and list assignments again you get it listed 4 times.:

curl -XPOST "https://localhost:9200/api/v0/settings/assignments-list" -d'{"account_uuid": "me"}' -uadmin:admin -k | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   628  100   606  100    22   3376    122 --:--:-- --:--:-- --:--:--  3488
{
  "assignments": [
    {
      "id": "8129e0fc-8956-47cc-b997-157667bd316c",
      "accountUuid": "09a0500d-f175-4778-9f4d-c1ec1d69b5e5",
      "roleId": "71881883-1768-46bd-a24d-a356a2afdf7f"
    },
    {
      "id": "1a638431-a524-4e51-bbe5-ef53e5193a2c",
      "accountUuid": "09a0500d-f175-4778-9f4d-c1ec1d69b5e5",
      "roleId": "71881883-1768-46bd-a24d-a356a2afdf7f"
    },
    {
      "id": "67a28885-6f75-43f9-87f6-2fb528136f4e",
      "accountUuid": "09a0500d-f175-4778-9f4d-c1ec1d69b5e5",
      "roleId": "71881883-1768-46bd-a24d-a356a2afdf7f"
    },
    {
      "id": "17a99600-196d-4f68-b31c-f6ccf083440b",
      "accountUuid": "09a0500d-f175-4778-9f4d-c1ec1d69b5e5",
      "roleId": "71881883-1768-46bd-a24d-a356a2afdf7f"
    }
  ]
}

I think this only happens for admin and demo-users.

@rhafer rhafer reopened this Nov 28, 2022
rhafer added a commit to rhafer/ocis that referenced this issue Mar 14, 2023
When using the metadata storage (the current default) the default role
assignments were recreated at every start of the settings service. Leading to
duplicated role assignments

Fixes: owncloud#3432
rhafer added a commit to rhafer/ocis that referenced this issue Mar 14, 2023
When using the metadata storage (the current default) the default role
assignments were recreated at every start of the settings service. Leading to
duplicated role assignments

Fixes: owncloud#3432
@micbar micbar mentioned this issue May 3, 2023
89 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants