salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.45k stars 2.08k forks source link

Database Failure after upgrading to Version 7.11.4 #7267

Closed mattlt closed 5 years ago

mattlt commented 5 years ago

Issue

Project and Project Task module are not showing panels for History, Accounts, etc. Giving a "Database Failure." instead.

It showing up for me in the Project and Project Task pages after a task is updated. Projects and tasks that don't have any new changes seem to show up fine.

Expected Behavior

Panels should be included on the page and no database error.

Actual Behavior

Here's the full error from sugarcrm.log for a Project…

Mon May  6 16:54:47 2019 [1634868][a90eeb47-6353-ad30-24ee-4464c2afb170][FATAL] Mysqli_query failed.
Mon May  6 16:54:47 2019 [1634868][a90eeb47-6353-ad30-24ee-4464c2afb170][FATAL] Error retrieving Project list:  Query Failed: (SELECT meetings.id ,  meetings.assigned_user_id  ,  meetings.name ,  meetings.status ,  '                                                                                                                                                                                                                                                              ' contact_name ,  '                                    '  contact_id ,  meetings.date_modified ,  meetings.date_entered ,  meetings.date_end  as date_due  ,  jt1.user_name assigned_user_name ,  jt1.created_by assigned_user_name_owner  ,  'Users' assigned_user_name_mod,  0 reply_to_status ,  '                                                                                                                                                                                                                                                              ' contact_name_owner ,  '                                                                                                                                                                                                                                                              ' contact_name_mod ,  meetings.parent_id ,  meetings.parent_type ,  '                                                                                                                                                                                                                                                              ' filename ,  meetings.recurring_source ,  '                                                                                                                                                                                                                                                              ' assigned_user_owner ,  '                                                                                                                                                                                                                                                              ' assigned_user_mod ,  meetings.created_by  ,  'meetings' panel_name, NULL date_end  FROM meetings  LEFT JOIN meetings_cstm ON meetings.id = meetings_cstm.id_c   LEFT JOIN  users jt1 ON meetings.assigned_user_id=jt1.id AND jt1.deleted=0

 AND jt1.deleted=0 INNER JOIN  project meetings_rel ON meetings.parent_id=meetings_rel.id AND meetings_rel.deleted=0
 AND meetings.parent_type = 'Project'
  where ( meetings.parent_id='d5540060-0175-0932-0024-56f18d7afbc9' AND (meetings.status='Held' OR meetings.status='Not Held')) AND meetings.deleted=0) UNION ALL ( SELECT calls.id ,  calls.assigned_user_id  ,  calls.name ,  calls.status ,  '                                                                                                                                                                                                                                                              ' contact_name ,  '                                    '  contact_id ,  calls.date_modified ,  calls.date_entered ,  calls.date_end  as date_due  ,  jt1.user_name assigned_user_name ,  jt1.created_by assigned_user_name_owner  ,  'Users' assigned_user_name_mod,  0 reply_to_status ,  '                                                                                                                                                                                                                                                              ' contact_name_owner ,  '                                                                                                                                                                                                                                                              ' contact_name_mod ,  calls.parent_id ,  calls.parent_type ,  '                                                                                                                                                                                                                                                              ' filename ,  calls.recurring_source ,  '                                                                                                                                                                                                                                                              ' assigned_user_owner ,  '                                                                                                                                                                                                                                                              ' assigned_user_mod ,  calls.created_by  ,  'calls' panel_name, NULL date_end  FROM calls  LEFT JOIN calls_cstm ON calls.id = calls_cstm.id_c   LEFT JOIN  users jt1 ON calls.assigned_user_id=jt1.id AND jt1.deleted=0

 AND jt1.deleted=0 INNER JOIN  project calls_rel ON calls.parent_id=calls_rel.id AND calls_rel.deleted=0
 AND calls.parent_type = 'Project'
  where ( calls.parent_id='d5540060-0175-0932-0024-56f18d7afbc9' AND (calls.status='Held' OR calls.status='Not Held')) AND calls.deleted=0 ) UNION ALL ( SELECT tasks.id ,  tasks.assigned_user_id  ,  tasks.name ,  tasks.status  ,  LTRIM(RTRIM(CONCAT(IFNULL(contacts.first_name,''),' ',IFNULL(contacts.last_name,'')))) contact_name ,  tasks.contact_id  ,  tasks.date_modified ,  tasks.date_entered , NULL date_due,  jt1.user_name assigned_user_name ,  jt1.created_by assigned_user_name_owner  ,  'Users' assigned_user_name_mod,  0 reply_to_status ,  '                                                                                                                                                                                                                                                              ' contact_name_owner ,  '                                                                                                                                                                                                                                                              ' contact_name_mod ,  tasks.parent_id ,  tasks.parent_type ,  '                                                                                                                                                                                                                                                              ' filename , NULL recurring_source,  '                                                                                                                                                                                                                                                              ' assigned_user_owner ,  '                                                                                                                                                                                                                                                              ' assigned_user_mod ,  tasks.created_by  ,  'tasks' panel_name,  tasks.date_end    FROM tasks   LEFT JOIN  contacts contacts ON tasks.contact_id=contacts.id AND contacts.deleted=0

 AND contacts.deleted=0  LEFT JOIN  users jt1 ON tasks.assigned_user_id=jt1.id AND jt1.deleted=0

 AND jt1.deleted=0 INNER JOIN  project tasks_rel ON tasks.parent_id=tasks_rel.id AND tasks_rel.deleted=0
 AND tasks.parent_type = 'Project'
  where ( tasks.parent_id='d5540060-0175-0932-0024-56f18d7afbc9' AND (tasks.status='Completed' OR tasks.status='Deferred')) AND tasks.deleted=0 ) UNION ALL ( SELECT notes.id ,  notes.assigned_user_id  ,  notes.name ,  '                                                                                                                                                                                                                                                              ' status  ,  LTRIM(RTRIM(CONCAT(IFNULL(contacts.first_name,''),' ',IFNULL(contacts.last_name,'')))) contact_name ,  notes.contact_id  ,  notes.date_modified ,  notes.date_entered  , NULL date_due,  jt1.user_name assigned_user_name ,  jt1.created_by assigned_user_name_owner  ,  'Users' assigned_user_name_mod,  0 reply_to_status ,  '                                                                                                                                                                                                                                                              ' contact_name_owner ,  '                                                                                                                                                                                                                                                              ' contact_name_mod ,  notes.parent_id ,  notes.parent_type ,  notes.filename , NULL recurring_source,  '                                                                                                                                                                                                                                                              ' assigned_user_owner ,  '                                                                                                                                                                                                                                                              ' assigned_user_mod ,  notes.created_by  ,  'notes' panel_name, NULL date_end  FROM notes   LEFT JOIN  contacts contacts ON notes.contact_id=contacts.id AND contacts.deleted=0

 AND contacts.deleted=0  LEFT JOIN  users jt1 ON notes.assigned_user_id=jt1.id AND jt1.deleted=0

 AND jt1.deleted=0 INNER JOIN  project notes_rel ON notes.parent_id=notes_rel.id AND notes_rel.deleted=0
 AND notes.parent_type = 'Project'
  where ( notes.parent_id='d5540060-0175-0932-0024-56f18d7afbc9') AND notes.deleted=0 ) UNION ALL ( SELECT emails.id ,  emails.assigned_user_id  ,  emails.name ,  emails.status ,  '                                                                                                                                                                                                                                                              ' contact_name ,  '                                                                                                                                                                                                                                                              ' contact_id ,  emails.date_modified ,  emails.date_entered  , NULL date_due,  jt0.user_name assigned_user_name ,  jt0.created_by assigned_user_name_owner  ,  'Users' assigned_user_name_mod,  emails.reply_to_status ,  '                                                                                                                                                                                                                                                              ' contact_name_owner ,  '                                                                                                                                                                                                                                                              ' contact_name_mod ,  emails.parent_id ,  emails.parent_type ,  '                                                                                                                                                                                                                                                              ' filename , NULL recurring_source,  '                                                                                                                                                                                                                                                              ' assigned_user_owner ,  '                                                                                                                                                                                                                                                              ' assigned_user_mod ,  emails.created_by  ,  'emails' panel_name, NULL date_end  FROM emails   LEFT JOIN  users jt0 ON emails.assigned_user_id=jt0.id AND jt0.deleted=0

 AND jt0.deleted=0 INNER JOIN  emails_beans ON emails.id=emails_beans.email_id AND emails_beans.bean_id='d5540060-0175-0932-0024-56f18d7afbc9' AND emails_beans.deleted=0
 AND emails_beans.bean_module = 'Project'
  where emails.deleted=0 ) ORDER BY date_entered desc LIMIT 0,100: MySQL error 1054: Unknown column 'tasks.date_end' in 'field list'
