SUITECRM Database failure After Assigning Role Management

Hello Team,

I am facing one issue in suitecrm role management.

After creating roles and assigning a user to the role which is resulting in Database Failure. I don’t know how to resolve this.

Can anyone suggest me how to clear the database failure & assign roles to users.


Database failure. Please refer to suitecrm.log for details.
Wed Nov 2 10:47:30 2022 [504775][1][FATAL] Mysqli_query failed.
Wed Nov 2 10:47:30 2022 [504775][1][FATAL] Error retrieving ACLRole list: Query Failed: (SELECT , users.first_name , users.last_name , LTRIM(RTRIM(CONCAT(IFNULL(users.first_name,’’),’ ‘,IFNULL(users.last_name,’’)))) as full_name, users.user_name , users.phone_work , users.created_by , ‘users’ panel_name FROM users INNER JOIN acl_roles_users ON AND acl_roles_users.role_id=‘125fdbae-1df5-d34a-dd6f-63624a30361b’ AND acl_roles_users.deleted=0

where users.deleted=0) ORDER BY users.user_name asc LIMIT 0,10: MySQL error 1250: Table ‘users’ from one of the SELECTs cannot be used in global ORDER clause

Hello @gowtham.s

I hope this is helpful.

The role management sounds like a different issue, (in terms of the fix is specifically for the subpanel issue) but may be related to bracket issue in the latest version of mysql as well. The error generated looks the same.

This is exactly the same issue and the fix is the same.
Note the error in the subpanned at the bottom of the screenshot.

This issue impacts subpannes in every module as all the supannels use SugarBean.php when pulling data. Where the user first encounters the error is dependent on what part of the CRM they use after the MySQL environment on their server is updated.

To fix:
In SuiteCRM/data/SugarBean.php
Comment out line 876 & 930

Line 876: // $final_query = ‘(’ . $tmp_final_query . ‘)’;

Line 930: // $query = ‘(’ . $query . ‘)’;

1 Like

Cool fix multiple problems with the same fix!


It works now thanks for the solution it is resolved