houlangs / Newlangs4

厚浪开发的新一代二级域名系统
https://app.houlangs.com
MIT License
50 stars 16 forks source link

[bug] 保存设置时报错 #72

Closed Chun-QiuCC closed 1 week ago

Chun-QiuCC commented 1 week ago

使用Linux版本:Debian GNU/Linux 11 后端版本:4.6 后端Java环境:Zulu21.38+21-CA 后端MySQL版本:MySQL5.7.40

报错前的操作:在管理员后台的通用配置页进行配置,点击报错,报错;其它页面均可正常保存

报错信息:

com.guaning.newlangs.mapper.ConfigMapper.updateById (batch index #1) failed. Cause: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE k='common_code'' at line 1
; bad SQL grammar []

报错界面截图: image

Chun-QiuCC commented 1 week ago

经过测试,使用 openjdk-17.0.13+11 依旧会出现上述问题 补充说明:控制面板与后端为分开部署

Chun-QiuCC commented 1 week ago

这是后端的log:


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.3.1)

2024-11-01T16:12:28.524-04:00  INFO 3515286 --- [newlangs] [           main] c.guaning.newlangs.NewlangsApplication   : Starting NewlangsApplication v4.6.0 using Java 17.0.13 with PID 3515286 (/www/wwwroot/app.iei.ee/newlangs-springboot-4.6.0.jar started by root in /www/wwwroot/app.iei.ee)
2024-11-01T16:12:28.526-04:00  INFO 3515286 --- [newlangs] [           main] c.guaning.newlangs.NewlangsApplication   : No active profile set, falling back to 1 default profile: "default"
2024-11-01T16:12:29.584-04:00  INFO 3515286 --- [newlangs] [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
2024-11-01T16:12:29.592-04:00  INFO 3515286 --- [newlangs] [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2024-11-01T16:12:29.641-04:00  INFO 3515286 --- [newlangs] [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 30 ms. Found 0 Redis repository interfaces.
2024-11-01T16:12:30.465-04:00  INFO 3515286 --- [newlangs] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8080 (http)
2024-11-01T16:12:30.475-04:00  INFO 3515286 --- [newlangs] [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2024-11-01T16:12:30.476-04:00  INFO 3515286 --- [newlangs] [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.25]
2024-11-01T16:12:30.610-04:00  INFO 3515286 --- [newlangs] [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2024-11-01T16:12:30.611-04:00  INFO 3515286 --- [newlangs] [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1971 ms
Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter.
Get /192.166.82.127 network interface 
Get network interface info: name:eth0 (eth0)
Initialization Sequence datacenterId:22 workerId:10
 _ _   |_  _ _|_. ___ _ |    _ 
| | |\/|_)(_| | |_\  |_)||_|_\ 
     /               |         
                        3.5.7 
2024-11-01T16:12:32.520-04:00  INFO 3515286 --- [newlangs] [           main] c.guaning.newlangs.config.WebMvcConfig   : 添加拦截
____ ____    ___ ____ _  _ ____ _  _ 
[__  |__| __  |  |  | |_/  |___ |\ | 
___] |  |     |  |__| | \_ |___ | \| 
https://sa-token.cc (v1.35.0.RC)
2024-11-01T16:12:33.163-04:00  INFO 3515286 --- [newlangs] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8080 (http) with context path '/'
2024-11-01T16:12:33.186-04:00  INFO 3515286 --- [newlangs] [           main] c.guaning.newlangs.NewlangsApplication   : Started NewlangsApplication in 5.473 seconds (process running for 6.088)
2024-11-01T16:13:05.219-04:00  INFO 3515286 --- [newlangs] [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-11-01T16:13:05.220-04:00  INFO 3515286 --- [newlangs] [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2024-11-01T16:13:05.221-04:00  INFO 3515286 --- [newlangs] [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
---------- 进入Sa-Token全局认证 -----------
---------- 进入Sa-Token异常处理 -----------
---------- 进入Sa-Token全局认证 -----------
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@26793c86] was not registered for synchronization because synchronization is not active
2024-11-01T16:13:07.054-04:00  INFO 3515286 --- [newlangs] [nio-8080-exec-2] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2024-11-01T16:13:07.134-04:00  WARN 3515286 --- [newlangs] [nio-8080-exec-2] c.zaxxer.hikari.util.DriverDataSource    : Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2024-11-01T16:13:07.330-04:00  INFO 3515286 --- [newlangs] [nio-8080-exec-2] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@11afde59
2024-11-01T16:13:07.332-04:00  INFO 3515286 --- [newlangs] [nio-8080-exec-2] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
JDBC Connection [HikariProxyConnection@2078839326 wrapping com.mysql.cj.jdbc.ConnectionImpl@11afde59] will not be managed by Spring
==>  Preparing: SELECT id,email,password,name,id_number,phone,point,role_id,login_time,created_time,updated_time,status,is_deleted,sign_in,is_exchange FROM user WHERE is_deleted=0 AND (email = ?)
==> Parameters: 1@1.com(String)
<==    Columns: id, email, password, name, id_number, phone, point, role_id, login_time, created_time, updated_time, status, is_deleted, sign_in, is_exchange
<==        Row: 111, 1@1.com, e10adc3949ba59abbe56e057f20f883e, 小浪浪, 114514, 114514, 100, 1, 2024-11-01 16:09:03, null, null, 1, 0, null, 0
<==      Total: 1
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@26793c86]
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@586f4cfb] was not registered for synchronization because synchronization is not active
JDBC Connection [HikariProxyConnection@1119220689 wrapping com.mysql.cj.jdbc.ConnectionImpl@11afde59] will not be managed by Spring
==>  Preparing: UPDATE user SET email=?, password=?, name=?, id_number=?, phone=?, point=?, role_id=?, login_time=?, status=?, is_exchange=? WHERE id=? AND is_deleted=0
==> Parameters: 1@1.com(String), e10adc3949ba59abbe56e057f20f883e(String), 小浪浪(String), 114514(String), 114514(String), 100(Integer), 1(Integer), 2024-11-01T16:13:07.490315364(LocalDateTime), 1(Integer), 0(Integer), 111(Long)
<==    Updates: 1
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@586f4cfb]
---------- 进入Sa-Token全局认证 -----------
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1ffd11c4] was not registered for synchronization because synchronization is not active
JDBC Connection [HikariProxyConnection@780626694 wrapping com.mysql.cj.jdbc.ConnectionImpl@11afde59] will not be managed by Spring
==>  Preparing: SELECT id,email,password,name,id_number,phone,point,role_id,login_time,created_time,updated_time,status,is_deleted,sign_in,is_exchange FROM user WHERE id=? AND is_deleted=0
==> Parameters: 111(Long)
<==    Columns: id, email, password, name, id_number, phone, point, role_id, login_time, created_time, updated_time, status, is_deleted, sign_in, is_exchange
<==        Row: 111, 1@1.com, e10adc3949ba59abbe56e057f20f883e, 小浪浪, 114514, 114514, 100, 1, 2024-11-01 16:13:07, null, null, 1, 0, null, 0
<==      Total: 1
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1ffd11c4]
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@38d23ac2] was not registered for synchronization because synchronization is not active
JDBC Connection [HikariProxyConnection@868828765 wrapping com.mysql.cj.jdbc.ConnectionImpl@11afde59] will not be managed by Spring
==>  Preparing: SELECT k,v FROM config
==> Parameters: 
<==    Columns: k, v
<==        Row: common_code, null
<==        Row: common_point, 100
<==        Row: default_point, 200
<==        Row: mail_connectionTimeout, 0
<==        Row: mail_from, null
<==        Row: mail_host, null
<==        Row: mail_pass, null
<==        Row: mail_port, null
<==        Row: mail_sslEnable, true
<==        Row: mail_starttlsEnable, true
<==        Row: mail_timeout, 0
<==        Row: mail_user, null
<==        Row: no_prefix, app
<==        Row: scan_keyWords, 厚浪
<==        Row: sign_point, 1
<==      Total: 15
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@38d23ac2]
---------- 进入Sa-Token全局认证 -----------
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@38d0a55] was not registered for synchronization because synchronization is not active
JDBC Connection [HikariProxyConnection@223011924 wrapping com.mysql.cj.jdbc.ConnectionImpl@11afde59] will not be managed by Spring
==>  Preparing: SELECT id,email,password,name,id_number,phone,point,role_id,login_time,created_time,updated_time,status,is_deleted,sign_in,is_exchange FROM user WHERE id=? AND is_deleted=0
==> Parameters: 111(Long)
<==    Columns: id, email, password, name, id_number, phone, point, role_id, login_time, created_time, updated_time, status, is_deleted, sign_in, is_exchange
<==        Row: 111, 1@1.com, e10adc3949ba59abbe56e057f20f883e, 小浪浪, 114514, 114514, 100, 1, 2024-11-01 16:13:07, null, null, 1, 0, null, 0
<==      Total: 1
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@38d0a55]
JDBC Connection [HikariProxyConnection@742348779 wrapping com.mysql.cj.jdbc.ConnectionImpl@11afde59] will be managed by Spring
==>  Preparing: UPDATE config WHERE k=?
==> Parameters: common_code(String)
==>  Preparing: UPDATE config SET v=? WHERE k=?
==> Parameters: 100(String), common_point(String)
==> Parameters: 200(String), default_point(String)
==> Parameters: 0(String), mail_connectionTimeout(String)
==>  Preparing: UPDATE config WHERE k=?
==> Parameters: mail_from(String)
==>  Preparing: UPDATE config SET v=? WHERE k=?
==> Parameters: 465(String), mail_host(String)
==>  Preparing: UPDATE config WHERE k=?
==> Parameters: mail_pass(String)
==> Parameters: mail_port(String)
==>  Preparing: UPDATE config SET v=? WHERE k=?
==> Parameters: true(String), mail_sslEnable(String)
==> Parameters: true(String), mail_starttlsEnable(String)
==> Parameters: 0(String), mail_timeout(String)
==>  Preparing: UPDATE config WHERE k=?
==> Parameters: mail_user(String)
==>  Preparing: UPDATE config SET v=? WHERE k=?
==> Parameters: app(String), no_prefix(String)
==> Parameters: 厚浪(String), scan_keyWords(String)
==> Parameters: 1(String), sign_point(String)
---------- 进入Sa-Token全局认证 -----------
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3a6bfccd] was not registered for synchronization because synchronization is not active
JDBC Connection [HikariProxyConnection@883688944 wrapping com.mysql.cj.jdbc.ConnectionImpl@11afde59] will not be managed by Spring
==>  Preparing: SELECT id,email,password,name,id_number,phone,point,role_id,login_time,created_time,updated_time,status,is_deleted,sign_in,is_exchange FROM user WHERE id=? AND is_deleted=0
==> Parameters: 111(Long)
<==    Columns: id, email, password, name, id_number, phone, point, role_id, login_time, created_time, updated_time, status, is_deleted, sign_in, is_exchange
<==        Row: 111, 1@1.com, e10adc3949ba59abbe56e057f20f883e, 小浪浪, 114514, 114514, 100, 1, 2024-11-01 16:13:07, null, null, 1, 0, null, 0
<==      Total: 1
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3a6bfccd]
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@15bef084] was not registered for synchronization because synchronization is not active
JDBC Connection [HikariProxyConnection@1306444315 wrapping com.mysql.cj.jdbc.ConnectionImpl@11afde59] will not be managed by Spring
==>  Preparing: SELECT k,v FROM config
==> Parameters: 
<==    Columns: k, v
<==        Row: common_code, null
<==        Row: common_point, 100
<==        Row: default_point, 200
<==        Row: mail_connectionTimeout, 0
<==        Row: mail_from, null
<==        Row: mail_host, null
<==        Row: mail_pass, null
<==        Row: mail_port, null
<==        Row: mail_sslEnable, true
<==        Row: mail_starttlsEnable, true
<==        Row: mail_timeout, 0
<==        Row: mail_user, null
<==        Row: no_prefix, app
<==        Row: scan_keyWords, 厚浪
<==        Row: sign_point, 1
<==      Total: 15
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@15bef084]
2024-11-01T16:13:20.847-04:00  INFO 3515286 --- [newlangs] [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2024-11-01T16:13:20.858-04:00  INFO 3515286 --- [newlangs] [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
SunWuyuan commented 1 week ago

检查数据库连接,检查数据库是否已经导入表结构

Chun-QiuCC commented 1 week ago

检查数据库连接,检查数据库是否已经导入表结构

检查过,有导入教程中给出的数据库,其它页(例如保存域名)配置的内容也正常写入表了,唯独通用配置会报错

SunWuyuan commented 1 week ago

检查数据库连接,检查数据库是否已经导入表结构

检查过,有导入教程中给出的数据库,其它页(例如保存域名)配置的内容也正常写入表了,唯独通用配置会报错

你好像没有填写「通用兑换码」,每一项配置都是必填的

Chun-QiuCC commented 1 week ago

你好像没有填写「通用兑换码」,每一项配置都是必填的

每一项都不能为空否则会报错? 建议改一下,有点折磨)

SunWuyuan commented 1 week ago

你好像没有填写「通用兑换码」,每一项配置都是必填的

每一项都不能为空否则会报错? 建议改一下,有点折磨)

您的反馈已收到