Mon May  6 16:54:47 2019 [1634868][a90eeb47-6353-ad30-24ee-4464c2afb170][FATAL] Exception handling in /home/theperip/public_html/macula/include/MVC/Controller/SugarController.php:400
Mon May  6 16:54:47 2019 [1634868][a90eeb47-6353-ad30-24ee-4464c2afb170][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.
Mon May  6 16:54:47 2019 [1634868][a90eeb47-6353-ad30-24ee-4464c2afb170][FATAL] backtrace:
#0 /home/theperip/public_html/macula/include/database/DBManager.php(353): sugar_die('Database failur...')
#1 /home/theperip/public_html/macula/include/database/DBManager.php(328): DBManager->registerError('Error retrievin...', 'MySQL error 105...', true)
#2 /home/theperip/public_html/macula/include/database/MysqliManager.php(179): DBManager->checkError('Error retrievin...', true)
#3 /home/theperip/public_html/macula/include/database/MysqlManager.php(285): MysqliManager->query('(SELECT meeting...', true, 'Error retrievin...')
#4 /home/theperip/public_html/macula/data/SugarBean.php(1286): MysqlManager->limitQuery('(SELECT meeting...', 0, 100, true, 'Error retrievin...')
#5 /home/theperip/public_html/macula/data/SugarBean.php(1018): SugarBean->process_union_list_query(Object(Project), '(SELECT meeting...', 0, -1, 100, '', Object(aSubPanel), '( SELECT count(...', Array)
#6 /home/theperip/public_html/macula/include/ListView/ListView.php(1152): SugarBean::get_union_related_list(Object(Project), 'date_entered', 'desc', '', 0, -1, 100, '', Object(aSubPanel))
#7 /home/theperip/public_html/macula/include/ListView/ListViewSubPanel.php(142): ListView->processUnionBeans(Object(Project), Object(aSubPanel), 'history_CELL', false)
#8 /home/theperip/public_html/macula/include/SubPanel/SubPanel.php(220): ListViewSubPanel->process_dynamic_listview('Project', Object(Project), Object(aSubPanel), false)
#9 /home/theperip/public_html/macula/include/SubPanel/SubPanelTiles.php(358): SubPanel->ProcessSubPanelListView('include/SubPane...', Array)
#10 /home/theperip/public_html/macula/include/MVC/View/SugarView.php(1191): SubPanelTiles->display()
#11 /home/theperip/public_html/macula/include/MVC/View/SugarView.php(255): SugarView->_displaySubPanels()
#12 /home/theperip/public_html/macula/include/MVC/Controller/SugarController.php(435): SugarView->process()
#13 /home/theperip/public_html/macula/include/MVC/Controller/SugarController.php(375): SugarController->processView()
#14 /home/theperip/public_html/macula/include/MVC/SugarApplication.php(113): SugarController->execute()
#15 /home/theperip/public_html/macula/index.php(52): SugarApplication->execute()
#16 {main}

Here's the full error from sugarcrm.log for a Project Task…

Tue May  7 08:34:15 2019 [1943875][a90eeb47-6353-ad30-24ee-4464c2afb170][FATAL] Mysqli_query failed.
Tue May  7 08:34:15 2019 [1943875][a90eeb47-6353-ad30-24ee-4464c2afb170][FATAL] Error retrieving ProjectTask list:  Query Failed: (SELECT meetings.id ,  meetings.assigned_user_id  ,  meetings.name ,  meetings.status ,  '                                                                                                                                                                                                                                                              ' contact_name ,  '                                    '  contact_id ,  meetings.date_modified ,  meetings.date_entered ,  meetings.date_end  as date_due  ,  jt1.user_name assigned_user_name ,  jt1.created_by assigned_user_name_owner  ,  'Users' assigned_user_name_mod,  0 reply_to_status ,  '                                                                                                                                                                                                                                                              ' contact_name_owner ,  '                                                                                                                                                                                                                                                              ' contact_name_mod ,  meetings.parent_id ,  meetings.parent_type ,  '                                                                                                                                                                                                                                                              ' filename ,  meetings.recurring_source ,  '                                                                                                                                                                                                                                                              ' assigned_user_owner ,  '                                                                                                                                                                                                                                                              ' assigned_user_mod ,  meetings.created_by  ,  'meetings' panel_name, NULL date_end  FROM meetings  LEFT JOIN meetings_cstm ON meetings.id = meetings_cstm.id_c   LEFT JOIN  users jt1 ON meetings.assigned_user_id=jt1.id AND jt1.deleted=0

 AND jt1.deleted=0 INNER JOIN  project_task meetings_rel ON meetings.parent_id=meetings_rel.id AND meetings_rel.deleted=0
 AND meetings.parent_type = 'ProjectTask'
  where ( meetings.parent_id='c332c7c2-5375-1a0d-0e28-5c337c6ca6bf' AND (meetings.status='Held' OR meetings.status='Not Held')) AND meetings.deleted=0) UNION ALL ( SELECT tasks.id ,  tasks.assigned_user_id  ,  tasks.name ,  tasks.status  ,  LTRIM(RTRIM(CONCAT(IFNULL(contacts.first_name,''),' ',IFNULL(contacts.last_name,'')))) contact_name ,  tasks.contact_id  ,  tasks.date_modified ,  tasks.date_entered , NULL date_due,  jt1.user_name assigned_user_name ,  jt1.created_by assigned_user_name_owner  ,  'Users' assigned_user_name_mod,  0 reply_to_status ,  '                                                                                                                                                                                                                                                              ' contact_name_owner ,  '                                                                                                                                                                                                                                                              ' contact_name_mod ,  tasks.parent_id ,  tasks.parent_type ,  '                                                                                                                                                                                                                                                              ' filename , NULL recurring_source,  '                                                                                                                                                                                                                                                              ' assigned_user_owner ,  '                                                                                                                                                                                                                                                              ' assigned_user_mod ,  tasks.created_by  ,  'tasks' panel_name,  tasks.date_end    FROM tasks   LEFT JOIN  contacts contacts ON tasks.contact_id=contacts.id AND contacts.deleted=0

 AND contacts.deleted=0  LEFT JOIN  users jt1 ON tasks.assigned_user_id=jt1.id AND jt1.deleted=0

 AND jt1.deleted=0 INNER JOIN  project_task tasks_rel ON tasks.parent_id=tasks_rel.id AND tasks_rel.deleted=0
 AND tasks.parent_type = 'ProjectTask'
  where ( tasks.parent_id='c332c7c2-5375-1a0d-0e28-5c337c6ca6bf' AND (tasks.status='Completed' OR tasks.status='Deferred')) AND tasks.deleted=0 ) UNION ALL ( SELECT calls.id ,  calls.assigned_user_id  ,  calls.name ,  calls.status ,  '                                                                                                                                                                                                                                                              ' contact_name ,  '                                    '  contact_id ,  calls.date_modified ,  calls.date_entered ,  calls.date_end  as date_due  ,  jt1.user_name assigned_user_name ,  jt1.created_by assigned_user_name_owner  ,  'Users' assigned_user_name_mod,  0 reply_to_status ,  '                                                                                                                                                                                                                                                              ' contact_name_owner ,  '                                                                                                                                                                                                                                                              ' contact_name_mod ,  calls.parent_id ,  calls.parent_type ,  '                                                                                                                                                                                                                                                              ' filename ,  calls.recurring_source ,  '                                                                                                                                                                                                                                                              ' assigned_user_owner ,  '                                                                                                                                                                                                                                                              ' assigned_user_mod ,  calls.created_by  ,  'calls' panel_name, NULL date_end  FROM calls  LEFT JOIN calls_cstm ON calls.id = calls_cstm.id_c   LEFT JOIN  users jt1 ON calls.assigned_user_id=jt1.id AND jt1.deleted=0

 AND jt1.deleted=0 INNER JOIN  project_task calls_rel ON calls.parent_id=calls_rel.id AND calls_rel.deleted=0
 AND calls.parent_type = 'ProjectTask'
  where ( calls.parent_id='c332c7c2-5375-1a0d-0e28-5c337c6ca6bf' AND (calls.status='Held' OR calls.status='Not Held')) AND calls.deleted=0 ) UNION ALL ( SELECT notes.id ,  notes.assigned_user_id  ,  notes.name ,  '                                                                                                                                                                                                                                                              ' status  ,  LTRIM(RTRIM(CONCAT(IFNULL(contacts.first_name,''),' ',IFNULL(contacts.last_name,'')))) contact_name ,  notes.contact_id  ,  notes.date_modified ,  notes.date_entered  , NULL date_due,  jt1.user_name assigned_user_name ,  jt1.created_by assigned_user_name_owner  ,  'Users' assigned_user_name_mod,  0 reply_to_status ,  '                                                                                                                                                                                                                                                              ' contact_name_owner ,  '                                                                                                                                                                                                                                                              ' contact_name_mod ,  notes.parent_id ,  notes.parent_type ,  notes.filename , NULL recurring_source,  '                                                                                                                                                                                                                                                              ' assigned_user_owner ,  '                                                                                                                                                                                                                                                              ' assigned_user_mod ,  notes.created_by  ,  'notes' panel_name, NULL date_end  FROM notes   LEFT JOIN  contacts contacts ON notes.contact_id=contacts.id AND contacts.deleted=0

 AND contacts.deleted=0  LEFT JOIN  users jt1 ON notes.assigned_user_id=jt1.id AND jt1.deleted=0

 AND jt1.deleted=0 INNER JOIN  project_task notes_rel ON notes.parent_id=notes_rel.id AND notes_rel.deleted=0
 AND notes.parent_type = 'ProjectTask'
  where ( notes.parent_id='c332c7c2-5375-1a0d-0e28-5c337c6ca6bf') AND notes.deleted=0 ) UNION ALL ( SELECT emails.id ,  emails.assigned_user_id  ,  emails.name ,  emails.status ,  '                                                                                                                                                                                                                                                              ' contact_name ,  '                                                                                                                                                                                                                                                              ' contact_id ,  emails.date_modified ,  emails.date_entered  , NULL date_due,  jt0.user_name assigned_user_name ,  jt0.created_by assigned_user_name_owner  ,  'Users' assigned_user_name_mod,  emails.reply_to_status ,  '                                                                                                                                                                                                                                                              ' contact_name_owner ,  '                                                                                                                                                                                                                                                              ' contact_name_mod ,  emails.parent_id ,  emails.parent_type ,  '                                                                                                                                                                                                                                                              ' filename , NULL recurring_source,  '                                                                                                                                                                                                                                                              ' assigned_user_owner ,  '                                                                                                                                                                                                                                                              ' assigned_user_mod ,  emails.created_by  ,  'emails' panel_name, NULL date_end  FROM emails   LEFT JOIN  users jt0 ON emails.assigned_user_id=jt0.id AND jt0.deleted=0

 AND jt0.deleted=0 INNER JOIN  emails_beans ON emails.id=emails_beans.email_id AND emails_beans.bean_id='c332c7c2-5375-1a0d-0e28-5c337c6ca6bf' AND emails_beans.deleted=0
 AND emails_beans.bean_module = 'ProjectTask'
  where emails.deleted=0 ) ORDER BY date_entered desc LIMIT 0,100: MySQL error 1054: Unknown column 'tasks.date_end' in 'field list'
Tue May  7 08:34:15 2019 [1943875][a90eeb47-6353-ad30-24ee-4464c2afb170][FATAL] Exception handling in /home/theperip/public_html/macula/include/MVC/Controller/SugarController.php:400
Tue May  7 08:34:15 2019 [1943875][a90eeb47-6353-ad30-24ee-4464c2afb170][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.
Tue May  7 08:34:15 2019 [1943875][a90eeb47-6353-ad30-24ee-4464c2afb170][FATAL] backtrace:
#0 /home/theperip/public_html/macula/include/database/DBManager.php(353): sugar_die('Database failur...')
#1 /home/theperip/public_html/macula/include/database/DBManager.php(328): DBManager->registerError('Error retrievin...', 'MySQL error 105...', true)
#2 /home/theperip/public_html/macula/include/database/MysqliManager.php(179): DBManager->checkError('Error retrievin...', true)
#3 /home/theperip/public_html/macula/include/database/MysqlManager.php(285): MysqliManager->query('(SELECT meeting...', true, 'Error retrievin...')
#4 /home/theperip/public_html/macula/data/SugarBean.php(1286): MysqlManager->limitQuery('(SELECT meeting...', 0, 100, true, 'Error retrievin...')
#5 /home/theperip/public_html/macula/data/SugarBean.php(1018): SugarBean->process_union_list_query(Object(ProjectTask), '(SELECT meeting...', 0, -1, 100, '', Object(aSubPanel), '( SELECT count(...', Array)
#6 /home/theperip/public_html/macula/include/ListView/ListView.php(1152): SugarBean::get_union_related_list(Object(ProjectTask), 'date_entered', 'desc', '', 0, -1, 100, '', Object(aSubPanel))
#7 /home/theperip/public_html/macula/include/ListView/ListViewSubPanel.php(142): ListView->processUnionBeans(Object(ProjectTask), Object(aSubPanel), 'history_CELL', false)
#8 /home/theperip/public_html/macula/include/SubPanel/SubPanel.php(220): ListViewSubPanel->process_dynamic_listview('ProjectTask', Object(ProjectTask), Object(aSubPanel), false)
#9 /home/theperip/public_html/macula/include/SubPanel/SubPanelTiles.php(358): SubPanel->ProcessSubPanelListView('include/SubPane...', Array)
#10 /home/theperip/public_html/macula/include/MVC/View/SugarView.php(1191): SubPanelTiles->display()
#11 /home/theperip/public_html/macula/include/MVC/View/SugarView.php(255): SugarView->_displaySubPanels()
#12 /home/theperip/public_html/macula/include/MVC/Controller/SugarController.php(435): SugarView->process()
#13 /home/theperip/public_html/macula/include/MVC/Controller/SugarController.php(375): SugarController->processView()
#14 /home/theperip/public_html/macula/include/MVC/SugarApplication.php(113): SugarController->execute()
#15 /home/theperip/public_html/macula/index.php(52): SugarApplication->execute()
#16 {main}

Steps to Reproduce

  1. Updated to SuiteCRM 7.11.4
  2. Updated a task inside a Project or Project Task
  3. Navigated to the Project/Project Task Page
  4. Received the fatal, database error.

Context

Major, Fatal Error.

Cannot create new tasks or relationships from a Project or Project Task due to the panels not showing up.

Your Environment

mattlt commented 5 years ago

At least one other person is having the same issue…

https://suitecrm.com/suitecrm/forum/installation-upgrade-help/24551-database-failure-after-upgrading-to-version-7-11-4

mattlt commented 5 years ago

It looks like I'm only getting the database failure error when there's an open task for a Project or a Project Task. If I close all the tasks for the Project, the Project's page loads normally.

The moment I open up a new task for the Project I get the database failure error again.

Thanks,

•• matt

kunsirat-kps commented 5 years ago

I have similar issue. I could not access any case that includes opening tasks and getting the database failure error. In the log, it mentions that ...MySQL error 1054: Unknown column 'tasks.date_end' in 'field list'. And if I have changed this file modules/Tasks/metadata/subpanels/ForActivities.php to be like this:

'date_due' => array( 'vname' => 'LBL_LIST_DUE_DATE', 'width' => '10%', 'alias' => 'date_due', 'sort_by' => 'date_due', ),

Then I could access case but task due date is still not be shown in the list view of Activity panel. image

mattlt commented 5 years ago

Thank you so much Kunsirat-kps! That got our activities panel back. It's true that the task due date doesn't show, but at least the page works now.

Thanks again!

•• matt

tellmewhy99 commented 5 years ago

Hello guys, we also have the same issue after upgraded to 7.11.4

Our's one is MySQL error 1054: Unknown column 'contact_event_attendees.account_id' in 'where clause' , any solution for this please?

sospc commented 5 years ago

Exactly the same error happens here. Anyone found a fix already? For me this workaround works.

'date_due' => array( 'vname' => 'LBL_LIST_DUE_DATE', 'width' => '10%', 'alias' => 'date_start', 'sort_by' => 'date_start', ),

Thanks Kunsirat and Mattlt

pgorod commented 5 years ago

Possibly related: https://suitecrm.com/suitecrm/forum/suitecrm-7-0-discussion/24647-database-failure-product-view

aalcaine commented 5 years ago

Same issue happens to us (same error and steps to reproduce). I think it's well documented in this issue, but if need more info and logs, just tell and I'll post them here.

riotctrl commented 5 years ago

I have similar issue. I could not access any case that includes opening tasks and getting the database failure error. In the log, it mentions that ...MySQL error 1054: Unknown column 'tasks.date_end' in 'field list'. And if I have changed this file modules/Tasks/metadata/subpanels/ForActivities.php to be like this:

'date_due' => array( 'vname' => 'LBL_LIST_DUE_DATE', 'width' => '10%', 'alias' => 'date_due', 'sort_by' => 'date_due', ),

Then I could access case but task due date is still not be shown in the list view of Activity panel. image

Were you able to get a due date to show up there for tasks?

xavmp commented 5 years ago

Today I applied the Update….. Error still there, no fix.

kunsirat-kps commented 5 years ago

I have similar issue. I could not access any case that includes opening tasks and getting the database failure error. In the log, it mentions that ...MySQL error 1054: Unknown column 'tasks.date_end' in 'field list'. And if I have changed this file modules/Tasks/metadata/subpanels/ForActivities.php to be like this: 'date_due' => array( 'vname' => 'LBL_LIST_DUE_DATE', 'width' => '10%', 'alias' => 'date_due', 'sort_by' => 'date_due', ), Then I could access case but task due date is still not be shown in the list view of Activity panel. image

Were you able to get a due date to show up there for tasks?

@riotctrl for Tasks, I never get a due date to show up on subpanel view

markbond1007 commented 5 years ago

HI,

I had added Activities to Events and after the upgrade to 7.11.5 I had this problem (couldnt even get through to the event). I changed the entry to date_due and the page works again, but no Due date in the sub panel. I would also point out that the ForHistory subpanel already has "date_due" in it and it also isnt displaying the date.

Regards

Mark

macroplan commented 5 years ago

Upgrade to 7.11.5 - the error persists for me also. Was able "get by" with help from kunsirat-kps fix above. Thanks! I would rather not show the due date on tasks within a project rather than have the database error break display of all sub-panels

Dillon-Brown commented 5 years ago

Hi guys, I've put up a potential fix for this here: #7517. Let me know if you encounter any issues, thanks.

markbond1007 commented 5 years ago

@Dillon-Brown

Hi Just checked through this, however I note that your fix is for the File:

modules/Meetings/metadata/subpanels/ForHistory.php

The file I had to change was:

modules/Tasks/metadata/subpanels/ForActivities.php

I may be missing something, but I think this may only be a partial fix.

Dillon-Brown commented 5 years ago

@markbond1007 I think you would be able to edit either due_date in ForActivities or ForHistory.php and it would resolve the db error. Although it does look like while my fix resolves the db and missing due_date from activities it removes due date from history... I'll take another look.

Dillon-Brown commented 5 years ago

Pushed a new commit, seems to resolve the issue for me on both subpanels.

evgu commented 5 years ago

@Dillon-Brown we had the same issue and tried testing as per suggested patch #7517 above.

  1. updating modules/Meetings/metadata/subpanels/ForHistory.php as per patch #7517 resolved some of the errors related to history panel, but errors remained related to activities panel.

  2. We made the following update to modules/Meetings/metadata/subpanels/ForActivities.php which finally resolved remaining errors:

        'date_end'=>array(
            'vname' => 'LBL_LIST_DUE_DATE',
            'width' => '10%',
        ),

Please review this fix as our testing shows that both ForHistory.php and ForActivities.php need to be corrected

Dillon-Brown commented 5 years ago

@evgu Confirmed, thanks!

gody01 commented 4 years ago

This error still exsists in 7.11.6

Root cause: Tasks has: date_due column Meetings has: date_end column

In activites SuiteCRM tires to display different columns, but it failes.

Even with changes: [root@crm3 custom]# diff modules/Tasks/metadata/subpanels/ForActivities.php ../modules/Tasks/metadata/subpanels/ForActivities.php -u --- modules/Tasks/metadata/subpanels/ForActivities.php 2020-04-29 12:54:03.895998391 +0200 +++ ../modules/Tasks/metadata/subpanels/ForActivities.php 2020-04-06 13:48:01.251391032 +0200 @@ -76,8 +76,8 @@ 'date_due' => array( 'vname' => 'LBL_LIST_DUE_DATE', 'width' => '10%',

AND --- modules/Meetings/metadata/subpanels/ForActivities.php 2020-04-29 12:51:38.693102421 +0200 +++ ../modules/Meetings/metadata/subpanels/ForActivities.php 2020-04-06 13:48:01.051388399 +0200 @@ -93,8 +93,8 @@ 'date_end'=>array( 'vname' => 'LBL_LIST_DUE_DATE', 'width' => '10%',

Only date for one or another is diplsayed in Activites, not both.

Simplest soluton would be, to change column name in either tasks or meetings DB defintion and have same definition in metadata for this date.

pgorod commented 4 years ago

Whoever takes up this issue, please be very careful, we're on a succession of fix->regression->fix->regression->fix... this can't go on forever. So the fix needs to make sure it doesn't bring back the previous bug in some other module or view.

gody01 commented 4 years ago

I just looked at the query in log and it seems, that maping in metadata somehow does not work for Meetings.

In Calls module ForActivities.php has this definition: 'date_end'=>array( 'vname' => 'LBL_LIST_DUE_DATE', 'width' => '10%', 'alias' => 'date_due', 'sort_by' => 'date_due' ), and in query there is: calls.date_end as date_due

if I make the same for Meetings module 'date_end'=>array( 'vname' => 'LBL_LIST_DUE_DATE', 'width' => '10%', 'alias' => 'date_due', 'sort_by' => 'date_due' ), I get in query:

meetings.date_due as date_due

It looks like qeury buildr takes aliases for column name ...