Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: fix fail to list public ips of shared networks sometimes #8624

Conversation

weizhouapache
Copy link
Member

@weizhouapache weizhouapache commented Feb 7, 2024

Description

This PR fixes #8622

error

2024-02-07 10:59:11,110 ERROR [c.c.a.ApiServer] (qtp1146825051-20:ctx-74413901 ctx-b91ecc51) (logid:aa41ab63) unhandled exception executing api command: [Ljava.lang.String;@5a46b058
java.lang.NullPointerException
    at com.cloud.vm.NicVO.getInstanceId(NicVO.java:256)
    at com.cloud.api.ApiResponseHelper.addSystemVmInfoToIpResponse(ApiResponseHelper.java:995)
    at com.cloud.api.ApiResponseHelper.showVmInfoForSharedNetworks(ApiResponseHelper.java:1175)
    at com.cloud.api.ApiResponseHelper.createIPAddressResponse(ApiResponseHelper.java:1088)
    at org.apache.cloudstack.api.command.user.address.ListPublicIpAddressesCmd.execute(ListPublicIpAddressesCmd.java:196)

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

error
```
2024-02-07 10:59:11,110 ERROR [c.c.a.ApiServer] (qtp1146825051-20:ctx-74413901 ctx-b91ecc51) (logid:aa41ab63) unhandled exception executing api command: [Ljava.lang.String;@5a46b058
java.lang.NullPointerException
    at com.cloud.vm.NicVO.getInstanceId(NicVO.java:256)
    at com.cloud.api.ApiResponseHelper.addSystemVmInfoToIpResponse(ApiResponseHelper.java:995)
    at com.cloud.api.ApiResponseHelper.showVmInfoForSharedNetworks(ApiResponseHelper.java:1175)
    at com.cloud.api.ApiResponseHelper.createIPAddressResponse(ApiResponseHelper.java:1088)
    at org.apache.cloudstack.api.command.user.address.ListPublicIpAddressesCmd.execute(ListPublicIpAddressesCmd.java:196)
```
@weizhouapache weizhouapache added this to the 4.19.1.0 milestone Feb 7, 2024
Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (0d36098) 30.75% compared to head (9855c1c) 30.95%.
Report is 11 commits behind head on 4.19.

Files Patch % Lines
...src/main/java/com/cloud/api/ApiResponseHelper.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19    #8624      +/-   ##
============================================
+ Coverage     30.75%   30.95%   +0.20%     
- Complexity    33964    34220     +256     
============================================
  Files          5346     5346              
  Lines        375435   375447      +12     
  Branches      54603    54606       +3     
============================================
+ Hits         115460   116218     +758     
+ Misses       244742   243914     -828     
- Partials      15233    15315      +82     
Flag Coverage Δ
simulator-marvin-tests 24.85% <0.00%> (+0.33%) ⬆️
uitests 4.39% <ø> (ø)
unit-tests 16.54% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8612

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8613

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 8631

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8633

@rohityadavcloud
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

@rohityadavcloud a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-9185)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43343 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8624-t9185-kvm-centos7.zip
Smoke tests completed. 126 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_03_network_operations_on_created_vm_of_otheruser Failure 120.38 test_network_permissions.py
test_03_network_operations_on_created_vm_of_otheruser Error 120.39 test_network_permissions.py
ContextSuite context=TestNetworkPermissions>:teardown Error 1.34 test_network_permissions.py
test_01_nic Error 200.61 test_nic.py
test_02_trigger_shutdown Failure 336.78 test_safe_shutdown.py

@rohityadavcloud
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

@rohityadavcloud a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-9429)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 53035 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8624-t9429-kvm-centos7.zip
Smoke tests completed. 126 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_03_network_operations_on_created_vm_of_otheruser Failure 125.36 test_network_permissions.py
test_03_network_operations_on_created_vm_of_otheruser Error 125.37 test_network_permissions.py
ContextSuite context=TestNetworkPermissions>:teardown Error 1.40 test_network_permissions.py
test_01_nic Error 203.30 test_nic.py
test_02_trigger_shutdown Failure 336.87 test_safe_shutdown.py

@shwstppr
Copy link
Contributor

@weizhouapache unless I'm missing the point, even if we decide on wrapping nic.getInstanceId() in a try-catch for NPE it would still need changes in many more places

@weizhouapache
Copy link
Member Author

@weizhouapache unless I'm missing the point, even if we decide on wrapping nic.getInstanceId() in a try-catch for NPE it would still need changes in many more places

if change the type from integer to Integer, yes
but if the type is still integer, no more changes is needed.

@weizhouapache weizhouapache force-pushed the 4.19-fix-list-public-ips-shared-network branch from 31c9bc3 to 4f6ed22 Compare May 22, 2024 10:54
@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9668

@blueorangutan
Copy link

[SF] Trillian test result (tid-10239)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 46013 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8624-t10239-kvm-centos7.zip
Smoke tests completed. 129 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 414.13 test_events_resource.py
test_01_redundant_vpc_site2site_vpn Failure 420.75 test_vpc_vpn.py
test_01_vpc_site2site_vpn_multiple_options Failure 343.12 test_vpc_vpn.py
test_01_vpc_site2site_vpn Failure 294.82 test_vpc_vpn.py

@shwstppr
Copy link
Contributor

@DaanHoogland @weizhouapache is this good to merge?

@shwstppr shwstppr requested a review from vishesh92 May 28, 2024 07:06
@DaanHoogland
Copy link
Contributor

let's make sure it doesn't cause the integration test failures

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el7 ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 9719

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9721

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@weizhouapache a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-10308)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 44310 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8624-t10308-kvm-centos7.zip
Smoke tests completed. 129 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_trigger_shutdown Failure 341.81 test_safe_shutdown.py
test_05_vmschedule_test_e2e Failure 361.85 test_vm_schedule.py

@DaanHoogland DaanHoogland reopened this Jun 3, 2024
@DaanHoogland DaanHoogland merged commit 875cd14 into apache:4.19 Jun 4, 2024
70 of 72 checks passed
@DaanHoogland DaanHoogland deleted the 4.19-fix-list-public-ips-shared-network branch June 4, 2024 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
8 participants