Skip to content

Dubbo service auth failed #11767

@chaoyoung

Description

@chaoyoung

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugBugs to being fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions