Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The integration of Seata with the Nacos module: No available service #3143

Closed
ruansheng8 opened this issue Feb 6, 2023 · 4 comments · May be fixed by #3159
Closed

The integration of Seata with the Nacos module: No available service #3143

ruansheng8 opened this issue Feb 6, 2023 · 4 comments · May be fixed by #3159
Labels
area/nacos spring cloud alibaba nacos area/seata

Comments

@ruansheng8
Copy link
Collaborator

ruansheng8 commented Feb 6, 2023

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
  2. Modifying the pom.xml file in the spring-cloud-alibaba-dependencies module (only for testing purposes):
<sentinel.version>1.7.0-SNAPSHOT</sentinel.version>
  1. 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
  2. Call http://127.0.0.1:18081/seata/feign, and you will see the following exception message:
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

    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.

@ruansheng8
Copy link
Collaborator Author

ruansheng8 commented Feb 7, 2023

Has there been any code adjustment in the service discovery section of Seata in version 1.7.0-SNAPSHOT ? @wangliang181230

@ruansheng8 ruansheng8 added the area/nacos spring cloud alibaba nacos label Feb 7, 2023
@slievrly
Copy link
Member

@ruansheng8 I have checked the code, there is no discovery module related code after 1.6.1 release.

@slievrly
Copy link
Member

package seata-server use maven:
mvn clean install -Prelease-seata -DskipTests=true

@ruansheng8
Copy link
Collaborator Author

The modification of the version of seata-discovery-core module to 1.5.2 by the dubbo-filter-seata module resulted in the example service and seata-server being able to obtain corresponding instances in different nacos groups (SEATA_GROUP).

1676462360729_5A2BE5A3-642B-414a-B7FA-8BADE79B7CA4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/nacos spring cloud alibaba nacos area/seata
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants