Skip to content

fix NPE during logging of network with deleted Provider - #14925

Open
DaanHoogland wants to merge 1 commit into
4.20from
network-provider-null-npe
Open

DaanHoogland wants to merge 1 commit into
4.20from
network-provider-null-npe

Conversation

@DaanHoogland

Copy link
Copy Markdown
Contributor

Description

If an offering's service has a NULL provider, the "Unable to find provider" warning throws an NPE, because the method reference providerName::toString fails on null before anything is logged. Listing network offerings then fails with error 530. Now both log arguments are suppliers, so it logs and returns false.

Reported in #12175; introduced by #9873 (logging improvements)

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
  • Test (unit or integration test code)

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?

@DaanHoogland DaanHoogland added this to the 4.20.4 milestone Nov 30, 2026
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 16.46%. Comparing base (9a4aac2) to head (4801b55).

Files with missing lines Patch % Lines
.../main/java/com/cloud/network/NetworkModelImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #14925   +/-   ##
=========================================
  Coverage     16.46%   16.46%           
- Complexity    13711    13714    +3     
=========================================
  Files          5669     5669           
  Lines        501736   501736           
  Branches      60961    60961           
=========================================
+ Hits          82596    82615   +19     
+ Misses       409884   409866   -18     
+ Partials       9256     9255    -1     
Flag Coverage Δ
uitests 4.16% <ø> (ø)
unittests 17.33% <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 Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant