Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lts-admin 日志/节点上下线日志搜索弹出错误对话框问题 #434

Open
15652309089 opened this issue Apr 24, 2019 · 2 comments
Open

Comments

@15652309089
Copy link

15652309089 commented Apr 24, 2019

lts-admin登入后台后,点击日志/节点上下线日志菜单,默认无条件搜索正常,但是当节点组输入某个字符串时,点击搜索,则会弹出一个错误展示层,经过查看日志记录,发现是lts-admin的一个sql bug。
错误代码坐标:com.github.ltsopensource.admin.access.mysql.MysqlBackendNodeOnOfflineLogAccess#buildWhereSql 99行。
报错信息:
com.github.ltsopensource.store.jdbc.exception.JdbcException: Select SQL Error:
SELECT
COUNT(1)
FROM
`lts_admin_node_onoffline_log`
WHERE

GROUP = ? 
AND event = ? 
AND  (
    log_time BETWEEN ? AND ? 
)
at com.github.ltsopensource.store.jdbc.builder.SelectSql.single(SelectSql.java:273)
at com.github.ltsopensource.admin.access.mysql.MysqlBackendNodeOnOfflineLogAccess.count(MysqlBackendNodeOnOfflineLogAccess.java:83)
at com.github.ltsopensource.admin.web.api.NodeApi.getNodeOnofflineLog(NodeApi.java:97)
at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45005)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:817)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:731)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:870)`

错误原因:
查询语句有个字段名group,但这个是个sql关键字,所以翻译后的sql无法被正确解析,故而报错。
解决方案:
第99行,
.andOnNotEmpty("group = ?", request.getGroup())
改为 .andOnNotEmpty("`group` = ?", request.getGroup())即可。

@Jlif
Copy link

Jlif commented Jan 10, 2020

貌似作者都不维护了 🤣

@javase
Copy link

javase commented Jul 16, 2020

我在生产环境,遇到了lts-jobtracker频繁上线、下线的问题[2020年07月16日] 无解

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants