Happy-shi opened a new issue, #4155:
URL: https://github.com/apache/incubator-streampark/issues/4155

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-streampark/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### Java Version
   
   1.8
   
   ### Scala Version
   
   2.11.x
   
   ### StreamPark Version
   
   2.1.5
   
   ### Flink Version
   
   1.16.2
   
   ### deploy mode
   
   yarn-application
   
   ### What happened
   
   When build fails, a message is generated and sent to the database using 
messageService.push, but the write fails with the error shown below. On the 
other hand, failure to catch this failed, resulting in subsequent code not 
being executed.
   
   On the issue of write failure, the data type of type is inconsistent. We 
should add the @EnumValue annotation to the attribute code in 
NoticeTypeEnum.java, just like code in UserTypeEnum. On the other hand, we 
should catch exceptions in messageService.push to prevent subsequent code from 
being executed
   
   
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/AppBuildPipeServiceImpl.java
   `Message message = new Message(
                               ServiceHelper.getUserId(),
                               app.getId(),
                               app.getJobName().concat(" release failed"),
                               
ExceptionUtils.stringifyException(snapshot.error().exception()),
                               NoticeTypeEnum.EXCEPTION);
                           messageService.push(message);
                           app.setRelease(ReleaseStateEnum.FAILED.get());
                           app.setOptionState(OptionStateEnum.NONE.getValue());
                           app.setBuild(true);
                           applicationLog.setException(
                               
ExceptionUtils.stringifyException(snapshot.error().exception()));
                           applicationLog.setSuccess(false);
   `
   
   
   
   ### Error Exception
   
   ```log
   StreamPark [streampark-build-pipeline-executor-0] ERROR 
o.a.s.c.c.s.impl.MessageServiceImpl:50 - Error pushing notice: 
   ### Error updating database.  Cause: java.sql.SQLException: Incorrect 
integer value: 'EXCEPTION' for column 'type' at row 1
   ### The error may exist in 
org/apache/streampark/console/core/mapper/MessageMapper.java (best guess)
   ### The error may involve 
org.apache.streampark.console.core.mapper.MessageMapper.insert-Inline
   ### The error occurred while setting parameters
   ### SQL: INSERT INTO t_message  ( app_id, user_id, title, type, context, 
is_read, create_time )  VALUES  ( ?, ?, ?, ?, ?, ?, ? )
   ### Cause: java.sql.SQLException: Incorrect integer value: 'EXCEPTION' for 
column 'type' at row 1
   ; uncategorized SQLException; SQL state [HY000]; error code [1366]; 
Incorrect integer value: 'EXCEPTION' for column 'type' at row 1; nested 
exception is java.sql.SQLException: Incorrect integer value: 'EXCEPTION' for 
column 'type' at row 1
   org.springframework.jdbc.UncategorizedSQLException: 
   ### Error updating database.  Cause: java.sql.SQLException: Incorrect 
integer value: 'EXCEPTION' for column 'type' at row 1
   ### The error may exist in 
org/apache/streampark/console/core/mapper/MessageMapper.java (best guess)
   ### The error may involve 
org.apache.streampark.console.core.mapper.MessageMapper.insert-Inline
   ### The error occurred while setting parameters
   ### SQL: INSERT INTO t_message  ( app_id, user_id, title, type, context, 
is_read, create_time )  VALUES  ( ?, ?, ?, ?, ?, ?, ? )
   ### Cause: java.sql.SQLException: Incorrect integer value: 'EXCEPTION' for 
column 'type' at row 1
   ; uncategorized SQLException; SQL state [HY000]; error code [1366]; 
Incorrect integer value: 'EXCEPTION' for column 'type' at row 1; nested 
exception is java.sql.SQLException: Incorrect integer value: 'EXCEPTION' for 
column 'type' at row 1
           at 
org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92)
           at 
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
           at com.sun.proxy.$Proxy85.insert(Unknown Source)
           at 
org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272)
           at 
com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:59)
           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.$Proxy137.insert(Unknown Source)
           at 
com.baomidou.mybatisplus.extension.service.IService.save(IService.java:63)
           at 
org.apache.streampark.console.core.service.impl.MessageServiceImpl.push(MessageServiceImpl.java:47)
           at 
org.apache.streampark.console.core.service.impl.MessageServiceImpl$$FastClassBySpringCGLIB$$888209f9.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.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
           at 
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
           at 
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
           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.streampark.console.core.service.impl.MessageServiceImpl$$EnhancerBySpringCGLIB$$ef046bc3.push(<generated>)
           at 
org.apache.streampark.console.core.service.impl.AppBuildPipeServiceImpl$1.onFinish(AppBuildPipeServiceImpl.java:373)
           at 
org.apache.streampark.flink.packer.pipeline.BuildPipeline.launch(BuildPipeline.scala:150)
           at 
org.apache.streampark.flink.packer.pipeline.BuildPipeline.launch$(BuildPipeline.scala:128)
           at 
org.apache.streampark.flink.packer.pipeline.impl.FlinkYarnApplicationBuildPipeline.launch(FlinkYarnApplicationBuildPipeline.scala:32)
           at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
           at java.util.concurrent.FutureTask.run(FutureTask.java:266)
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at java.lang.Thread.run(Thread.java:750)
   Caused by: java.sql.SQLException: Incorrect integer value: 'EXCEPTION' for 
column 'type' at row 1
           at 
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
           at 
com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
           at 
com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
           at 
com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370)
           at 
com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
           at 
com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
           at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at 
org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
           at com.sun.proxy.$Proxy127.execute(Unknown Source)
           at 
org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
           at 
org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
           at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:64)
           at com.sun.proxy.$Proxy126.update(Unknown Source)
           at 
org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
           at 
org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
           at 
org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
           at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
           at 
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106)
           at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62)
           at com.sun.proxy.$Proxy125.update(Unknown Source)
           at 
org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:194)
           at 
org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:181)
           at sun.reflect.GeneratedMethodAccessor162.invoke(Unknown Source)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at 
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427)
           ... 29 common frames omitted
   ```
   
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!(您是否要贡献这个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