-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
java.lang.IllegalArgumentException: Metrics port cannot be null #13684
Comments
If need to fix it, please assign to me. |
Since I've read Configuration Item Reference Manual (BTW, English version seems not up-to-date neither well typeset) and code relative to dubbo/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java Lines 279 to 283 in 2cf54f7
Hope this helps. |
@bitgorust The ports related to indicators have been migrated to the QOS service, and outdated configurations will gradually be removed in the future |
@songxiaosheng Thanks for telling your plan. So maybe we can simply drop L280 and L282 here instead of kind of breaking changes like #13687? dubbo/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java Lines 279 to 283 in 5c0b1de
|
you can try it |
Pull request is subbmited: #13705 |
How about deleting the outdated methods and testing them out |
Glad to be part of the future. I think following code can be deleted. There will be another PR later. dubbo/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java Line 666 in 29b0c72
dubbo/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java Line 445 in 29b0c72
dubbo/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java Lines 270 to 286 in 29b0c72
|
@songxiaosheng Here is the new one: #13717 |
Environment
Steps to reproduce this issue
dubbo.metrics.enabled=false
ReferenceConfig.get()
asBean
sPls. provide [GitHub address] to reproduce this issue.
Expected Behavior
Project starts successfully. References created without metrics configuration.
Actual Behavior
References created with metrics enabled, but port is null.
Exception trace:
Analysis
In
dubbo/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java
Lines 274 to 277 in 2cf54f7
MetricsConfig
is got bygetConfigManager().getMetrics().orElse(null)
. Dive in we can know that the instance actually comes fromdubbo/dubbo-common/src/main/java/org/apache/dubbo/config/context/AbstractConfigManager.java
Lines 294 to 296 in 2cf54f7
dubbo/dubbo-common/src/main/java/org/apache/dubbo/config/context/AbstractConfigManager.java
Lines 554 to 566 in 2cf54f7
ConfigurationUtils.hasSubProperties(configurationMaps, AbstractConfig.getTypePrefix(cls))
istrue
here, which I think it should do more than just looking for properties withdubbo.metrics
prefix.Workaround
Now we work it around by adding
org.apache.dubbo:dubbo-spring-boot-observability-starter
to avoid null port exceptions.Solution
One reasonable solution I think is to add one more condition after
dubbo/dubbo-common/src/main/java/org/apache/dubbo/config/context/AbstractConfigManager.java
Line 554 in 2cf54f7
${prefix}.enabled=false
configuration. Or maybe some solutions are on the way asappendMetricsCompatible
is deprecated.The text was updated successfully, but these errors were encountered: