dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[Bug] [Master] fail when submit workflow instance

Open HSLife1991 opened this issue 1 year ago • 8 comments

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

HSLife1991 avatar Mar 21 '24 14:03 HSLife1991

We met the same problem, and we found the SQL according log: TriggerRelationMapper.xml

` id, trigger_code, trigger_type, job_id, create_time, update_time

<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.

KevinLvLight avatar Mar 26 '24 06:03 KevinLvLight

I encountered the same problem

peak-xu avatar Mar 27 '24 02:03 peak-xu

meet the same problem. I take following 3 steps to temporarily avoid this issue:

  1. backup t_ds_trigger_relation
  2. delete from t_ds_trigger_relation
  3. restart dolphinscheduler

xuet0ng avatar May 09 '24 08:05 xuet0ng

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.)

xuet0ng avatar May 09 '24 09:05 xuet0ng

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?

peak-xu avatar May 15 '24 06:05 peak-xu

Did you upgrade from the lower version to this version?

SbloodyS avatar Jul 01 '24 13:07 SbloodyS

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

originxiong avatar Jul 23 '24 07:07 originxiong

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.

github-actions[bot] avatar Aug 24 '24 00:08 github-actions[bot]

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.

github-actions[bot] avatar Aug 31 '24 00:08 github-actions[bot]