Answers.Body: <p>Is this a newer instance of mysql, or did you upgrade recently?
  Was this ever working in your instance? </p>
  
  <p>What is your civivolunteer version?
  What is your mysql version?</p>
  
  <p>It's a bit hard to tell given that the sql is truncated in the stack trace but I have an idea for you to investigate.</p>
  
  <p>We can see that mysql is complaining, "Column 'id' in where clause is ambiguous". This is orginating in the retrieve() function of the Project in ext/org.civicrm.volunteer/CRM/Volunteer/BAO/Project.php on line 470.</p>
  
  <p>You should add some logging to that function to get the full SQL statement in the php error log.</p>
  
  <p>Find the line (#470):</p>
  
  <pre><code>$dao = self::executeQuery($query-&gt;toSQL());
  </code></pre>
  
  <p>and BEFORE it add,</p>
  
  <pre><code>trigger_error($query-&gt;toSQL());
  </code></pre>
  
  <p>Depending on your error_reporting php setting, you may need to provide a second argument for the error level such as, E_USER_ERROR.
  <a href="https://secure.php.net/manual/en/function.trigger-error.php" rel="nofollow noreferrer">https://secure.php.net/manual/en/function.trigger-error.php</a></p>
  
  <p>Does this only happen when you supply the "with" organization?</p>
  
  <p>A lot of people are having problems with MySQL's changes to strict_mode, but I've verified this error is not associated with strict_mode. I'm not sure if there is a similar change between mysql versions that impacts the handling of '*' in select statements that is triggering this.</p>
  
  <p>Cheers</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-20T17:25:29.267Z
Answers.Text: This is our first attempt at using CiviVolunteer.  We are using it on a subdomain, could it be a paths issue?
  Our CiviVolunteer version is 4.7.21-2.2.3
  Our MySql version is 5.6.39
  We get that DB Error only when we supply the "With organization".  However if leave that field out, it still turns up 0 results when there are positions available.  
  I actually can't test it anymore, because all of sudden it won't load on the front page in our live site or our test site. I did not change anything that could had caused this new occurence.
Answers.UserDisplayName: fdarn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-20T17:25:35.747Z
Answers.Text: Now when I attempt to view it on the frontend I get this message Do not delete this page. Page content is generated by CiviCRM.
Answers.UserDisplayName: fdarn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-18T15:00:31.697Z
Answers.LastActivityDate: 2018-03-18T15:00:31.697Z
Answers.UserDisplayName: ginkgoMZD
Answers.Body: <p>Bug has been filed here:
  <a href="https://issues.civicrm.org/jira/browse/VOL-319" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/VOL-319</a></p>
  
  <p>But additional steps to reproduce are still needed.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-22T13:14:21.417Z
Answers.LastActivityDate: 2018-03-22T13:14:21.417Z
Answers.UserDisplayName: ginkgoMZD
Body: <p>I am using civi 4.7.29 on Wordpress 4.9.4</p>
  
  <p>I am having a problem searching the CiviVolunteer Positions.  When I fill out the criteria and click search I get a DB Error with no information and it turns up no results when I know there are several positions available, as they are listed prior to attempting the search feature.<br>
  I am hoping this is a common issue and that someone knows where to start with resolving it.<br>
  <a href="https://i.sstatic.net/90vC6.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/90vC6.jpg" alt="enter image description here"></a>
  Thank you</p>
  
  <p>(UPDATED WITH ERROR LOG)</p>
  
  <pre><code>Mar 15 22:15:51  [info] $backTrace = #0 /home/oursite/public_html
  
  /test/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(948): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error))
  #3 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error-&gt;__construct("DB Error: unknown error", -1, 16, (Array:2), "SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #4 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error-&gt;__construct(-1, 16, (Array:2), "SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #5 [internal function](): PEAR-&gt;_raiseError(Object(DB_mysqli), NULL, -1, NULL, NULL, "SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...", "DB_Error", TRUE)
  #6 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8))
  #7 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR-&gt;__call("raiseError", (Array:7))
  #8 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR-&gt;raiseError(NULL, -1, NULL, NULL, "SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...", "DB_Error", TRUE)
  #9 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common-&gt;raiseError(-1, NULL, NULL, NULL, "1052 ** Column 'id' in where clause is ambiguous")
  #10 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli-&gt;mysqliRaiseError()
  #11 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli-&gt;simpleQuery("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #12 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2446): DB_common-&gt;query("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #13 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1635): DB_DataObject-&gt;_query("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #14 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(392): DB_DataObject-&gt;query("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #15 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1348): CRM_Core_DAO-&gt;query("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...", TRUE)
  #16 /home/oursite/public_html/test/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/BAO/Project.php(470): CRM_Core_DAO::executeQuery("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #17 /home/oursite/public_html/test/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/BAO/NeedSearch.php(69): CRM_Volunteer_BAO_Project::retrieve((Array:4))
  #18 /home/oursite/public_html/test/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/BAO/NeedSearch.php(43): CRM_Volunteer_BAO_NeedSearch-&gt;search()
  #19 /home/oursite/public_html/test/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/api/v3/VolunteerNeed.php(167): CRM_Volunteer_BAO_NeedSearch::doSearch((Array:10))
  #20 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_volunteer_need_getsearchresult((Array:10))
  #21 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(169): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:9))
  #22 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(100): Civi\API\Kernel-&gt;runRequest((Array:7))
  #23 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/api/api.php(23): Civi\API\Kernel-&gt;runSafe("VolunteerNeed", "getsearchresult", (Array:10), NULL)
  #24 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php(311): civicrm_api("VolunteerNeed", "getsearchresult", (Array:10))
  #25 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php(548): CRM_Utils_REST::process((Array:3), (Array:8))
  #26 [internal function](): CRM_Utils_REST::ajax()
  #27 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(275): call_user_func((Array:2))
  #28 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:12))
  #29 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
  #30 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm.php(1246): CRM_Core_Invoke::invoke((Array:3))
  #31 [internal function](): CiviCRM_For_WordPress-&gt;invoke(Object(WP))
  #32 /home/oursite/public_html/test/wp-includes/class-wp-hook.php(286): call_user_func_array((Array:2), (Array:1))
  #33 /home/oursite/public_html/test/wp-includes/class-wp-hook.php(310): WP_Hook-&gt;apply_filters("", (Array:1))
  #34 /home/oursite/public_html/test/wp-includes/plugin.php(515): WP_Hook-&gt;do_action((Array:1))
  #35 /home/oursite/public_html/test/wp-includes/class-wp.php(726): do_action_ref_array("wp", (Array:1))
  #36 /home/oursite/public_html/test/wp-includes/functions.php(960): WP-&gt;main("")
  #37 /home/oursite/public_html/test/wp-blog-header.php(16): wp()
  #38 /home/oursite/public_html/test/index.php(17): require("/home/oursite/public_html/test/wp-blog-header.php")
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-15T16:32:28.233Z
Comments.Text: Have you turned on error logging and looked at the logs to see if there is more info there?
Comments.UserDisplayName: Laryn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-16T02:23:19.267Z
Comments.Text: Hello @Laryn-CEDC.org , I just updated my post with all the error messages received immediately after attempting to search the volunteer positions.
Comments.UserDisplayName: fdarn
Tags: <civivolunteer>
Title: DB Error when using CiviVolunteer Search
ThreadText: # DB Error when using CiviVolunteer Search
  
  (Asked by: username_0 on 2018-03-12)
  
  I am using civi 4.7.29 on Wordpress 4.9.4
  I am having a problem searching the CiviVolunteer Positions.  When I fill out the criteria and click search I get a DB Error with no information and it turns up no results when I know there are several positions available, as they are listed prior to attempting the search feature.
  I am hoping this is a common issue and that someone knows where to start with resolving it.
  
  Thank you
  (UPDATED WITH ERROR LOG)
  Mar 15 22:15:51  [info] $backTrace = #0 /home/oursite/public_html
  
  /test/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(948): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error))
  #3 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #4 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #5 [internal function](): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, NULL, NULL, "SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...", "DB_Error", TRUE)
  #6 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8))
  #7 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
  #8 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...", "DB_Error", TRUE)
  #9 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, NULL, "1052 ** Column 'id' in where clause is ambiguous")
  #10 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
  #11 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #12 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2446): DB_common->query("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #13 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1635): DB_DataObject->_query("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #14 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(392): DB_DataObject->query("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #15 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1348): CRM_Core_DAO->query("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...", TRUE)
  #16 /home/oursite/public_html/test/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/BAO/Project.php(470): CRM_Core_DAO::executeQuery("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
  #17 /home/oursite/public_html/test/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/BAO/NeedSearch.php(69): CRM_Volunteer_BAO_Project::retrieve((Array:4))
  #18 /home/oursite/public_html/test/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/BAO/NeedSearch.php(43): CRM_Volunteer_BAO_NeedSearch->search()
  #19 /home/oursite/public_html/test/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/api/v3/VolunteerNeed.php(167): CRM_Volunteer_BAO_NeedSearch::doSearch((Array:10))
  #20 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_volunteer_need_getsearchresult((Array:10))
  #21 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(169): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
  #22 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(100): Civi\API\Kernel->runRequest((Array:7))
  #23 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/api/api.php(23): Civi\API\Kernel->runSafe("VolunteerNeed", "getsearchresult", (Array:10), NULL)
  #24 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php(311): civicrm_api("VolunteerNeed", "getsearchresult", (Array:10))
  #25 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php(548): CRM_Utils_REST::process((Array:3), (Array:8))
  #26 [internal function](): CRM_Utils_REST::ajax()
  #27 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(275): call_user_func((Array:2))
  #28 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:12))
  #29 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
  #30 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm.php(1246): CRM_Core_Invoke::invoke((Array:3))
  #31 [internal function](): CiviCRM_For_WordPress->invoke(Object(WP))
  #32 /home/oursite/public_html/test/wp-includes/class-wp-hook.php(286): call_user_func_array((Array:2), (Array:1))
  #33 /home/oursite/public_html/test/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
  #34 /home/oursite/public_html/test/wp-includes/plugin.php(515): WP_Hook->do_action((Array:1))
  #35 /home/oursite/public_html/test/wp-includes/class-wp.php(726): do_action_ref_array("wp", (Array:1))
  #36 /home/oursite/public_html/test/wp-includes/functions.php(960): WP->main("")
  #37 /home/oursite/public_html/test/wp-blog-header.php(16): wp()
  #38 /home/oursite/public_html/test/index.php(17): require("/home/oursite/public_html/test/wp-blog-header.php")
  
  **Tags:** civivolunteer
  
  > **Comments:**
  > **username_1**: Have you turned on error logging and looked at the logs to see if there is more info there?  
  > **username_0**: Hello @username_1-CEDC.org , I just updated my post with all the error messages received immediately after attempting to search the volunteer positions.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-03-18. Score: 1 | Accepted answer
  
  Is this a newer instance of mysql, or did you upgrade recently?
  Was this ever working in your instance? 
  What is your civivolunteer version?
  What is your mysql version?
  It's a bit hard to tell given that the sql is truncated in the stack trace but I have an idea for you to investigate.
  We can see that mysql is complaining, "Column 'id' in where clause is ambiguous". This is orginating in the retrieve() function of the Project in ext/org.civicrm.volunteer/CRM/Volunteer/BAO/Project.php on line 470.
  You should add some logging to that function to get the full SQL statement in the php error log.
  Find the line (#470):
  $dao = self::executeQuery($query->toSQL());
  
  and BEFORE it add,
  trigger_error($query->toSQL());
  
  Depending on your error_reporting php setting, you may need to provide a second argument for the error level such as, E_USER_ERROR.
  https://secure.php.net/manual/en/function.trigger-error.php
  Does this only happen when you supply the "with" organization?
  A lot of people are having problems with MySQL's changes to strict_mode, but I've verified this error is not associated with strict_mode. I'm not sure if there is a similar change between mysql versions that impacts the handling of '*' in select statements that is triggering this.
  Cheers
  
  > **Comments:**
  > **username_0**: This is our first attempt at using CiviVolunteer.  We are using it on a subdomain, could it be a paths issue? Our CiviVolunteer version is 4.7.21-2.2.3 Our MySql version is 5.6.39 We get that DB Error only when we supply the "With organization".  However if leave that field out, it still turns up 0 results when there are positions available.   I actually can't test it anymore, because all of sudden it won't load on the front page in our live site or our test site. I did not change anything that could had caused this new occurence.  
  > **username_0**: Now when I attempt to view it on the frontend I get this message Do not delete this page. Page content is generated by CiviCRM.  
  
  ---
  
  ### Answer by username_2 on 2018-03-22. Score: 1
  
  Bug has been filed here:
  <https://issues.civicrm.org/jira/browse/VOL-319>
  
  But additional steps to reproduce are still needed.
  
  
  ---
  
  