apache / apache/cloudstack

Unable to delete account if the project is removed

Đang mở
#12,601 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
component:management-server Severity:Major type:bug
Ngôn ngữ chính
Java
Star
3.1k
Fork
1.4k
Merge trung bình
6 ngày 19 giờ
Pull request đã merge (30 ngày)
32

Mô tả

### problem

Unable to delete account if the project is removed

### versions

ACS 4.22

### The steps to reproduce the bug

1. Create a project

Image

2. Create a account/user with User role

Image

3. Add User to the project, Select the project role as Admin

Image

5. Delete the project with clean up option

Image

6. Delete the user

Image

7. Disable the account and Delete the account >> Exception observed

Image

```
2026-02-06 05:19:09,201 DEBUG [c.c.a.ApiServer] (qtp1390913202-23:[ctx-52b15b57, ctx-b39021de]) (logid:c0aa78bd) Retrieved cmdEventType from job info: ACCOUNT.DELETE
2026-02-06 05:19:09,203 INFO [o.a.c.f.j.i.AsyncJobMonitor] (API-Job-Executor-22:[ctx-54696ea9, job-166]) (logid:92e3ffb4) Add job-166 into job monitoring
2026-02-06 05:19:09,204 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (qtp1390913202-23:[ctx-52b15b57, ctx-b39021de]) (logid:c0aa78bd) submit async job-166, details: AsyncJob {"accountId":2,"cmd":"org.apache.cloudstack.api.command.admin.account.DeleteAccountCmd","cmdInfo":"{\"response\":\"json\",\"ctxUserId\":\"2\",\"sessionkey\":\"nDTziuDnO4qxnRScKDVyKQTZukU\",\"httpmethod\":\"POST\",\"ctxStartEventId\":\"623\",\"id\":\"f004ffb3-f8d0-4297-8951-fc83bdd10fad\",\"ctxDetails\":\"{\\\"interface com.cloud.user.Account\\\":\\\"f004ffb3-f8d0-4297-8951-fc83bdd10fad\\\"}\",\"ctxAccountId\":\"2\",\"uuid\":\"f004ffb3-f8d0-4297-8951-fc83bdd10fad\",\"cmdEventType\":\"ACCOUNT.DELETE\"}","cmdVersion":0,"completeMsid":null,"created":null,"id":166,"initMsid":32988016411316,"instanceId":12,"instanceType":"Account","lastPolled":null,"lastUpdated":null,"processStatus":0,"removed":null,"result":null,"resultCode":0,"status":"IN_PROGRESS","userId":2,"uuid":"1ba7a022-f715-4df5-a771-99e59e80e38f"}
2026-02-06 05:19:09,204 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl$5] (API-Job-Executor-22:[ctx-54696ea9, job-166]) (logid:1ba7a022) Executing AsyncJob {"accountId":2,"cmd":"org.apache.cloudstack.api.command.admin.account.DeleteAccountCmd","cmdInfo":"{\"response\":\"json\",\"ctxUserId\":\"2\",\"sessionkey\":\"nDTziuDnO4qxnRScKDVyKQTZukU\",\"httpmethod\":\"POST\",\"ctxStartEventId\":\"623\",\"id\":\"f004ffb3-f8d0-4297-8951-fc83bdd10fad\",\"ctxDetails\":\"{\\\"interface com.cloud.user.Account\\\":\\\"f004ffb3-f8d0-4297-8951-fc83bdd10fad\\\"}\",\"ctxAccountId\":\"2\",\"uuid\":\"f004ffb3-f8d0-4297-8951-fc83bdd10fad\",\"cmdEventType\":\"ACCOUNT.DELETE\"}","cmdVersion":0,"completeMsid":null,"created":null,"id":166,"initMsid":32988016411316,"instanceId":12,"instanceType":"Account","lastPolled":null,"lastUpdated":null,"processStatus":0,"removed":null,"result":null,"resultCode":0,"status":"IN_PROGRESS","userId":2,"uuid":"1ba7a022-f715-4df5-a771-99e59e80e38f"}
2026-02-06 05:19:09,205 DEBUG [c.c.a.ApiServlet] (qtp1390913202-23:[ctx-52b15b57, ctx-b39021de]) (logid:c0aa78bd) ===END=== 10.0.3.251 -- POST
command=deleteAccount
response=json
id=f004ffb3-f8d0-4297-8951-fc83bdd10fad
sessionkey=nDTziuDnO4qxnRScKDVyKQTZukU

2026-02-06 05:19:09,207 DEBUG [c.c.u.AccountManagerImpl] (API-Job-Executor-22:[ctx-54696ea9, job-166, ctx-32d73b76]) (logid:1ba7a022) Account [Account [{"accountName":"admin","id":2,"uuid":"ef7f35bc-fffc-11f0-8d07-1e009f0002b4"}]] has access to resource.
2026-02-06 05:19:09,223 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-22:[ctx-54696ea9, job-166]) (logid:1ba7a022) Complete async job-166, jobStatus: FAILED, resultCode: 431, result: org.apache.cloudstack.api.response.ExceptionResponse/null/{"uuidList":[],"errorcode":"431","errortext":"Unable to delete account [12], because it manages the following project(s): [4]. Please, remove the account from these projects or demote it to a regular project role first."}

```

### What to do about it?

Account should get deleted

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với API deleteAccount và điểm vào DeleteAccountCmd được hiển thị trong log, sau đó tái hiện chuỗi dọn dẹp tài khoản và dự án được mô tả trong issue. Theo dõi lỗi báo cáo rằng dự án đã bị xóa vẫn còn được tài khoản quản lý. Hoàn tất khi tài khoản có thể được vô hiệu hóa và xóa sau khi dự án của tài khoản đã được xóa với tính năng dọn dẹp được bật.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
api, backend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.