resizeVolume with automigrate throws NullPointerException when the migration returns no volume

オープン 初心者向け
#14,751 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java
領域
backend, cloud

調査の方向性

resizeVolume のパスから始めてください。ここでは、migrateVolume が null 以外の結果を返した場合にのみ _volsDao.findById から volume が設定されています。次に、volume.getUuid() を呼び出している try ブロックと catch ブロックを読んでください。同じパターンが changeOfferingForVolume にも現れます。移行結果が null の場合に、元の移行エラーが、元の volume 参照と実際に試行されたプールとともに返され、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
  1. Resize a volume attached to a VM so that its pool lacks space, with automigrate=true.
  2. Have the migrate job finish without returning a volume id.
  3. 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時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/cloudstack のほかの issue

apache/cloudstack の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。