Answers.Body: <p>I'm pretty sure it's because the owner of the database views is a different database user (maybe you moved or imported from somewhere?). CiviCase uses mysql views.</p>
  <p>You can disable civicase and then reenable to recreate the views.</p>
  <p>Or alter the &quot;DEFINER&quot; directly in the database for the views civicrm_view_case_activity_upcoming and civicrm_view_case_activity_recent.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-21T00:25:26.597Z
Answers.Text: Thank you so much, that was the issue...everything is back to normal again...MUCH appreciated..
Answers.UserDisplayName: Craig Creque
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-20T23:37:52.757Z
Answers.LastActivityDate: 2020-08-20T23:37:52.757Z
Answers.UserDisplayName: Demerit
Body: <p>I'm having a major issue with Civicase,</p>
  <p>Anytime I try to view or search for a case file, I'm getting an error.  I have no problem creating new case files, I have no problem creating new case types, but the minute I try to review a case file I get an error</p>
  <p>This is the backTrace</p>
  <pre><code>#0 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Core/Error.php(148): CRM_Core_Error::backtrace()
  #1 /home2/blahblah/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::handle(Object(DB_Error))
  #2 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB.php(997): PEAR_Error-&gt;__construct(&quot;DB Error: unknown error&quot;, -1, 16, (Array:2), &quot; SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...&quot;)
  #3 /home2/blahblah/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error-&gt;__construct(-1, 16, (Array:2), &quot; SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...&quot;)
  #4 /home2/blahblah/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR-&gt;_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), &quot; SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...&quot;, &quot;DB_Error&quot;, TRUE)
  #5 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB/common.php(1925): PEAR-&gt;__call(&quot;raiseError&quot;, (Array:7))
  #6 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB/mysqli.php(936): DB_common-&gt;raiseError(-1, NULL, NULL, &quot; SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...&quot;, &quot;1045 ** Access denied for user 'bvitrave_advisor'@'localhost' (using password...&quot;)
  #7 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB/mysqli.php(406): DB_mysqli-&gt;mysqliRaiseError()
  #8 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB/common.php(1231): DB_mysqli-&gt;simpleQuery(&quot; SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...&quot;)
  #9 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(2696): DB_common-&gt;query(&quot; SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...&quot;)
  #10 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(1829): DB_DataObject-&gt;_query(&quot; SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...&quot;)
  #11 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(439): DB_DataObject-&gt;query(&quot; SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...&quot;)
  #12 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(1599): CRM_Core_DAO-&gt;query(&quot; SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...&quot;, TRUE)
  #13 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Case/BAO/Case.php(537): CRM_Core_DAO::singleValueQuery(&quot; SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...&quot;)
  #14 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Case/Page/DashBoard.php(71): CRM_Case_BAO_Case::getCases(NULL, (Array:0), &quot;dashboard&quot;, TRUE)
  #15 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Case/Page/DashBoard.php(100): CRM_Case_Page_DashBoard-&gt;preProcess()
  #16 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Case_Page_DashBoard-&gt;run((Array:2), NULL)
  #17 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:15))
  #18 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:2))
  #19 /home2/blahblah/public_html/sites/all/modules/civicrm/drupal/civicrm.module(454): CRM_Core_Invoke::invoke((Array:2))
  #20 /home2/blahblah/public_html/includes/menu.inc(527): civicrm_invoke(&quot;case&quot;)
  #21 /home2/blahblah/public_html/index.php(21): menu_execute_active_handler()
  #22 {main}
  </code></pre>
  <p>Based on the traceroute, it saying that my SQL username/password access is denied.  But I can't understand why that is occuring only when I attempt to view a case file...Please help me</p>
  
Tags: <civicase>
Title: CiviCase Issue when viewing case file
ThreadText: # CiviCase Issue when viewing case file
  
  (Asked by: username_0 on 2020-08-20)
  
  I'm having a major issue with Civicase,
  Anytime I try to view or search for a case file, I'm getting an error.  I have no problem creating new case files, I have no problem creating new case types, but the minute I try to review a case file I get an error
  This is the backTrace
  #0 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Core/Error.php(148): CRM_Core_Error::backtrace()
  #1 /home2/blahblah/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::handle(Object(DB_Error))
  #2 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB.php(997): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), " SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #3 /home2/blahblah/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), " SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #4 /home2/blahblah/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), " SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...", "DB_Error", TRUE)
  #5 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB/common.php(1925): PEAR->__call("raiseError", (Array:7))
  #6 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB/mysqli.php(936): DB_common->raiseError(-1, NULL, NULL, " SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...", "1045 ** Access denied for user 'bvitrave_advisor'@'localhost' (using password...")
  #7 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB/mysqli.php(406): DB_mysqli->mysqliRaiseError()
  #8 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB/common.php(1231): DB_mysqli->simpleQuery(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #9 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(2696): DB_common->query(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #10 /home2/blahblah/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #11 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(439): DB_DataObject->query(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #12 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(1599): CRM_Core_DAO->query(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...", TRUE)
  #13 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Case/BAO/Case.php(537): CRM_Core_DAO::singleValueQuery(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #14 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Case/Page/DashBoard.php(71): CRM_Case_BAO_Case::getCases(NULL, (Array:0), "dashboard", TRUE)
  #15 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Case/Page/DashBoard.php(100): CRM_Case_Page_DashBoard->preProcess()
  #16 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Case_Page_DashBoard->run((Array:2), NULL)
  #17 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:15))
  #18 /home2/blahblah/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:2))
  #19 /home2/blahblah/public_html/sites/all/modules/civicrm/drupal/civicrm.module(454): CRM_Core_Invoke::invoke((Array:2))
  #20 /home2/blahblah/public_html/includes/menu.inc(527): civicrm_invoke("case")
  #21 /home2/blahblah/public_html/index.php(21): menu_execute_active_handler()
  #22 {main}
  
  Based on the traceroute, it saying that my SQL username/password access is denied.  But I can't understand why that is occuring only when I attempt to view a case file...Please help me
  
  **Tags:** civicase
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-08-20. Score: 0 | Accepted answer
  
  I'm pretty sure it's because the owner of the database views is a different database user (maybe you moved or imported from somewhere?). CiviCase uses mysql views.
  
  You can disable civicase and then reenable to recreate the views.
  
  Or alter the "DEFINER" directly in the database for the views civicrm\_view\_case\_activity\_upcoming and civicrm\_view\_case\_activity\_recent.
  
  > **Comments:**
  > **username_0**: Thank you so much, that was the issue...everything is back to normal again...MUCH appreciated..  
  
  ---
  
  