apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.53k stars 26.44k forks source link

[Bug] Dubbo's registration center is configured as nacos. When the nacos's password contains the "#" sign, the dubbo service fails to start #14914

Closed hxxshidage closed 3 days ago

hxxshidage commented 4 days ago

Pre-check

Search before asking

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

v3.2.7

Steps to reproduce this issue

A NumberFormatException is thrown. The stack is as follows: java.lang.NumberFormatException: For input string: "prod" at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) at java.base/java.lang.Integer.parseInt(Integer.java:668) at java.base/java.lang.Integer.parseInt(Integer.java:786) at org.apache.dubbo.common.URLStrParser.parseURLBody(URLStrParser.java:162) at org.apache.dubbo.common.URLStrParser.parseDecodedStr(URLStrParser.java:60) at org.apache.dubbo.common.URL.valueOf(URL.java:255) at org.apache.dubbo.common.URL.valueOf(URL.java:235) at org.apache.dubbo.registry.nacos.NacosRegistryFactory.createRegistryCacheKey(NacosRegistryFactory.java:38) at org.apache.dubbo.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:75) at org.apache.dubbo.registry.RegistryFactoryWrapper.getRegistry(RegistryFactoryWrapper.java:33) at org.apache.dubbo.registry.RegistryFactory$Adaptive.getRegistry(RegistryFactory$Adaptive.java) at org.apache.dubbo.registry.integration.RegistryProtocol.getRegistry(RegistryProtocol.java:446) at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:531) at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:80) at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:85) at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.refer(ProtocolSecurityWrapper.java:110) at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:71) at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:52) at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.refer(InvokerCountWrapper.java:48) at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) at org.apache.dubbo.config.ReferenceConfig.createInvoker(ReferenceConfig.java:620) at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:466) at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:353) at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:238) at org.apache.dubbo.config.ReferenceConfigBase.get(ReferenceConfigBase.java:379) at org.apache.dubbo.config.utils.SimpleReferenceCache.destroyReference(SimpleReferenceCache.java:288) at org.apache.dubbo.config.utils.SimpleReferenceCache.destroy(SimpleReferenceCache.java:241) at org.apache.dubbo.config.utils.SimpleReferenceCache.destroy(SimpleReferenceCache.java:265) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:500) at java.base/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4780) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:475) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:176) // more...

The cause of the error is shown in the figure below: 386501014-9315c5e1-dc8a-4af1-9a8a-05f85e685dbe

What you expected to happen

Hope official fix it. thanks

Anything else

No response

Are you willing to submit a pull request to fix on your own?

Code of Conduct

wcy666103 commented 4 days ago

This is to avoid security issues https://github.com/apache/dubbo/pull/7779

Consider changing the nacos password?

hxxshidage commented 3 days ago

This is to avoid security issues #7779

Consider changing the nacos password?

Changing password is a good solution, in fact we already do it. Wanting more developers to avoid this black hole, I'd like to pin this question to the top. thanks!