chaosblade-box,演练场景列表显示不出任何数据,都是提示“当前分类暂无场景,请重新选择”,
/chaos/QuerySceneFunctionByCategoryId接口报500错误,
报错信息:"\n### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'chaosblade.t_chaos_scene_authorized.authorized_id' which is not functionally dependent on columns in GROUP BY clause;
this is incompatible with sql_mode=only_full_group_by\n###
The error may exist in com/alibaba/chaosblade/box/dao/mapper/SceneAuthorizedMapper.java (best guess)\n###
The error may involve defaultParameterMap\n### The error occurred while setting parameters\n### SQL:
SELECT authorized_id,function_id,function_name,function_code,grant_from,grant_to,permission,enabled,phase,source,function_create_time,support_host,support_k8s,is_public,
is_delete,id,gmt_create,gmt_modified FROM t_chaos_scene_authorized
WHERE function_id IN (?,?,?,?,?) AND ( enabled = ? ) AND (permission & 4) = 4 AND (phase & 2) > 0 AND support_k8s = ? AND is_delete = ? AND ( ( grant_to = ? AND is_public = ? ) OR
( is_public = ? ) ) GROUP BY function_id ORDER BY function_create_time DESC\n###
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and
contains nonaggregated column 'chaosblade.t_chaos_scene_authorized.authorized_id' which is not functionally dependent on columns in GROUP BY clause;
this is incompatible with sql_mode=only_full_group_by\n; bad SQL grammar [];
nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'chaosblade.t_chaos_scene_authorized.authorized_id'
which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by"
运行ChaosBlade-Box请使用5.6及以下版本,5.7以上版本请设置全局变量
登录mysql,设置全局变量
# 登录mysql
sh-x.x# mysql -u username[登录mysql的用户名] -p password[登录mysql的密码]
# 设置全局变量
mysql> set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
设置后有可能会报错:ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'
是因为使用的mysql版本废弃了NO_AUTO_CREATE_USER
使用下面的命令即可:
SET GLOBAL sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
我没有使用过 chaosblade-box,所以不太清楚你的问题的具体原因。你可以尝试在 chaosblade-box 的官方论坛或者社区发布你的问题,或者在 chaosblade-box 的 GitHub 仓库中提交 issue。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。