apache / dubbo

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

java.lang.RuntimeException: publish nacos metadata failed #10187

Closed hyw520110 closed 2 years ago

hyw520110 commented 2 years ago

报错信息: ERROR org.apache.dubbo.metadata.report.support.AbstractMetadataReport.storeProviderMetadataTask(AbstractMetadataReport.java:289) [TID: N/A] -- [DUBBO] Failed to put provider metadata org.apache.dubbo.metadata.report.identifier.MetadataIdentifier@3e1e3807 in FullServiceDefinition{parameters=org.apache.dubbo.common.url.component.URLParam$URLParamMap@df7036ad} ServiceDefinition [canonicalName=com.XXX, codeSource=XXX-SNAPSHOT.jar, methods=[MethodDefinition [name=getServantDetails, parameterTypes=[java.lang.String], returnType=com.XXX]]], cause: Failed to put org.apache.dubbo.metadata.report.identifier.MetadataIdentifier@3e1e3807 to nacos {"parameters":{"side":"provider","interface":"com.XXX","pid":"10249","metadata-type":"remote","application":"XXX,"dubbo":"2.0.2","release":"3.0.8","anyhost":"true","methods":"getServantDetails","logger":"slf4j","deprecated":"false","service-name-mapping":"true","register-mode":"all","qos.enable":"false","generic":"false","bind.port":"31001","revision":"2.1.1-SNAPSHOT","bind.ip":"XX.XX.XXX.XX","background":"false","dynamic":"true","service.filter":"-exception","timestamp":"1655786998155"},"canonicalName":"com.XXX","codeSource":"XXX-SNAPSHOT.jar","methods":[{"name":"getServantDetails","parameterTypes":["java.lang.String"],"returnType":"com.XXX","annotations":[]}],"types":[{"type":"java.util.Date"},{"type":"com.XXX","properties":{"serviceType":"java.lang.String","dtEmployment":"java.util.Date","gender":"java.lang.String","description":"java.lang.String","dtEnter":"java.util.Date","userName":"java.lang.String","servantId":"java.lang.String","skilled":"java.lang.String","feeAmt":"java.lang.Integer","duration":"java.lang.Integer","serviceCount":"java.lang.Integer","dtUpdate":"java.util.Date","dtServiceTime":"java.util.Date","userTag":"java.lang.String","aptitude":"java.lang.String","shortDesc":"java.lang.String","iconUrl":"java.lang.String","dtCreate":"java.util.Date","status":"java.lang.String"}},{"type":"java.lang.String"},{"type":"java.lang.Integer"}],"annotations":[]}, cause: publish nacos metadata failed, dubbo version: 3.0.8, current host: XX.XX.XXX.XX java.lang.RuntimeException: Failed to put org.apache.dubbo.metadata.report.identifier.MetadataIdentifier@3e1e3807 to nacos {"parameters":{"side":"provider","interface":"com.XXX","pid":"10249","metadata-type":"remote","application":"XXX","dubbo":"2.0.2","release":"3.0.8","anyhost":"true","methods":"getServantDetails","logger":"slf4j","deprecated":"false","service-name-mapping":"true","register-mode":"all","qos.enable":"false","generic":"false","bind.port":"31001","revision":"XXX-SNAPSHOT","bind.ip":"XX.XX.XXX.XX","background":"false","dynamic":"true","service.filter":"-exception","timestamp":"1655786998155"},"canonicalName":"com.XXX","codeSource":"XXX-SNAPSHOT.jar","methods":[{"name":"getServantDetails","parameterTypes":["java.lang.String"],"returnType":"com.XXX","annotations":[]}],"types":[{"type":"java.util.Date"},{"type":"com.XXX","properties":{"serviceType":"java.lang.String","dtEmployment":"java.util.Date","gender":"java.lang.String","description":"java.lang.String","dtEnter":"java.util.Date","userName":"java.lang.String","servantId":"java.lang.String","skilled":"java.lang.String","feeAmt":"java.lang.Integer","duration":"java.lang.Integer","serviceCount":"java.lang.Integer","dtUpdate":"java.util.Date","dtServiceTime":"java.util.Date","userTag":"java.lang.String","aptitude":"java.lang.String","shortDesc":"java.lang.String","iconUrl":"java.lang.String","dtCreate":"java.util.Date","status":"java.lang.String"}},{"type":"java.lang.String"},{"type":"java.lang.Integer"}],"annotations":[]}, cause: publish nacos metadata failed at org.apache.dubbo.metadata.store.nacos.NacosMetadataReport.storeMetadata(NacosMetadataReport.java:343) at org.apache.dubbo.metadata.store.nacos.NacosMetadataReport.doStoreProviderMetadata(NacosMetadataReport.java:178) at org.apache.dubbo.metadata.report.support.AbstractMetadataReport.storeProviderMetadataTask(AbstractMetadataReport.java:283) at org.apache.dubbo.metadata.report.support.AbstractMetadataReport.lambda$storeProviderMetadata$0(AbstractMetadataReport.java:270) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.RuntimeException: publish nacos metadata failed at org.apache.dubbo.metadata.store.nacos.NacosMetadataReport.storeMetadata(NacosMetadataReport.java:339) ... 6 common frames omitted

依赖: nacos-client版本:2.1.0

2.6.6 2021.0.1 2021.0.1.0 3.0.8 dubbo-registry-nacos排除间接依赖:log4j、dubbo-common、dubbo-remoting-api spring-cloud-starter-alibaba-nacos-discovery排除间接依赖:HdrHistogram、nacos-client spring-cloud-starter-alibaba-nacos-config spring-cloud-starter-bootstrap 应用配置: spring: application: name: xxx profiles: active: '${profile}' cloud: nacos: username: nacos password: 123nacos456 config: server-addr: nacos-server:8848 group: '${spring.profiles.active}' namespace: ${nacos.namespace} file-extension: yaml shared-configs[0]: data-id: application.${spring.cloud.nacos.config.file-extension} refresh: false refresh-enabled: true discovery: enabled: true register-enabled: true group: '${spring.profiles.active}' namespace: ${nacos.namespace} server-addr: ${spring.cloud.nacos.config.server-addr} dubbo: registry: address: nacos://${spring.cloud.nacos.config.server-addr} group: '${spring.profiles.active}' namespace: ${nacos.namespace} username: ${spring.cloud.nacos.username} password: ${spring.cloud.nacos.password} protocol: name: dubbo port: 31003 application: logger: slf4j metadataType: remote register-mode: all qos: enable: false port: -1 accept: foreign: ip: false provider: filter: -exception consumer: cache: false timeout: 30000 retries: -1 check: false metadata-report: group: '${spring.profiles.active}' namespace: ${nacos.namespace} address: ${dubbo.registry.address} username: ${spring.cloud.nacos.username} password: ${spring.cloud.nacos.password} nacos-server版本:2.1.0 nacos-server默认配置未修改,认证相关配置: management.metrics.export.elastic.enabled=false management.metrics.export.influx.enabled=false server.tomcat.accesslog.enabled=true server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i server.tomcat.basedir= nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/** nacos.core.auth.system.type=nacos nacos.core.auth.enabled=false nacos.core.auth.caching.enabled=true nacos.core.auth.enable.userAgentAuthWhite=false nacos.core.auth.server.identity.key=serverIdentity nacos.core.auth.server.identity.value=security
wangchengming666 commented 2 years ago

NacosMetadataReport#storeMetadata这里调的是nacos的 image

尝试降级一下nacos版本试试有这个问题吗

chickenlj commented 2 years ago

大概率是 Nacos 侧问题,可提供更多细节后定位