You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "stonelion (via GitHub)" <gi...@apache.org> on 2023/04/14 12:57:41 UTC

[GitHub] [dubbo] stonelion opened a new issue, #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

stonelion opened a new issue, #12097:
URL: https://github.com/apache/dubbo/issues/12097

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.1.8
   * Operating System version: xxx
   * Java version: xxx
   
   ### Steps to reproduce this issue
   
   1. registry 配置了 group。
   2. 启用接口/应用同时注册。
   3. 启动服务。
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Behavior
   
   <!-- What do you expect from the above steps?-->
   
   ### Actual Behavior
   
   <!-- What actually happens? -->
   
   If there is an exception, please attach the exception trace:
   
   ```
   java.lang.RuntimeException: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('.' (code 46)): Expected space separating root-level values
    at [Source: [B@106f2425; line: 1, column: 8]
   	at org.apache.dubbo.common.function.ThrowableFunction.execute(ThrowableFunction.java:54) ~[dubbo-3.1.8.jar!/:3.1.8]
   	at org.apache.dubbo.common.function.ThrowableFunction.execute(ThrowableFunction.java:69) ~[dubbo-3.1.8.jar!/:3.1.8]
   	at org.apache.dubbo.registry.zookeeper.ZookeeperServiceDiscovery.doInServiceDiscovery(ZookeeperServiceDiscovery.java:185) ~[dubbo-3.1.8.jar!/:3.1.8]
   
   ```
   
   原因是 ZookeeperServiceDiscovery 的 /services 目录没有使用二级目录创建,创建到同接口注册的 /{group}/{service-a} 路径下,导致基于接口的服务发现会在该目录下注册旧的(consumer、provider)等目录,导致无法反序列化。
   <img width="498" alt="image" src="https://user-images.githubusercontent.com/5867317/232049292-a399c11b-dde7-4bbd-a925-d9a5c8b93a07.png">
   
   预期,需要在  /{group}/services/{service-a}
   <img width="542" alt="image" src="https://user-images.githubusercontent.com/5867317/232049904-94743aaf-51e0-4b50-b067-af42b8ca7e74.png">
   
   或者有其他解决方式?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败 [dubbo]

Posted by "roadToit (via GitHub)" <gi...@apache.org>.
roadToit commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-2019548728

   请问这个问题有在哪个版本解决吗,我使用3.1.11版本也遇到了这个问题


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1522646465

   可以提供个 demo 应用我看下嘛


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] stonelion commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "stonelion (via GitHub)" <gi...@apache.org>.
stonelion commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1527506942

   zookeeper 版本 3.4.14


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] stonelion commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "stonelion (via GitHub)" <gi...@apache.org>.
stonelion commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1521698721

   是的,在使用 zookeeper 为注册中心时,就可以复现。 先用这个方法 -Ddubbo.registry.parameters.rootPath 规避了


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] stonelion commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "stonelion (via GitHub)" <gi...@apache.org>.
stonelion commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1685821064

   > 是的,在使用 zookeeper 为注册中心时,就可以复现。 先用这个方法 -Ddubbo.registry.parameters.rootPath 规避了
   
   用这个方式规避了。
   @schneiderlin 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] stonelion commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "stonelion (via GitHub)" <gi...@apache.org>.
stonelion commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1508477722

   指定 -Ddubbo.registry.parameters.rootPath=/dubbo_gray_service 貌似可以解决。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] stonelion commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "stonelion (via GitHub)" <gi...@apache.org>.
stonelion commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1685994892

   > 可以 reopen 吗, 不行的话我开个新的 issue. 我这已经几十个注册上去了, 换不了 rootPath
   
   那很麻烦,难搞了。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败 [dubbo]

Posted by "stonelion (via GitHub)" <gi...@apache.org>.
stonelion commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-2024266776

   > @stonelion 请问这个问题有在哪个版本解决吗,我使用3.1.11版本也遇到了这个问题
   
   用这个方法 -Ddubbo.registry.parameters.rootPath 规避,缺点是需要重启所有集群中的服务。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1515850041

   没太懂是啥问题


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] stonelion commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "stonelion (via GitHub)" <gi...@apache.org>.
stonelion commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1522731063

   > 
   1. 应用 A/B 都在同个以 zk 为注册中心。
   2. 配置默认 dubbo.registry.group = gray_env
   3. 应用 A dubbo 版本 3.1.8,仅 provider 。
   4. 应用 B dubbo 版本 3.1.8,仅 consumer 。
   5. 启动应用A
   6. 启动应用B,这个时候,会报错


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1525494124

   > > 
   > 
   > 1. 应用 A/B 都在同个以 zk 为注册中心。
   > 2. 配置默认 dubbo.registry.group = gray_env
   > 3. 应用 A dubbo 版本 3.1.8,仅 provider 。
   > 4. 应用 B dubbo 版本 3.1.8,仅 consumer 。
   > 5. 启动应用A
   > 6. 启动应用B,这个时候,会报错
   
   我本地启了个 demo,没有复现


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] stonelion commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "stonelion (via GitHub)" <gi...@apache.org>.
stonelion commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1527139303

   https://github.com/apache/dubbo-admin/issues/1021 类似的问题


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] schneiderlin commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "schneiderlin (via GitHub)" <gi...@apache.org>.
schneiderlin commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1685867365

   > 我本地启了个 demo,没有复现
   
   @AlbumenJ 我先描述一下, 有需要我再给个最小复现的.
   
   假设 zk 上的 dubbo 注册信息根路径是 /dubbo.
   上面有接口级的例如 
   ```
   /dubbo/com.example.SomeInterface
   ```
   还有应用级的, 例如
   ```
   /dubbo/SomeService
      - 127.0.0.1:20880
   ```
   
   当 org.apache.dubbo.registry.zookeeper.ZookeeperRegistry#doSubscribe 调用的时候, 如果走到了 `ANY_VALUE.equals(url.getServiceInterface())` 的分支, 会把底下所有子节点都 subscribe.
   
   即上面例子的 /dubbo/com.example.SomeInterface 和 /dubbo/SomeService 都 subscribe 了.
   这两个子节点会触发
   ```java
   for (String path : toCategoriesPath(url)) {
     ...
     zkClient.create(path, false);
     ...
   }
   ```
   
   于是应用级的接口就会变成这样
   ```
   /dubbo/SomeService
      - 127.0.0.1:20880
      - configurators
      - consumers
      - providers
      - routers
   ```
   
   应用级节点里面的每个子节点(例子中的127.0.0.1:20880)的内容应该是可以序列化到 ServiceInstance 的 json. 
   但是 configurators, consumers, providers, routers 这几个自动创建的不是 json. 导致解析错误
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] stonelion closed issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "stonelion (via GitHub)" <gi...@apache.org>.
stonelion closed issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败
URL: https://github.com/apache/dubbo/issues/12097


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] schneiderlin commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "schneiderlin (via GitHub)" <gi...@apache.org>.
schneiderlin commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1685800927

   @stonelion 怎么就关了, 现在是只有绕过的方案?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] schneiderlin commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "schneiderlin (via GitHub)" <gi...@apache.org>.
schneiderlin commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1685839535

   可以 reopen 吗, 不行的话我开个新的 issue.
   我这已经几十个注册上去了, 换不了 rootPath


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] stonelion commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "stonelion (via GitHub)" <gi...@apache.org>.
stonelion commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1518579806

   在配置了 dubbo.registry.group = aaa 的情况下。服务会在 /aaa/ 下注册服务发现信息。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12097: 在配置 group 情况下,接口/应用同时注册,会导致 consumer 无法读取到 provide 的服务信息,导致启动失败

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12097:
URL: https://github.com/apache/dubbo/issues/12097#issuecomment-1521141923

   > 当服务发现去扫描 /aaa/users 时,反序列化会报错。因为不是正确的服务 json。
   
   这个是 Dubbo 去做的?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org