FATAL SugarCRM - Error fetching relationship from cache

From SugarCRM Wiki

Jump to: navigation, search

If you're getting lots of "Error fetching relationship from cache" in your sugarcrm.log, try checking if cache/modules/Relationships/ and cache/modules/ are world writable (or at leat writable by the webserver user).

Fri Nov 17 11:09:19 2006,876 [28695] DEBUG SugarCRM - SugarBean.load_relationships, Loading relationship (meetings).
Fri Nov 17 11:09:19 2006,893 [28695] DEBUG SugarCRM - Link Constructor, relationship name: account_meetings
Fri Nov 17 11:09:19 2006,894 [28695] DEBUG SugarCRM - Link Constructor, Table name: 
Fri Nov 17 11:09:19 2006,895 [28695] DEBUG SugarCRM - Link Constructor, Key name: 
Fri Nov 17 11:09:19 2006,899 [28695] INFO SugarCRM - Query:SELECT * from relationships where deleted=0
Fri Nov 17 11:09:19 2006,901 [28695] INFO SugarCRM - Query Execution Time:0.00063800000000003
Fri Nov 17 11:09:19 2006,904 [28695] FATAL SugarCRM - Error fetching relationship from cache account_meetings
Fri Nov 17 11:09:19 2006,905 [28695] DEBUG SugarCRM - Link Constructor, _bean_table_name: accounts
Fri Nov 17 11:09:19 2006,906 [28695] DEBUG SugarCRM - Link Constructor, _bean_key_name: id
Fri Nov 17 11:09:19 2006,907 [28695] DEBUG SugarCRM - Link Constructor, No relationship record.
Fri Nov 17 11:09:19 2006,908 [28695] DEBUG SugarCRM - getQuery, Bean is LHS: 
Fri Nov 17 11:09:19 2006,909 [28695] DEBUG SugarCRM - getQuery, Relationship type=
Fri Nov 17 11:09:19 2006,910 [28695] DEBUG SugarCRM - getQuery, Relationship role column name=


If the folders are writable, "check cache/modules/Relationships/relationships.cache.php". Based on what relationship name the sugarcrm.log file says the error occurs, search for that relationship name in the relationships.cache.php file. If you can't find it, then the relationship is not stored in the database. To add the relationship, open up your database manager, browse the Relationships table and insert your relationship with the necessary data. After adding the record, you will want to go to "Admin", "Repair" and then "Repair Relationships". Go back to the page you received the relationship error and refresh. If the same problem persists, go back to the log file and check to see if there is a new error.


Another symphtom of the same problem is

SQL: Error retrieving Account list: Query Failed: SELECT cases.id , cases.case_number , cases.name , cases.status , cases.priority , cases.date_entered , jt0.user_name assigned_user_name, cases.assigned_user_id , 'cases' panel_name FROM cases AND jt0.deleted=0 where cases.deleted=0 ORDER BY cases.case_number desc LIMIT 0,10::MySQL error 1064: 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 'AND jt0.deleted=0 where cases.deleted=0 ORDER BY cases.case_number desc LIMIT 0,' at line 1

Or having lots of invalid queries executed, where the join part is missing: FROM xxx AND jt0.deleted=0 where

If your log is empty, check if it was world-write permissions and check Logger on how to raise the log level.

Personal tools