Skip to content

Admin user deletion fails with authorization error despite misleading success logs #1176

@SalimKayal

Description

@SalimKayal

Description

Summary

When attempting to delete any admin user through the Renku API, the operation returns a permission error (code 1404) with misleading success logs. The user remains in both databases despite logs claiming successful deletion. This occurs even when deleting different admin users, and the authorization system (SpiceDB) consistently blocks the operation.

Steps to Reproduce

  1. Log in as an admin user
  2. Attempt to delete another user (Admin2) via the Swagger API endpoint
  3. Note: Deletion of Admin1 user (ea209425-eaa2-43d8-9271-1cda870ffd3c) also fails with the same error
  4. Verify the user remains in both databases

Expected Behavior

  • Admin users should be able to delete other users
  • Authorization checks should pass for valid operations
  • Logs should accurately reflect transaction outcomes

Actual Behavior

API Response:

{
  "error": {
    "code": 1404,
    "message": "The user with ID df9b9993-ed85-4f81-8a5a-64692e0a7f62 cannot perform operation Scope.DELETE on user with ID 00c40bad-a4bf-40a0-8ff5-5fb7de3f6282 or the resource does not exist."
  }
}

Misleading Logs:

2026-01-15T16:56:02.931631 [INFO] - remove_user: Trying to remove user with ID 00c40bad-a4bf-40a0-8ff5-5fb7de3f6282
2026-01-15T16:56:02.936110 [INFO] - User with ID 00c40bad-a4bf-40a0-8ff5-5fb7de3f6282 was removed from the database.
2026-01-15T16:56:02.936197 [INFO] - User namespace with ID 00c40bad-a4bf-40a0-8ff5-5fb7de3f6282 was removed from the authorization database.

Database State - User NOT Deleted:

Renku database (users.users):

             keycloak_id              | first_name | last_name |         email         | id
--------------------------------------+------------+-----------+-----------------------+----
 ea209425-eaa2-43d8-9271-1cda870ffd3c | Admin1     | ADMIN1    | admin1.admin1@myorg.com | 11
 00c40bad-a4bf-40a0-8ff5-5fb7de3f6282 | Admin2     | ADMIN2    | admin2.admin2@myorg.com | 12
 df9b9993-ed85-4f81-8a5a-64692e0a7f62 | Admin2     | ADMIN2    | admin2.admin2@myorg.com | 13

Authorization Database - User Still Has Admin Role:

 relation | userset_namespace |          userset_object_id
----------+-------------------+--------------------------------------
 admin    | user              | 00c40bad-a4bf-40a0-8ff5-5fb7de3f6282
 admin    | user              | df9b9993-ed85-4f81-8a5a-64692e0a7f62
 admin    | user              | ea209425-eaa2-43d8-9271-1cda870ffd3c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions