github-actions[bot] commented on issue #9477:
URL: https://github.com/apache/cloudstack/issues/9477#issuecomment-4856143897

   ## ๐ŸŽฏ Triage report
   
   When a user account is deleted, its userdata is removed from the DB, but the 
`user_data_id` foreign key on `vm_template` is not nulled out. This leaves 
templates pointing to a deleted/non-existent userdata record, causing 404 
errors in the UI and deployment failures. A PR (#11595) is already in flight 
with the agreed fix of setting `user_data_id = NULL` on affected templates 
during user deletion.
   
   ### ๐Ÿ“Š Assessment
   
   | Dimension | Value | Reasoning |
   |---|---|---|
   | **Type** | type:bug | Data-integrity defect โ€” dangling FK after account 
deletion |
   | **Component** | component:management-server | Server-side account removal 
logic |
   | **Severity** | Severity:Minor | Causes errors only when deploying from 
affected templates; workaround exists (re-link or remove userdata) |
   | **Labels** | type:bug, component:management-server, Severity:Minor | As 
above |
   | **Coding agent** | Suitable | Root cause confirmed, fix agreed in 
comments: null `user_data_id` + `user_data_policy` on `vm_template` rows during 
userdata removal in account cleanup |
   
   ### ๐Ÿ”— Similar issues
   
   No distinct duplicate found; the original discussion and fix are tracked 
within this issue and PR #11595.
   
   <details><summary>๐Ÿ’ก Notes and suggestions</summary>
   
   - Fix location: `AccountManagerImpl` / `UserDataServiceImpl` โ€” during 
`deleteUserData` invoked by account cleanup, add a step to `UPDATE vm_template 
SET user_data_id = NULL, user_data_policy = NULL WHERE user_data_id = ?`.
   - Also verify `listUserDatas` API and template-link logic to prevent 
cross-account linkage that could cause similar orphaning.
   - PR #11595 is the agreed fix; PR #12439 was closed in its favour.
   
   </details>
   
   
   
   > Generated by [Daily Issue 
Triage](https://github.com/apache/cloudstack/actions/runs/28523943189) ยท 
[โ—ท](https://github.com/search?q=repo%3Aapache%2Fcloudstack+%22gh-aw-workflow-call-id%3A+apache%2Fcloudstack%2Fdaily-issue-triage%22&type=issues)
   >
   <details>
   <summary>Add this agentic workflows to your repo</summary>
   
   To install this agentic workflow, run
   
   ```
   gh aw add 
githubnext/agentics/workflows/daily-issue-triage.md@d7c1dc4b72b00607a67caaffdcc216cb64379cf9
   ```
   </details>
   
   
   <!-- gh-aw-agentic-workflow: Daily Issue Triage, engine: copilot, version: 
1.0.52, model: claude-sonnet-4.6, id: 28523943189, workflow_id: 
daily-issue-triage, run: 
https://github.com/apache/cloudstack/actions/runs/28523943189 -->
   <!-- gh-aw-workflow-call-id: apache/cloudstack/daily-issue-triage -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to