dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

启动一直报这个无法获取metadata的错误

Open zhouyu00 opened this issue 2 years ago • 9 comments

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Ask your question here

dubbo:3.1.1 jdk:11 os: centOS 7.6 配置如下:

dubbo:
  application:
    name: 
    metadata-service-protocol: tri
  registry:
    address: ${NACOS_REGISTER_ADDR}
    group: ${DUBBO_REGISTER_GROUP}
    parameters:
      namespace: ${NACOS_NAMESPACE}
    username: ${NACOS_USERNAME}
    password: ${NACOS_PASSWORD}
  metadata-report:
    address: ${NACOS_REGISTER_ADDR}
  protocol:
    name: ${DUBBO_PROTOCAL_NAME}
    port: ${DUBBO_PROTOCAL_PORT}
    accesslog: false
  consumer:
    filter: dubboFilterConsumer
    check: false
    timeout: ${DUBBO_CONSUMER_TIMEOUT}
    retries: ${DUBBO_CONSUMER_RETRIES}
  provider:
    filter: dubboFilterProvider

代码里面同时使用了rest和 tri 两种协议,直接注解在接口配置上 启动时一直滚动报下面这个错误,

[DUBBO] Failed to get app metadata for revision 3005bae31919d143caf981fc3d373483 for type local from instance 10.70.33.251:9092, dubbo version: 3.1.1, current host: 10.70.34.222 org.apache.dubbo.rpc.RpcException: Fail to invoke remote method: getMetadataInfo, provider: tri://10.70.33.251:50051/org.apache.dubbo.metadata.MetadataService?connections=1&corethreads=2&dubbo=2.0.2&group=demoGroup&port=50051&protocol=tri&release=3.1.1&retries=0&side=provider&threadpool=cached&threads=100&timeout=5000&token=**************************************************, cause: org.apache.dubbo.rpc.StatusRpcException: UNKNOWN : unknown ~~ java.lang.NullPointerException ~~  ~~ RemoteAddress:10.70.33.251:50051 ~~         at org.apache.dubbo.rpc.protocol.AbstractInvoker.waitForResultIfSync(AbstractInvoker.java:282) ~~       at org.apache.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:185) ~~    at org.apache.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:70) ~~       at org.apache.dubbo.rpc.proxy.InvocationUtil.invoke(InvocationUtil.java:55) ~~  at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:75) ~~      at org.apache.dubbo.metadata.MetadataServiceDubboProxy0.getMetadataInfo(MetadataServiceDubboProxy0.java) ~~     at org.apache.dubbo.registry.client.metadata.MetadataUtils.getRemoteMetadata(MetadataUtils.java:171) ~~         at org.apache.dubbo.registry.client.AbstractServiceDiscovery.getRemoteMetadata(AbstractServiceDiscovery.java:178) ~~    at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.lambda$doOnEvent$2(ServiceInstancesChangedListener.java:158) ~~      at java.base/java.util.Optional.orElseGet(Optional.java:369) ~~         at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.doOnEvent(ServiceInstancesChangedListener.java:158) ~~       at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.onEvent(ServiceInstancesChangedListener.java:112) ~~         at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener$AddressRefreshRetryTask.run(ServiceInstancesChangedListener.java:488) ~~     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~~         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~~        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~~  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~~         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~~         at java.base/java.lang.Thread.run(Thread.java:829) ~~ Caused by: java.util.concurrent.ExecutionException: org.apache.dubbo.rpc.StatusRpcException: UNKNOWN : unknown ~~ java.lang.NullPointerException ~~  ~~ RemoteAddress:10.70.33.251:50051 ~~       at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395) ~~    at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022) ~~        at org.apache.dubbo.rpc.AsyncRpcResult.get(AsyncRpcResult.java:195) ~~   at org.apache.dubbo.rpc.protocol.AbstractInvoker.waitForResultIfSync(AbstractInvoker.java:264) ~~       ... 18 more ~~ Caused by: org.apache.dubbo.rpc.StatusRpcException: UNKNOWN : unknown ~~ java.lang.NullPointerException ~~  ~~ RemoteAddress:10.70.33.251:50051 ~~       at org.apache.dubbo.rpc.TriRpcStatus.asException(TriRpcStatus.java:214) ~~      at org.apache.dubbo.rpc.protocol.tri.DeadlineFuture.doReceived(DeadlineFuture.java:134) ~~     at org.apache.dubbo.rpc.protocol.tri.DeadlineFuture.lambda$received$0(DeadlineFuture.java:91) ~~        at org.apache.dubbo.common.threadpool.ThreadlessExecutor$RunnableWrapper.run(ThreadlessExecutor.java:184) ~~     at org.apache.dubbo.common.threadpool.ThreadlessExecutor.waitAndDrain(ThreadlessExecutor.java:103) ~~   at org.apache.dubbo.rpc.AsyncRpcResult.get(AsyncRpcResult.java:193) ~~  ... 19 more

zhouyu00 avatar Dec 31 '22 06:12 zhouyu00

模块中同时使用了tri和rest协议是否这个原因导致?

zhouyu00 avatar Dec 31 '22 06:12 zhouyu00

