resizeVolume with automigrate throws NullPointerException when the migration returns no volume

Đang mở Phù hợp với người mới
#14,751 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
backend, cloud

Hướng nghiên cứu

Bắt đầu từ đường dẫn resizeVolume, nơi volume được gán từ _volsDao.findById chỉ khi migrateVolume trả về kết quả khác null, sau đó đọc các khối try và catch gọi volume.getUuid(). Cùng một mẫu xuất hiện trong changeOfferingForVolume. Hoàn thành khi kết quả migration null trả về đúng lỗi migration gốc, với tham chiếu volume gốc và storage pool thực sự đã được thử, mà không xảy ra NullPointerException. Payload không nêu tên file test nào, vì vậy hãy tìm các test hiện có về resize hoặc migration volume để mở rộng.

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

Mô tả

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.

Ngôn ngữ chính
Java
Star
3.1k
Fork
1.4k
Merge trung bình
6 ngày 18 giờ
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/cloudstack

Tất cả issue của apache/cloudstack

Issue tương tự

Thêm issue về Java

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.