Skip to content
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

Dubbo service auth failed #11767

Closed
chaoyoung opened this issue Mar 8, 2023 · 3 comments
Closed

Dubbo service auth failed #11767

chaoyoung opened this issue Mar 8, 2023 · 3 comments
Labels
type/bug Bugs to being fixed

Comments

@chaoyoung
Copy link
Contributor

chaoyoung commented Mar 8, 2023

Environment

  • Dubbo version: 3.1.6
  • Operating System version: MacOS 13.2.1
  • Java version: 1.8.0_362

Steps to reproduce this issue

  1. provider和consumer在同一个应用中
  2. application配置dubbo.registry.address = nacos://${spring.cloud.nacos.server-addr}?username=${spring.cloud.nacos.username}&password=${spring.cloud.nacos.password}&namespace=${spring.cloud.nacos.discovery.namespace}
  3. 实际参数spring.cloud.nacos.server-addr=10.20.0.100:8848, spring.cloud.nacos.username='', spring.cloud.nacos.password='', spring.cloud.nacos.discovery.namespace=''
  4. 运行时dubbo.registry.address解析为 nacos://10.20.0.100:8848?username=&password=&namespace=
  5. dubbo会将此url参数解析为username=username, password=password, namespace=namespace

Expected Behavior

dubbo.registry.address的值nacos://10.20.0.100:8848?username=&password=&namespace=不应该将参数解析为username=username, password=password, namespace=namespace

并且能正常启动

Actual Behavior

Dubbo service register failed, then application exit.

image

2023-03-05 22:08:05.702 ERROR 1 --- [com.alibaba.nacos.client.naming.security] n.c.auth.impl.process.HttpLoginProcessor:78 : login failed: {"code":403,"message":"unknown user!","header":{"header":{"Accept-Charset":"UTF-8","Connection":"keep-alive","Content-Length":"13","Content-Security-Policy":"script-src 'self'","Content-Type":"text/html;charset=UTF-8","Date":"Sun, 05 Mar 2023 14:08:05 GMT","Keep-Alive":"timeout=60","Vary":"Access-Control-Request-Headers"},"originalResponseHeader":{"Connection":["keep-alive"],"Content-Length":["13"],"Content-Security-Policy":["script-src 'self'"],"Content-Type":["text/html;charset=UTF-8"],"Date":["Sun, 05 Mar 2023 14:08:05 GMT"],"Keep-Alive":["timeout=60"],"Vary":["Access-Control-Request-Headers","Access-Control-Request-Method","Origin"]},"charset":"UTF-8"}}
2023-03-05 22:08:07.102  WARN 1 --- [main] .d.registry.integration.RegistryProtocol:? :  [DUBBO] null, dubbo version: 3.1.6, current host: 172.17.0.1, error code: 99-0. This may be caused by unknown error in registry module, go to https://dubbo.apache.org/faq/99/0 to find instructions.

java.lang.NullPointerException: null
        at org.apache.dubbo.registry.integration.RegistryProtocol$ExporterChangeableWrapper.unexport(RegistryProtocol.java:912)
        at org.apache.dubbo.registry.integration.RegistryProtocol$DestroyableExporter.unexport(RegistryProtocol.java:694)
        at org.apache.dubbo.config.ServiceConfig.unexport(ServiceConfig.java:192)
        at org.apache.dubbo.config.deploy.DefaultModuleDeployer.postDestroy(DefaultModuleDeployer.java:241)
        at org.apache.dubbo.rpc.model.ModuleModel.onDestroy(ModuleModel.java:108)
        at org.apache.dubbo.rpc.model.ScopeModel.destroy(ScopeModel.java:115)
        at org.apache.dubbo.rpc.model.ApplicationModel.onDestroy(ApplicationModel.java:260)
        at org.apache.dubbo.rpc.model.ScopeModel.destroy(ScopeModel.java:115)
        at org.apache.dubbo.rpc.model.ApplicationModel.tryDestroy(ApplicationModel.java:358)
        at org.apache.dubbo.rpc.model.ModuleModel.onDestroy(ModuleModel.java:130)
        at org.apache.dubbo.rpc.model.ScopeModel.destroy(ScopeModel.java:115)
        at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextClosedEvent(DubboDeployApplicationListener.java:132)
        at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:104)
        at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:47)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378)
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1058)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:174)
        at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1021)
        at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:787)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:164)
        at com.bwai.callcenter.CallCenterApplication.main(CallCenterApplication.java:39)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
@chaoyoung chaoyoung added the type/bug Bugs to being fixed label Mar 8, 2023
@AlbumenJ
Copy link
Member

AlbumenJ commented Mar 8, 2023

Related with org/apache/dubbo/common/URLStrParser.java:294

@AlbumenJ
Copy link
Member

AlbumenJ commented Mar 8, 2023

这个可能和之前 Activated 的设计有关,不过如果把这个逻辑去掉能不影响现有的功能的话我建议还是删掉

@AlbumenJ
Copy link
Member

AlbumenJ commented Mar 8, 2023

@chickenlj PTAL

AlbumenJ pushed a commit that referenced this issue Mar 11, 2023
mytang0 added a commit to mytang0/dubbo that referenced this issue Mar 14, 2023
* origin/3.2: (25 commits)
  Bump bytebuddy.version from 1.14.1 to 1.14.2 (apache#11814)
  Dynamically generate native image config (apache#11795)
  Remove redundant synchronized (apache#11811)
  fix remove unused param (apache#11787)
  Bump bytebuddy.version from 1.14.0 to 1.14.1 (apache#11808)
  Reuse qos port for metrics (apache#11719)
  🐛 fix thread pool metrics be gc recycle problem (apache#11793)
  Bump protobuf-java from 3.22.0 to 3.22.2 (apache#11802)
  Bump spring-security-bom from 5.8.1 to 5.8.2 (apache#11801)
  Bump byte-buddy from 1.14.0 to 1.14.1 (apache#11804)
  Cert npe bug fix (apache#11800)
  Fix uts
  Fix lock acquire blocked
  Fix hessian list
  Fix metrics publisher NPE
  Fix ut
  Fix bug apache#11767 (apache#11781)
  Fix uts
  Sync when destroy (apache#11783)
  Fix recreate client after destroy (apache#11780)
  ...
mytang0 added a commit to mytang0/dubbo that referenced this issue Mar 14, 2023
* origin/3.2: (28 commits)
  Bump bytebuddy.version from 1.14.1 to 1.14.2 (apache#11814)
  Dynamically generate native image config (apache#11795)
  Remove redundant synchronized (apache#11811)
  fix remove unused param (apache#11787)
  Bump bytebuddy.version from 1.14.0 to 1.14.1 (apache#11808)
  Reuse qos port for metrics (apache#11719)
  🐛 fix thread pool metrics be gc recycle problem (apache#11793)
  Bump protobuf-java from 3.22.0 to 3.22.2 (apache#11802)
  Bump spring-security-bom from 5.8.1 to 5.8.2 (apache#11801)
  Bump byte-buddy from 1.14.0 to 1.14.1 (apache#11804)
  Cert npe bug fix (apache#11800)
  Fix uts
  Fix lock acquire blocked
  Fix hessian list
  Fix metrics publisher NPE
  Fix ut
  Fix bug apache#11767 (apache#11781)
  Fix uts
  Sync when destroy (apache#11783)
  Fix recreate client after destroy (apache#11780)
  ...
lcb11 pushed a commit to lcb11/dubbo that referenced this issue Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bugs to being fixed
Projects
None yet
Development

No branches or pull requests

2 participants