resizeVolume with automigrate throws NullPointerException when the migration returns no volume
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從 resizeVolume 路徑開始,其中 volume 只有在 migrateVolume 回傳非空結果時才會由 _volsDao.findById 設定,然後閱讀呼叫 volume.getUuid() 的 try 與 catch 區塊。同樣的模式也出現在 changeOfferingForVolume 中。完成的標準是:遷移結果為空時,回傳原始的遷移錯誤,並保留原始的磁碟區參照與實際嘗試過的儲存池,且不出現 NullPointerException。承載資料中未指定測試檔案,因此請尋找現有的磁碟區調整大小或遷移測試並加以擴充。
由索引模型根據 Issue 內容生成。
描述
problem
resizeVolume with automigrate=true throws a NullPointerException when the volume has to move to another pool and migrateVolume returns no volume.
| step | code |
|---|---|
| migration result | volume = (result != null) ? _volsDao.findById(result.getId()) : null; |
error built in the try |
volume.getUuid() on a null volume |
error built in the catch |
volume.getUuid() again, so the NPE escapes |
migrateVolume returns null on the VM work-job path when the job result is not a volume id.
changeOfferingForVolume has the same block. It does not NPE, but its message prints volume: null and names suitableStoragePools.get(0) instead of the pool that was tried.
versions
4.22 (the same code is on main).
The steps to reproduce the bug
- Resize a volume attached to a VM so that its pool lacks space, with
automigrate=true. - Have the migrate job finish without returning a volume id.
- The API returns a NullPointerException instead of a migration error.
What to do about it?
Keep the original volume reference for the message, report the pool that was actually tried, and keep the migration failure as the cause.
- 主要語言
- Java
- 星號
- 3.1k
- 分支
- 1.4k
- 平均合併
- 6 天 18 小時
- 30 天內合併 PR
- 11
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/cloudstack 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 62/100
apache/cloudstack#14784 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
apache/cloudstack#14770 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
apache/cloudstack#14755 ·
維護者通常 1 天內回覆
-
UI: Account search in Add Instance wizard not functioning可能已有人在做 @Shiv-61 於 5 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 76/100
apache/cloudstack#14719 · 2 則留言 ·
維護者通常 1 天內回覆
-
registerTemplate / registerIso accept a 2048-character URL, but vm_template.url holds 1024可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 77/100
apache/cloudstack#14715 · 1 則留言 ·
維護者通常 1 天內回覆
查看 apache/cloudstack 的全部 Issue
相似的 Issue
-
難度 1/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
-
hermes-queue
難度 2/5 1-3 小時 新手友好度 72/100
chrisalunlloyd2-sudo/mindpalace#425 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 80/100
維護者通常 1 天內回覆
-
documentation enhancement first-time-contributor good first issue
難度 1/5 1 小時以內 新手友好度 84/100
SasanLabs/VulnerableApp#961 · 1 則留言 ·
維護者通常 1 天內回覆