[BUG] LoadbalancerUtils NPE on missing remoteAddress/method
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 3.1k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 85
Description
- severity: Medium
- files: `shenyu-plugin/shenyu-plugin-base/src/main/java/org/apache/shenyu/plugin/base/utils/LoadbalancerUtils.java:71-72`
- description: `buildLoadBalanceData` does `Objects.requireNonNull(request.getRemoteAddress()).getAddress().getHostAddress()` and `request.getMethod().name()`. `getRemoteAddress()` can be null for synthetic exchanges; `.getAddress()` can be null; `request.getMethod()` can return null in some Spring versions. Called from dubbo proxy/reference-config paths.
- impact: A request without a resolvable remote address NPEs inside the dubbo proxy path → 500.
- suggested_fix: Null-check and fall back to a safe default.
- confidence: Medium
- related_existing: none
---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.md)._
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with shenyu-plugin/shenyu-plugin-base/src/main/java/org/apache/shenyu/plugin/base/utils/LoadbalancerUtils.java, especially buildLoadBalanceData around lines 71-72. Trace its use from the dubbo proxy/reference-config paths and verify how synthetic exchanges can omit remoteAddress or method. Done means those inputs no longer cause an NPE and use a safe fallback instead.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100