listPublicIpAddresses NullPointerException on shared networks with a VR (4.22)
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
- 80/100
Hướng nghiên cứu
Bắt đầu trong ApiResponseHelper.java tại showVmInfoForSharedNetworks(), tập trung vào nhánh mạng không ảo và việc tra cứu NIC. So sánh helper hiện có dùng để bỏ qua placeholder với hành vi được mô tả trong #8622 và #8624, sau đó tái hiện bằng cách gọi listPublicIpAddresses nhiều lần trên một mạng dùng chung. Hoàn tất khi request không còn thỉnh thoảng thất bại với NullPointerException.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
problem
On 4.22.1.0, listPublicIpAddresses with forvirtualnetwork=false sometimes fails with a 530:
2026-09-25 06:50:01,162 ERROR [c.c.a.ApiServer] (qtp2038105753-72330:[ctx-762cfe49, ctx-ac3b837a, ctx-e861c603]) (logid:e972f310) unhandled exception executing api command: [Ljava.lang.String;@4e95c7d5 java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because "this.instanceId" is null
2026-09-25 06:50:01,165 INFO [a.c.c.a.ApiServlet] (qtp2038105753-72330:[ctx-762cfe49, ctx-ac3b837a, ctx-e861c603]) (logid:e972f310) (userId=8 accountId=2 sessionId=null) 0:0:0:0:0:0:0:1 -- GET allocatedonly=false&apikey=<redacted>&command=listPublicIpAddresses&forvirtualnetwork=false&listall=true&page=1&pagesize=500&response=json&signature=<redacted> 530 Cannot invoke "java.lang.Long.longValue()" because "this.instanceId" is null
The same request succeeds on some attempts and fails on others.
It looks like the DomainRouter branch added to ApiResponseHelper.showVmInfoForSharedNetworks() in #10458 is hitting the VR's placeholder NIC, which has a null instance_id. Our shared network has two NIC rows for the VR's IP (the placeholder and the real one), and the NIC lookup can return either, which would explain why it's intermittent. It seems to be the same or a similar problem as #8622, which #8624 fixed for the system VM branch.
versions
ACS 4.22.1.0, KVM, advanced zone. The shared network offering uses VirtualRouter for DHCP, DNS and UserData.
The steps to reproduce the bug
- Create a shared network whose offering uses VirtualRouter for DHCP/DNS, and deploy a VM on it so the VR starts.
- As admin, call listPublicIpAddresses networkid= forvirtualnetwork=false a few times.
- Some calls fail with the NPE above.
What to do about it?
findNonPlaceHolderByIp4AddressAndNetworkId() looks to skip placeholder IP addresses, so should be able to change this line in ApiResponseHelper.java:
Change:
if (!forVirtualNetworks) {
NicVO nic = ApiDBUtils.findByIp4AddressAndNetworkId(ipAddr.getAddress().toString(), ipAddr.getNetworkId());
To:
if (!forVirtualNetworks) {
NicVO nic = ApiDBUtils.findNonPlaceHolderByIp4AddressAndNetworkId(ipAddr.getAddress().toString(), ipAddr.getNetworkId());
- Ngôn ngữ chính
- Java
- Star
- 3.1k
- Fork
- 1.4k
- Merge trung bình
- 5 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 22
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/cloudstack
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
apache/cloudstack#14244 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
apache/cloudstack#14222 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
create-kubernetes-binaries-iso.sh builds the ISO without setting a volume ID on EL8 based os'sĐang mởbug component:kubernetes
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
apache/cloudstack#14180 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug component:projects component:UI
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
apache/cloudstack#14070 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
component:backup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/cloudstack#14013 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/cloudstack
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
component/zeebe kind/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
UniversalMediaServer/UniversalMediaServer#6356 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
refinedmods/refinedstorage2#1414 · 1 bình luận ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
yegor256/rultor-image#76 · 1 bình luận ·