PFyyh opened a new issue, #4840:
URL: https://github.com/apache/shenyu/issues/4840
### Question
When I converted h2 to mysql, I found that the client auto-register failed.
View the shenyu-admin background discovery
```
Field 'match_restful' doesn't have a default value
```
more
```
2023-07-13 16:43:48 [shenyu-disruptor-shenyu_disruptor_consumer_-17] INFO
org.apache.shenyu.admin.service.register.FallbackShenyuClientRegisterService -
Add to Fallback and wait for execution,
/http:[URIRegisterDTO{protocol='http://', appName='http', contextPath='/http',
rpcType='http', host='192.168.27.98', port=8080, eventType=DELETED}]
2023-07-13 16:43:51 [shenyu-disruptor-shenyu_disruptor_consumer_-18] WARN
org.apache.shenyu.admin.service.register.FallbackShenyuClientRegisterService -
Register exception: cause:doRegister Failed to execute,wait to retry.
2023-07-13 16:43:51 [shenyu-disruptor-shenyu_disruptor_consumer_-18] INFO
org.apache.shenyu.admin.service.register.FallbackShenyuClientRegisterService -
Add to Fallback and wait for execution,
/http:[URIRegisterDTO{protocol='http://', appName='http', contextPath='/http',
rpcType='http', host='192.168.27.98', port=8080, eventType=DELETED}]
2023-07-13 16:43:53 [shenyu-shared_wheel_timer-3] WARN
org.apache.shenyu.common.timer.AbstractRetryTask - Failed to execute
task:/http:divide,retried:1 ,total retries:-1,cause:doRegister Failed to
execute,wait to retry.
2023-07-13 16:43:54 [shenyu-disruptor-shenyu_disruptor_consumer_-20] WARN
org.apache.shenyu.admin.service.register.FallbackShenyuClientRegisterService -
Register exception: cause:doRegister Failed to execute,wait to retry.
2023-07-13 16:43:54 [shenyu-disruptor-shenyu_disruptor_consumer_-20] INFO
org.apache.shenyu.admin.service.register.FallbackShenyuClientRegisterService -
Add to Fallback and wait for execution,
/http:[URIRegisterDTO{protocol='http://', appName='http', contextPath='/http',
rpcType='http', host='192.168.27.98', port=8080, eventType=null}]
Exception in thread "shenyu-disruptor-shenyu_disruptor_consumer_-19"
org.springframework.dao.DataIntegrityViolationException:
### Error updating database. Cause: java.sql.SQLException: Field
'match_restful' doesn't have a default value
### The error may exist in class path resource [mappers/selector-sqlmap.xml]
### The error may involve
org.apache.shenyu.admin.mapper.SelectorMapper.insertSelective-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO selector ( id,
date_created, date_updated,
plugin_id,
name, match_mode,
type,
sort, enabled,
loged, continued,
handle ) values ( ?,
?, ?,
?, ?,
?,
?, ?,
?,
?, ?,
? )
### Cause: java.sql.SQLException: Field 'match_restful' doesn't have a
default value
; Field 'match_restful' doesn't have a default value; nested exception is
java.sql.SQLException: Field 'match_restful' doesn't have a default value
at
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:251)
at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at
org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:91)
at
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
at com.sun.proxy.$Proxy101.insert(Unknown Source)
at
org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
at
org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:145)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)
at com.sun.proxy.$Proxy116.insertSelective(Unknown Source)
at
org.apache.shenyu.admin.service.impl.SelectorServiceImpl.registerDefault(SelectorServiceImpl.java:124)
at
org.apache.shenyu.admin.service.impl.SelectorServiceImpl.registerDefault(SelectorServiceImpl.java:138)
at
org.apache.shenyu.admin.service.impl.SelectorServiceImpl$$FastClassBySpringCGLIB$$20b2533e.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.shenyu.admin.service.impl.SelectorServiceImpl$$EnhancerBySpringCGLIB$$c40a7e1b.registerDefault(<generated>)
at
org.apache.shenyu.admin.service.impl.SelectorServiceImpl$$FastClassBySpringCGLIB$$20b2533e.invoke(<generated>)
at
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at
org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386)
at
org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85)
at
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:704)
at
org.apache.shenyu.admin.service.impl.SelectorServiceImpl$$EnhancerBySpringCGLIB$$c0ca8959.registerDefault(<generated>)
at
org.apache.shenyu.admin.service.register.AbstractShenyuClientRegisterServiceImpl.register(AbstractShenyuClientRegisterServiceImpl.java:130)
at
org.apache.shenyu.admin.disruptor.subscriber.MetadataExecutorSubscriber.lambda$executor$0(MetadataExecutorSubscriber.java:51)
at java.util.Optional.ifPresent(Optional.java:159)
at
org.apache.shenyu.admin.disruptor.subscriber.MetadataExecutorSubscriber.lambda$executor$1(MetadataExecutorSubscriber.java:49)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at
org.apache.shenyu.admin.disruptor.subscriber.MetadataExecutorSubscriber.executor(MetadataExecutorSubscriber.java:47)
at
org.apache.shenyu.admin.disruptor.executor.RegisterServerConsumerExecutor.run(RegisterServerConsumerExecutor.java:59)
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:748)
Caused by: java.sql.SQLException: Field 'match_restful' doesn't have a
default value
at
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
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
org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
at
org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
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.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
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.$Proxy124.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.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
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)
... 34 more
2023-07-13 16:43:56 [shenyu-shared_wheel_timer-3] WARN
org.apache.shenyu.common.timer.AbstractRetryTask - Failed to execute
task:/http:divide,retried:1 ,total retries:-1,cause:doRegister Failed to
execute,wait to retry.
2023-07-13 16:43:58 [shenyu-shared_wheel_timer-3] WARN
org.apache.shenyu.common.timer.AbstractRetryTask - Failed to execute
task:/http:divide,retried:2 ,total retries:-1,cause:doRegister Failed to
execute,wait to retry.
2023-07-13 16:43:59 [shenyu-shared_wheel_timer-3] WARN
org.apache.shenyu.common.timer.AbstractRetryTask - Failed to execute
task:/http:divide,retried:1 ,total retries:-1,cause:doRegister Failed to
execute,wait to retry.
```
--
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]