[Bug] [Master] fail when submit workflow instance
Search before asking
- [X] I had searched in the issues and found no similar issues.
What happened
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)
18:18
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:650)
at org.apache.dolphinscheduler.server.master.runner.MasterSchedulerBootstrap.run(MasterSchedulerBootstrap.java:134)
Caused by: 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.$Proxy134.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.$Proxy175.queryByTypeAndJobId(Unknown Source)
at org.apache.dolphinscheduler.service.process.TriggerRelationServiceImpl.queryByTypeAndJobId(TriggerRelationServiceImpl.java:50)
at org.apache.dolphinscheduler.service.process.TriggerRelationServiceImpl.saveProcessInstanceTrigger(TriggerRelationServiceImpl.java:65)
at org.apache.dolphinscheduler.service.process.ProcessServiceImpl.handleCommand(ProcessServiceImpl.java:342)
at org.apache.dolphinscheduler.service.process.ProcessServiceImpl$$FastClassBySpringCGLIB$$9d3e18f9.invoke(
What you expected to happen
correct create workflow instance
How to reproduce
1.create a workflow with no scheduler 2.run the workflow
Anything else
no
Version
3.2.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
We met the same problem, and we found the SQL according log: TriggerRelationMapper.xml
`
<select id="queryByTypeAndJobId" resultType="org.apache.dolphinscheduler.dao.entity.TriggerRelation">
select
<include refid="baseSql"/>
from t_ds_trigger_relation
WHERE trigger_type = #{triggerType} and job_id = #{jobId}
</select>
` But we donot known how this occured and how to solve it.
I encountered the same problem
meet the same problem. I take following 3 steps to temporarily avoid this issue:
- backup t_ds_trigger_relation
- delete from t_ds_trigger_relation
- restart dolphinscheduler
the job_id of t_ds_trigger_relation based on id of t_ds_command which is auto incr by mysql but the auto incr is reset by some way (maybe truncate in a dev env.)
the job_id of t_ds_trigger_relation based on id of t_ds_command which is auto incr by mysql but the auto incr is reset by some way (maybe truncate in a dev env.)
It seems like a serious bug, but why haven't others encountered it?
Did you upgrade from the lower version to this version?
Did you upgrade from the lower version to this version?
this problem have nothing to do with version. ealier issue has pointed that t_ds_command auto incre id cause this problem https://github.com/apache/dolphinscheduler/issues/15543
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.
This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.