Content
You are here:
ActionView::Template::Error (Mysql2::Error: You have an error in your SQL syntax
Added by Mohamed Ahmed over 6 years ago
I have a fresh isntallation of openProject on centos 7 and mysql 8 every thing works fine until I try to click on members on any project. then I receive an error 500 message. in the production log i get
ActionView::Template::Error (Mysql2::Error: 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 'groups
ON groups.id = group_users.group_id WHERE `members`.`id` IN' at line 3: SELECT COUNT(DISTINCT `members`.`id`) FROM `members` LEFT OUTER JOIN `member_roles` ON `member_roles`.`member_id` = `members`.`id` LEFT OUTER JOIN `roles` ON `roles`.`id` = `member_roles`.`role_id` LEFT OUTER JOIN `users` ON `users`.`id` = `members`.`user_id` LEFT OUTER JOIN `member_roles` `member_roles_members` ON `member_roles_members`.`member_id` = `members`.`id` LEFT JOIN group_users AS group_users
ON group_users.user_id = members.user_id
LEFT JOIN (SELECT id, lastname AS group_name FROM users) AS groups
ON groups.id = group_users.group_id WHERE `members`.`id` IN (SELECT `members`.`id` FROM `members` WHERE (members.project_id IN ('2')))):
F, [2018-11-14T17:38:40.200098 #53815] FATAL -- : 74: <div>
75: <%= cell Members::UserFilterCell, params, @members_filter_options %>
76: <% if any_members %>
77: <%= cell Members::TableCell, @members, @members_table_options %>
78: <% elsif @is_filtered %>
79: <%= no_results_box custom_title: t(:notice_no_principals_found) %>
80: <% else %>
Replies (5)
I can confirm the same on RHEL 7 with OpenProject 8.1.0 and MySQL 8.0
I had to start over with MySQL 5.7
Playing around a bit with MySQL I got the query to run OK
Seems like keyword groups is missing a couple of ` (grave accent) signs
It seems GROUPS is a new reserved word in MySQL 8.0
https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-new-in-current-series
So and it just got fixed yesterday on the dev branch:
https://github.com/opf/openproject/commit/245ef7b60c041640ee30cb31d97f0ca6119b0c2a#diff-ae1aa6fe7649146b26e74559f917ba4a
I was one day late with the proposed solution :( :)