The integration of Seata with the Nacos module: No available service
envgap__alibaba__spring-cloud-alibaba-3143
01 / FAILURE SIGNATURE
As reported upstream
io.seata.common.exception.FrameworkException: No available service
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
f0533175ae81a6c4bce677f1e601c3c4f7c7f042- Manifest
spring-cloud-alibaba-examples/seata-example/account-service/pom.xml- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
alibaba/spring-cloud-alibaba #3143 · read the original issue
**Which Component**
Spring Cloud Alibaba: `2022.0.0.0-RC1`, Seata: `1.7.0-SNAPSHOT`, Nacos Client: `2.2.1-RC`, Nacos Server: `1.4.x` or `2.x`
**Describe the bug**
1. Tests were conducted using the Seata `master (1.6.1)` branch and the functionality is work.
2. When using the Seata `develop (1.7.0-SNAPSHOT)` branch code, an exception will be thrown: "No available service"
**To Reproduce**
1. Building using the Seata `develop` branch code: `mvn clean install -Dmaven.test.skip=true`
3. Modifying the `pom.xml` file in the `spring-cloud-alibaba-dependencies` module (only for testing purposes):
```xml
<sentinel.version>1.7.0-SNAPSHOT</sentinel.version>
```
4. Starting the necessary services based on the `readme-zh.md` in the examples section.
See examples: https://github.com/alibaba/spring-cloud-alibaba/tree/2022.x/spring-cloud-alibaba-examples/seata-example
5. Call `http://127.0.0.1:18081/seata/feign`, and you will see the following exception message:
```java
2023-02-06T21:30:55.744+08:00 WARN 29612 --- [io-18081-exec-1] ServiceLoader$InnerEnhancedServiceLoader : Load [io.seata.core.context.ContextCore] class fail: no service files found in 'META-INF/seata/'.
2023-02-06T21:30:55.745+08:00 DEBUG 29612 --- [io-18081-exec-1] .s.i.h.TransactionPropagationInterceptor : xid in RootContext[null] xid in HttpContext[null]
2023-02-06T21:30:55.758+08:00 WARN 29612 --- [io-18081-exec-1] ServiceLoader$InnerEnhancedServiceLoader : Load [io.seata.core.model.TransactionManager] class fail: no service files found in 'META-INF/seata/'.
2023-02-06T21:30:55.758+08:00 INFO 29612 --- [io-18081-exec-1] io.seata.tm.TransactionManagerHolder : TransactionManager Singleton io.seata.tm.DefaultTransactionManager@69f929b1
2023-02-06T21:30:55.762+08:00 ERROR 29612 --- [io-18081-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: io.seata.common.exception.FrameworkException: No available service] with root cause
io.seata.common.exception.FrameworkException: No available service
at io.seata.core.rpc.netty.AbstractNettyRemotingClient.loadBalance(AbstractNettyRemotingClient.java:266) ~[seata-all-1.6.1.jar:1.6.1]
at io.seata.core.rpc.netty.AbstractNettyRemotingClient.sendSyncRequest(AbstractNettyRemotingClient.java:142) ~[seata-all-1.6.1.jar:1.6.1]
at io.seata.tm.DefaultTransactionManager.syncCall(DefaultTransactionManager.java:95) ~[seata-all-1.6.1.jar:1.6.1]
at io.seata.tm.DefaultTransactionManager.begin(DefaultTransactionManager.java:53) ~[seata-all-1.6.1.jar:1.6.1]
at io.seata.tm.api.DefaultGlobalTransaction.begin(DefaultGlobalTransaction.java:114) ~[seata-all-1.6.1.jar:1.6.1]
at io.seata.tm.api.TransactionalTemplate.beginTransaction(TransactionalTemplate.java:250) ~[seata-all-1.6.1.jar:1.6.1]
at io.seata.tm.api.TransactionalTemplate.execute(TransactionalTemplate.java:125) ~[seata-all-1.6.1.jar:1.6.1]
at io.seata.spring.annotation.GlobalTransactionalInterceptor.handleGlobalTransaction(GlobalTransactionalInterceptor.java:201) ~[seata-all-1.6.1.jar:1.6.1]
at io.seata.spring.annotation.GlobalTransactionalInterceptor.invoke(GlobalTransactionalInterceptor.java:171) ~[seata-all-1.6.1.jar:1.6.1]
......
2023-02-06T21:30:55.769+08:00 DEBUG 29612 --- [io-18081-exec-1] .s.i.h.TransactionPropagationInterceptor : xid in RootContext[null] xid in HttpContext[null]
2023-02-06T21:31:40.685+08:00 ERROR 29612 --- [eoutChecker_1_1] i.s.c.r.netty.NettyClientChannelManager : no available service found in cluster 'default', please make sure registry config correct and keep your seata server running
2023-02-06T21:31:40.934+08:00 ERROR 29612 --- [eoutChecker_2_1] i.s.c.r.netty.NettyClientChannelManager : no available service found in cluster 'default', please make sure registry config correct and keep your seata server running
2023-02-06T21:31:50.697+08:00 ERROR 29612 --- [eoutChecker_1_1] i.s.c.r.netty.NettyClientChannelManager : no available service found in cluster 'default', please make sure registry config correct and keep your seata server running
```
`AbstractNettyRemotingClient.java`
```java
protected String loadBalance(String transactionServiceGroup, Object msg) {
InetSocketAddress address = null;
try {
@SuppressWarnings("unchecked")
List<InetSocketAddress> inetSocketAddressList = RegistryFactory.getInstance().aliveLookup(transactionServiceGroup);
address = this.doSelect(inetSocketAddressList, msg);
} catch (Exception ex) {
LOGGER.error(ex.getMessage());
}
}
```
It seems that `RegistryFactory.getInstance().aliveLookup(transactionServiceGroup)` is unable to discover other services.
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]