You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "Python-IBM (via GitHub)" <gi...@apache.org> on 2024/01/09 02:02:58 UTC

[I] the return value of "org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionHolder.get()" is null [shardingsphere]

Python-IBM opened a new issue, #29681:
URL: https://github.com/apache/shardingsphere/issues/29681

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.4.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   Can perform transaction rollback normally.
   
   ### Actual behavior
   Transaction rollback encountered an exception.
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   1. **sharding rule configuration**
   ![image](https://github.com/apache/shardingsphere/assets/33851767/5ad2dd77-d7fc-4f0e-a664-3a58e51ef950)
   
   2. **exception log**
   org.springframework.jdbc.UncategorizedSQLException: 
   ### Error updating database.  Cause: java.sql.SQLException: Unknown exception: Cannot invoke "io.seata.tm.api.GlobalTransaction.rollback()" because the return value of "org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionHolder.get()" is null
   ### The error may exist in file [E:\SpringProject\demo-dubbo\samples-account\target\classes\mapper\TAccountMapper.xml]
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: update t_account set amount = amount-5.0 where user_id = ?
   ### Cause: java.sql.SQLException: Unknown exception: Cannot invoke "io.seata.tm.api.GlobalTransaction.rollback()" because the return value of "org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionHolder.get()" is null
   ; uncategorized SQLException; SQL state [HY000]; error code [30000]; Unknown exception: Cannot invoke "io.seata.tm.api.GlobalTransaction.rollback()" because the return value of "org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionHolder.get()" is null
   	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:93) ~[mybatis-spring-3.0.3.jar:3.0.3]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439) ~[mybatis-spring-3.0.3.jar:3.0.3]
   	at jdk.proxy2/jdk.proxy2.$Proxy98.update(Unknown Source) ~[na:na]
   	at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:288) ~[mybatis-spring-3.0.3.jar:3.0.3]
   	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:67) ~[mybatis-3.5.14.jar:3.5.14]
   	at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:141) ~[mybatis-3.5.14.jar:3.5.14]
   	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86) ~[mybatis-3.5.14.jar:3.5.14]
   	at jdk.proxy2/jdk.proxy2.$Proxy99.decreaseAccount(Unknown Source) ~[na:na]
   	at com.demo.account.service.impl.TAccountServiceImpl.decreaseAccount(TAccountServiceImpl.java:36) ~[classes/:na]
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
   	at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
   	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:352) ~[spring-aop-6.1.2.jar:6.1.2]
   	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:713) ~[spring-aop-6.1.2.jar:6.1.2]
   	at com.demo.account.service.impl.TAccountServiceImpl$$SpringCGLIB$$0.decreaseAccount(<generated>) ~[classes/:na]
   	at com.demo.service.account.ITAccountServiceDubboWrap1.invokeMethod(ITAccountServiceDubboWrap1.java) ~[classes/:na]
   	at org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:89) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:100) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.config.invoker.DelegateProviderMetaDataInvoker.invoke(DelegateProviderMetaDataInvoker.java:55) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.filter.ClassLoaderCallbackFilter.invoke(ClassLoaderCallbackFilter.java:38) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at com.alibaba.dubbo.rpc.Invoker$CompatibleInvoker.invoke(Invoker.java:77) ~[dubbo-3.2.10.jar:3.2.10]
   	at io.seata.integration.dubbo.alibaba.AlibabaDubboTransactionPropagationFilter.invoke(AlibabaDubboTransactionPropagationFilter.java:45) ~[seata-all-2.0.0.jar:2.0.0]
   	at com.alibaba.dubbo.rpc.Filter.invoke(Filter.java:34) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:80) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:45) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.seata.SeataTransactionPropagationProviderFilter.invoke(SeataTransactionPropagationProviderFilter.java:66) ~[dubbo-filter-seata-1.0.2.jar:1.0.2]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:108) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:54) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.filter.AccessLogFilter.invoke(AccessLogFilter.java:120) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.metrics.observation.ObservationReceiverFilter.invoke(ObservationReceiverFilter.java:57) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:222) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:54) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:41) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.metrics.filter.MetricsFilter.invoke(MetricsFilter.java:86) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.metrics.filter.MetricsProviderFilter.invoke(MetricsProviderFilter.java:37) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.filter.ProfilerServerFilter.invoke(ProfilerServerFilter.java:66) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:145) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CallbackRegistrationInvoker.invoke(FilterChainBuilder.java:197) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:167) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:110) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:205) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) ~[dubbo-3.2.10.jar:3.2.10]
   	at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:64) ~[dubbo-3.2.10.jar:3.2.10]
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
   	at org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:39) ~[dubbo-3.2.10.jar:3.2.10]
   	at java.base/java.lang.Thread.run(Thread.java:842) ~[na:na]
   Caused by: java.sql.SQLException: Unknown exception: Cannot invoke "io.seata.tm.api.GlobalTransaction.rollback()" because the return value of "org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionHolder.get()" is null
   	at org.apache.shardingsphere.infra.util.exception.external.sql.ShardingSphereSQLException.toSQLException(ShardingSphereSQLException.java:62) ~[shardingsphere-infra-util-5.4.0.jar:5.4.0]
   	at org.apache.shardingsphere.dialect.SQLExceptionTransformEngine.toSQLException(SQLExceptionTransformEngine.java:62) ~[shardingsphere-dialect-exception-core-5.4.0.jar:5.4.0]
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.execute(ShardingSpherePreparedStatement.java:416) ~[shardingsphere-jdbc-core-5.4.0.jar:5.4.0]
   	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[HikariCP-5.0.1.jar:na]
   	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[HikariCP-5.0.1.jar:na]
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:48) ~[mybatis-3.5.14.jar:3.5.14]
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:75) ~[mybatis-3.5.14.jar:3.5.14]
   	at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) ~[mybatis-3.5.14.jar:3.5.14]
   	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.5.14.jar:3.5.14]
   	at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.5.14.jar:3.5.14]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ~[mybatis-3.5.14.jar:3.5.14]
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
   	at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-3.0.3.jar:3.0.3]
   	... 62 common frames omitted
   Caused by: java.lang.NullPointerException: Cannot invoke "io.seata.tm.api.GlobalTransaction.rollback()" because the return value of "org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionHolder.get()" is null
   	at org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager.rollback(SeataATShardingSphereTransactionManager.java:132) ~[shardingsphere-transaction-base-seata-at-5.4.0.jar:5.4.0]
   	at org.apache.shardingsphere.transaction.ConnectionTransaction.rollback(ConnectionTransaction.java:125) ~[shardingsphere-transaction-core-5.4.0.jar:5.4.0]
   	at org.apache.shardingsphere.driver.jdbc.core.connection.DriverDatabaseConnectionManager.rollback(DriverDatabaseConnectionManager.java:172) ~[shardingsphere-jdbc-core-5.4.0.jar:5.4.0]
   	at org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection.rollback(ShardingSphereConnection.java:199) ~[shardingsphere-jdbc-core-5.4.0.jar:5.4.0]
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeWithImplicitCommitTransaction(ShardingSpherePreparedStatement.java:446) ~[shardingsphere-jdbc-core-5.4.0.jar:5.4.0]
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.execute(ShardingSpherePreparedStatement.java:411) ~[shardingsphere-jdbc-core-5.4.0.jar:5.4.0]
   	... 75 common frames omitted
   
   
   ### Example codes for reproduce this issue (such as a github link).
   ![image](https://github.com/apache/shardingsphere/assets/33851767/e6c20783-b08f-4b96-a2a8-37d6050b9409)
   


-- 
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@shardingsphere.apache.org.apache.org

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


Re: [I] the return value of "org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionHolder.get()" is null [shardingsphere]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #29681:
URL: https://github.com/apache/shardingsphere/issues/29681#issuecomment-1934852226

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


-- 
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@shardingsphere.apache.org

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


Re: [I] the return value of "org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionHolder.get()" is null [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #29681:
URL: https://github.com/apache/shardingsphere/issues/29681#issuecomment-1964433113

   - I noticed Dubbo in Log, for the RPC scenario I explained in #30304 . Therefore I will continue to close the current issue with a documentation PR.


-- 
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@shardingsphere.apache.org

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


Re: [I] the return value of "org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionHolder.get()" is null [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #29681: the return value of "org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionHolder.get()" is null
URL: https://github.com/apache/shardingsphere/issues/29681


-- 
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@shardingsphere.apache.org

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


Re: [I] the return value of "org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionHolder.get()" is null [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #29681:
URL: https://github.com/apache/shardingsphere/issues/29681#issuecomment-1946125535

   - This is actually a duplicate of https://github.com/apache/shardingsphere/issues/22356#issuecomment-1327052449 . 
   - Since the corresponding committer has not yet received any additional replies, you may consider setting up an interceptor or submitting a possible PR. Whether it is an Interceptor of HandlerInterceptor or an Interceptor in other senses.


-- 
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@shardingsphere.apache.org

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