You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "L1yp (via GitHub)" <gi...@apache.org> on 2025/01/10 00:30:33 UTC
[I] [Bug] Invoker not found. [dubbo]
L1yp opened a new issue, #15047:
URL: https://github.com/apache/dubbo/issues/15047
### Pre-check
- [X] I am sure that all the content I provide is in English.
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar issues.
### Apache Dubbo Component
Java SDK (apache/dubbo)
### Dubbo Version
dubbo version: 3.3.2
springboot: 3.2.5
jdk: 21
### Steps to reproduce this issue
dependency:
```xml
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-autoconfigure-compatible</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>3.3.2</version>
</dependency>
```
spring-gateway:
application.yml:
````yml
spring:
application:
name: @artifactId@
profiles:
active: @profiles.active@
cloud:
nacos:
discovery:
server-addr: @nacos.discovery.server-addr@
server-addr: @nacos.discovery.server-addr@
gateway:
routes:
- id: v-system-service-impl
uri: lb://v-system-service-impl
predicates:
- name: Path
args:
pattern: /system/**
filters:
- StripPrefix=1
metadata:
name: 系统服务
- id: v-file-service-impl
uri: lb://v-file-service-impl
predicates:
- name: Path
args:
pattern: /file/**
filters:
- StripPrefix=1
metadata:
name: 文件服务
server:
port: 8000
```
openapi config:
```java
import static org.springdoc.core.utils.Constants.DEFAULT_API_DOCS_URL;
@Configuration
public class OpenApiConfig {
@Bean
@Lazy(false)
public Set<SwaggerUrl> apis(RouteDefinitionLocator locator, SwaggerUiConfigProperties swaggerUiConfigProperties) {
Set<SwaggerUrl> urls = new HashSet<>();
List<RouteDefinition> definitions = locator.getRouteDefinitions().collectList().block();
if (definitions == null) {
return Collections.emptySet();
}
definitions.stream().filter(routeDefinition -> routeDefinition.getId().matches(".*-service-impl")).forEach(routeDefinition -> {
String name = (String) routeDefinition.getMetadata().get("name");
List<PredicateDefinition> predicates = routeDefinition.getPredicates();
PredicateDefinition predicateDefinition = predicates.getFirst();
String pattern = predicateDefinition.getArgs().get("pattern");
String prefix = pattern.replace("/**", "").replace("/", "");
SwaggerUrl swaggerUrl = new SwaggerUrl(name, prefix + DEFAULT_API_DOCS_URL, null);
urls.add(swaggerUrl);
});
swaggerUiConfigProperties.setUrls(urls);
return urls;
}
}
```
v-file-service-impl:
application.yml
```yml
dubbo:
application:
name: ${spring.application.name}
logger: slf4j
protocol:
name: tri
port: 50053
registry:
address: nacos://@nacos.discovery.server-addr@
```
If I access the file service's api document address (http://localhost:8000/file/v3/api-docs) through the gateway, I will find that success and failure alternate. If I directly use the file service's ip:port to access the document address (http://localhost:11002/v3/api-docs), there will be no error.
success:

fail:

file-service is a dubbo provider. If you remove all the provider's @ DubboServices, no error will be reported.

stacktrace:
```TEXT
2025-01-10 08:26:54.435 INFO 8000 --- [erverWorker-7-1] .r.p.t.h.AbstractServerTransportListener : [] [DUBBO] An error occurred while processing the http request with DefaultHttp11ServerTransportListener, Http1Request{method='GET', path='/v3/api-docs', contentType='null'}, dubbo version: 3.3.2, current host: 172.19.0.1
org.apache.dubbo.remoting.http12.exception.HttpStatusException: Invoker not found
at org.apache.dubbo.rpc.protocol.tri.h12.AbstractServerTransportListener.doRoute(AbstractServerTransportListener.java:128)
at org.apache.dubbo.rpc.protocol.tri.h12.AbstractServerTransportListener.onBeforeMetadata(AbstractServerTransportListener.java:122)
at org.apache.dubbo.rpc.protocol.tri.h12.AbstractServerTransportListener.onMetadata(AbstractServerTransportListener.java:89)
at org.apache.dubbo.rpc.protocol.tri.h12.AbstractServerTransportListener.onMetadata(AbstractServerTransportListener.java:54)
at org.apache.dubbo.remoting.http12.netty4.h1.NettyHttp1ConnectionHandler.channelRead0(NettyHttp1ConnectionHandler.java:56)
at org.apache.dubbo.remoting.http12.netty4.h1.NettyHttp1ConnectionHandler.channelRead0(NettyHttp1ConnectionHandler.java:29)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93)
at org.apache.dubbo.remoting.http12.netty4.h1.NettyHttp1Codec.channelRead(NettyHttp1Codec.java:49)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.
```
### What you expected to happen
There is no exception when requesting /v3/api-docs
### Anything else
I guess the problem is caused by the adaptation of triple protocol to spring, but I am not very familiar with triple protocol. I would like to ask the developer to help me troubleshoot it.
### Are you willing to submit a pull request to fix on your own?
- [X] Yes I am willing to submit a pull request on my own!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
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] [Bug] Invoker not found. [dubbo]
Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng closed issue #15047: [Bug] Invoker not found.
URL: https://github.com/apache/dubbo/issues/15047
--
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] [Bug] Invoker not found. [dubbo]
Posted by "L1yp (via GitHub)" <gi...@apache.org>.
L1yp commented on issue #15047:
URL: https://github.com/apache/dubbo/issues/15047#issuecomment-2583045075
I found the cause of the problem because dubbo3 uses the nacos registry. Dual registration mode will be used, resulting in both the http port and dubbo port on a microservice being registered with nacos. Therefore, when the spring gateway obtains nacos services, after Load Balancer, it will poll and invoke these two ports, and it will be found that each time succeeds and the other fails.

--
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