You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2026/08/04 02:55:34 UTC
[I] [BUG] Grpc/Dubbo/Sofa parser NPE on null labels + 4-deep service deref chain [shenyu]
Aias00 opened a new issue, #6861:
URL: https://github.com/apache/shenyu/issues/6861
## Description
Each parser iterates `for (String label : labels.keySet())` where `labels` comes from `ingress.getMetadata().getLabels()`, which returns null when no labels are set — `labels.keySet()` NPEs. Inside the loop, `serviceLister.namespace(namespace).get(labels.get(label)).getMetadata().getAnnotations()` is a 4-deep deref chain with no null check — if the referenced Service does not exist, `.getMetadata()` NPEs.
## Location
- `shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/GrpcParser.java:255-256`
- `shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/DubboIngressParser.java:241-242`
- `shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/SofaParser.java:172-173`
## Impact
A gRPC/Dubbo/Sofa ingress with no k8s labels (or referencing a non-existent Service) crashes the reconcile with NPE, blocking route configuration for that ingress.
## Suggested fix
Null-check `labels` before the loop (`if (Objects.isNull(labels)) return res;`); inside the loop, fetch `V1Service svc = serviceLister.namespace(namespace).get(labels.get(label)); if (Objects.isNull(svc)) { continue; }` before dereferencing.
## Related existing
None — the label-chain deref pattern is not covered by GOV-T6 (#6679) or any baseline item.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] Grpc/Dubbo/Sofa parser NPE on null labels + 4-deep service deref chain [shenyu]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 closed issue #6861: [BUG] Grpc/Dubbo/Sofa parser NPE on null labels + 4-deep service deref chain
URL: https://github.com/apache/shenyu/issues/6861
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] Grpc/Dubbo/Sofa parser NPE on null labels + 4-deep service deref chain [shenyu]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6861:
URL: https://github.com/apache/shenyu/issues/6861#issuecomment-5174069125
👋 Hello @Aias00
A new issue has been opened by @Aias00:
- **Title**: [BUG] Grpc/Dubbo/Sofa parser NPE on null labels + 4-deep service deref chain
- **Link**: https://github.com/apache/shenyu/issues/6861
Please review when you have time. Thank you! 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org