yangzhiyuss opened a new issue, #12818:
URL: https://github.com/apache/dolphinscheduler/issues/12818

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   任务进行启动后,作业提交成功,但一直等待,查看日志发生如下错误: master一直报错,日志连续刷,写满磁盘
   [ERROR] 2022-11-08 16:24:39.293 +0800 
org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable:[701] 
- [WorkflowInstance-127147][TaskInstance-0] - Start workflow error
   org.mybatis.spring.MyBatisSystemException: nested exception is 
org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or 
null) to be returned by selectOne(), but found: 2
           at 
org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:96)
           at 
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
           at com.sun.proxy.$Proxy128.selectOne(Unknown Source)
           at 
org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
           at 
com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:89)
           at 
com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
           at 
com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
           at com.sun.proxy.$Proxy158.queryByDefinitionCodeAndVersion(Unknown 
Source)
           at jdk.internal.reflect.GeneratedMethodAccessor263.invoke(Unknown 
Source)
           at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.base/java.lang.reflect.Method.invoke(Method.java:566)
           at 
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
           at 
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
           at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
           at 
org.springframework.cache.interceptor.CacheInterceptor.lambda$invoke$0(CacheInterceptor.java:54)
           at 
org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:366)
           at 
org.springframework.cache.interceptor.CacheAspectSupport.lambda$handleSynchronizedGet$1(CacheAspectSupport.java:447)
           at org.springframework.cache.support.NoOpCache.get(NoOpCache.java:76)
           at 
org.springframework.cache.interceptor.CacheAspectSupport.handleSynchronizedGet(CacheAspectSupport.java:442)
           at 
org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:382)
           at 
org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:345)
           at 
org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:64)
           at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
           at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
           at com.sun.proxy.$Proxy159.queryByDefinitionCodeAndVersion(Unknown 
Source)
           at 
org.apache.dolphinscheduler.service.process.ProcessServiceImpl.findTaskDefinition(ProcessServiceImpl.java:2743)
         at 
org.apache.dolphinscheduler.service.process.ProcessServiceImpl.findTaskDefinition(ProcessServiceImpl.java:2743)
           at 
org.apache.dolphinscheduler.service.process.ProcessServiceImpl.lambda$getTaskDefineLogListByRelation$7(ProcessServiceImpl.java:2733)
           at java.base/java.util.HashMap.forEach(HashMap.java:1337)
           at 
org.apache.dolphinscheduler.service.process.ProcessServiceImpl.getTaskDefineLogListByRelation(ProcessServiceImpl.java:2732)
           at 
org.apache.dolphinscheduler.service.process.ProcessServiceImpl$$FastClassBySpringCGLIB$$9d3e18f9.invoke(<generated>)
           at 
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
           at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
           at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
           at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
           at 
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
           at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
           at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
           at 
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
           at 
org.apache.dolphinscheduler.service.process.ProcessServiceImpl$$EnhancerBySpringCGLIB$$298ed92f.getTaskDefineLogListByRelation(<generated>)
           at 
org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.buildFlowDag(WorkflowExecuteRunnable.java:777)
           at 
org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.call(WorkflowExecuteRunnable.java:685)
           at 
java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
           at java.base/java.lang.Thread.run(Thread.java:834)
   Caused by: org.apache.ibatis.exceptions.TooManyResultsException: Expected 
one result (or null) to be returned by selectOne(), but found: 2
           at 
org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:80)
           at jdk.internal.reflect.GeneratedMethodAccessor80.invoke(Unknown 
Source)
           at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.base/java.lang.reflect.Method.invoke(Method.java:566)
           at 
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427)
           ... 43 common frames omitted
   
   
   
   
   ### What you expected to happen
   
   任务开始执行
   
   ### How to reproduce
   
   编写工作流后执行,失败后,更改任务的信息,再上线,执行,出现上面错误。
   问题追踪:t_ds_task_definition_log中code和version会存在重复的情况, 
queryByDefinitionCodeAndVersion函数返回的信息不止一个,报错
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   3.1.x
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### 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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to