可以提供一个可以复现的 Demo 吗,或者升级到 3.1.4 测下看看

AlbumenJ avatar Jan 03 '23 06:01 AlbumenJ

可以提供一个可以复现的 Demo 吗,或者升级到 3.1.4 测下看看

已经解决了,在提供端加上dubbo.metadata-type: remote 怀疑是容器部署影响了元数据交换?目前没有找到具体的原因

zhouyu00 avatar Jan 04 '23 10:01 zhouyu00

dubbo.metadata-type: remote 只是绕过了获取元数据的过程,如果可以的话还是希望能搭个 dubbo.metadata-type: local 的看下是什么问题

AlbumenJ avatar Jan 04 '23 12:01 AlbumenJ

环境中是否是多网卡?

WangPei0316 avatar Jun 08 '23 02:06 WangPei0316

So the final solution to this question is?

your-boy avatar Dec 02 '23 03:12 your-boy

in 3.1.11 still there.

2023-12-05 14:40:38.773 [TID:N/A] [] [Dubbo-framework-SD-address-refresh-4-thread-1] WARN  o.a.d.r.p.dubbo.ReferenceCountExchangeClient:? -  [DUBBO] 10.244.15.223:20888 uat/com.***.zhenghe.rpcapi.modules.enterprise.service.***DueBankService safe guard client , should not be called ,must have a bug., dubbo version: 3.1.11, current host: 10.244.3.11, error code: 4-11. This may be caused by , go to https://dubbo.apache.org/faq/4/11 to find instructions. 
2023-12-05 14:40:38.773 [TID:N/A] [] [Dubbo-framework-SD-address-refresh-4-thread-1] ERROR o.a.dubbo.registry.client.metadata.MetadataUtils:? -  [DUBBO] Failed to get app metadata for revision 17a7209a5b2c161567721f1c20ea39e8 for type local from instance 10.244.15.223:20888, dubbo version: 3.1.11, current host: 10.244.3.11, error code: 1-39. This may be caused by , go to https://dubbo.apache.org/faq/1/39 to find instructions. java.lang.IllegalStateException: LazyConnectExchangeClient is not connected normally, and send.reconnect is configured as false, the request fails quicklydubbo://10.244.15.223:20888/com.***.zhenghe.rpcapi.modules.enterprise.service.***DueBankService?anyhost=true&application=bosskg-server-provider&background=false&category=providers,configurators,routers&check=false&codec=dubbo&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=uat&heartbeat=60000&interface=com.***.zhenghe.rpcapi.modules.enterprise.service.***DueBankService&lazy=true&methods=getById,list,page,removeById,removeByIds,save,saveBatch,updateById&pid=1&provided-by=zhenghe-rpcapi-provider&qos.enable=false&release=3.1.11&retries=0&revision=1.0.1-SNAPSHOT&serialize.check.status=WARN&service-name-mapping=true&side=consumer&sticky=false&timeout=15000&unloadClusterRelated=false
	at org.apache.dubbo.rpc.protocol.dubbo.LazyConnectExchangeClient.checkClient(LazyConnectExchangeClient.java:271)
	at org.apache.dubbo.rpc.protocol.dubbo.LazyConnectExchangeClient.request(LazyConnectExchangeClient.java:124)
	at org.apache.dubbo.rpc.protocol.dubbo.ReferenceCountExchangeClient.request(ReferenceCountExchangeClient.java:94)
	at org.apache.dubbo.rpc.protocol.dubbo.DubboInvoker.doInvoke(DubboInvoker.java:117)
	at org.apache.dubbo.rpc.protocol.AbstractInvoker.doInvokeAndReturn(AbstractInvoker.java:222)
	at org.apache.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:183)
	at org.apache.dubbo.rpc.proxy.InvocationUtil.invoke(InvocationUtil.java:57)
	at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:75)
	at org.apache.dubbo.metadata.MetadataServiceDubboProxy7.getMetadataInfo(MetadataServiceDubboProxy7.java)
	at org.apache.dubbo.registry.client.metadata.MetadataUtils.getRemoteMetadata(MetadataUtils.java:173)
	at org.apache.dubbo.registry.client.AbstractServiceDiscovery.getRemoteMetadata(AbstractServiceDiscovery.java:223)
	at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.lambda$doOnEvent$2(ServiceInstancesChangedListener.java:159)
	at java.util.Optional.orElseGet(Optional.java:267)
	at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.doOnEvent(ServiceInstancesChangedListener.java:159)
	at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.onEvent(ServiceInstancesChangedListener.java:113)
	at org.apache.dubbo.registry.zookeeper.ZookeeperServiceDiscoveryChangeWatcher$1.lambda$doNotify$0(ZookeeperServiceDiscoveryChangeWatcher.java:71)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at org.apache.dubbo.registry.zookeeper.ZookeeperServiceDiscoveryChangeWatcher$1.doNotify(ZookeeperServiceDiscoveryChangeWatcher.java:71)
	at org.apache.dubbo.registry.RegistryNotifier$NotificationTask.run(RegistryNotifier.java:106)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

iwangjie avatar Dec 05 '23 07:12 iwangjie

是否选择到了TUN设备

tritone-l avatar Mar 11 '24 06:03 tritone-l