Skip to content

Account delete fails after upgrade when its project was deleted before the upgrade #14849

Backlog

Description

@RosiKyu

Problem

An account that was added to a project with a user role (for example addUserToProject roletype=Admin), whose project was then deleted on a version without the fix from #14150, cannot be deleted after upgrading to a version with that fix. deleteAccount fails with "Unable to delete account [5], because it manages the following project(s): [1]. Please, remove the account from these projects or demote it to a regular project role first." The project named in the error is no longer listed in listProjects, so the account cannot be removed from it.

Versions

Seen when upgrading from 4.20.3.1 to the #14150 PR packages (4.20 branch), KVM, 2 hosts.

The steps to reproduce the bug

  1. On 4.20.3.1, create an account with a User role, create a project, and add the account's user to the project with addUserToProject roletype=Admin.
  2. Delete the project with deleteProject cleanup=true. The project is removed.
  3. Upgrade to a version that includes server: remove user-project mappings when delete a project #14150.
  4. Disable and delete the account.

What to do about it?

Expected Result: the account is deleted, as it is for projects deleted after the upgrade.

Actual Result: deleteAccount fails with the error above, and the project it names is not listed in listProjects.

Activity

  1. weizhouapache commented on Nov 25, 2026

    @weizhouapache
    Member

    thanks @RosiKyu a lot for reporting

    I think this issue requires some SQL changes, as mentioned in #13456.
    The change itself is small, but since the issue affects all supported versions, we may need to create separate PRs targeting 4.20, 4.22 and main.

  2. added theissue type on Nov 25, 2026
  3. added this to the 4.20.4 milestone on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions