Answers.Body: <p>The genuine error message you're looking for is likely buried in the stack trace that CiviCRM will have written to the CiviCRM log file, and will likely require some sleuthing.</p>
  
  <p>As per Chris' notes, it probably indicates an unhandled exception in CiviVolunteer, and helping them handle it better would be very nice.</p>
  
  <p>Shameless plug: you can use <a href="https://github.com/adixon/ca.civicrm.logviewer" rel="nofollow noreferrer">this extension</a> to make it easy to view/parse that log file.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-18T03:19:11.163Z
Answers.Text: That extension looks great, thanks for plugging it!
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-17T17:22:25.640Z
Answers.LastActivityDate: 2017-10-17T17:22:25.640Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>A look at the <a href="https://github.com/civicrm/civicrm-core/search?utf8=%E2%9C%93&amp;q=PEAR_ERROR_CALLBACK&amp;type=" rel="nofollow noreferrer">only code which references <code>PEAR_ERROR_CALLBACK</code> in CiviCRM core</a> is telling - the <a href="https://github.com/civicrm/civicrm-core/blob/d40b6649e8af7fa55a5a71beee3483cdf6c68bf3/CRM/Core/TemporaryErrorScope.php" rel="nofollow noreferrer">file comment starts with <em>This is an evil, evil workaround ...</em></a>.</p>
  
  <p>So you've probably uncovered a legit unexpected bug or misbehaviour here. Something about the site setup or the volunteers extension seems to be upsetting things, but in a way that might not be experienced by the majority of sites.</p>
  
  <p>Your PHP version is <a href="https://docs.civicrm.org/sysadmin/en/latest/requirements/" rel="nofollow noreferrer">OK if not great</a>, and your installed PEAR libraries should not interact with CiviCRM (which bundles its own copies of PEAR libs). So I don't think those should be your problem.</p>
  
  <p>In your situation, I'd first check the <a href="https://docs.civicrm.org/sysadmin/en/latest/config/error-handling/" rel="nofollow noreferrer">Debugging and Error Handling settings</a> (see <code>civicrm/admin/setting/debug</code> in your CiviCRM install) and make sure there aren't any unexpected "error callback" settings. Also check out what other extensions (especially debug related) are present in your install; try disabling those if present.</p>
  
  <p>Next steps to debug would be to find backtraces in the CiviCRM debug log, and understand what code path is leading to this error.</p>
  
  <hr>
  
  <p><em>More thoughts ...</em> Assuming <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/TemporaryErrorScope.php" rel="nofollow noreferrer"><code>CRM_Core_TemporaryErrorScope::create()</code></a> works the rest of the time, then we know <code>PEAR_ERROR_CALLBACK</code> is defined the rest of the time. This means that when you hit this error, you're hitting that method when PEAR hasn't been loaded at all.</p>
  
  <p>The constant <a href="https://github.com/civicrm/civicrm-packages/search?utf8=%E2%9C%93&amp;q=PEAR_ERROR_CALLBACK&amp;type=" rel="nofollow noreferrer">ought to be defined when PEAR is loaded</a> during CiviCRM bootstrap; CiviCRM isn't going to get much done without PEAR, since it relies on that for essentials like DB access. This suggests CiviCRM has not been fully bootstrapped - we see similar issues also when the CMS is not  bootstrapped, so Drupal / Joomla / whatever functions or constants are not available.</p>
  
  <p>The above could mean that the means of installing CiviVolunteer is being incorrectly applied, or that CiviVolunteer installation is broken. I don't know which; if you expand your question to <strong>describe the steps you're taking to install CiviVolunteer</strong>, that could improve the quality of answer you can get.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-15T19:21:41.097Z
Answers.Text: The comment in that mentioned file goes on to say "this code should be removed in CiviCRM 4.3/4.4 when we adopt exception handling" - CiviCRM 4.3 came out in 2013 I think.
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-16T20:05:44.010Z
Answers.Text: Thanks. Tricky thing. I don't think that the uninstall script for civivolunteer cleans up properly. Started hacking it. Tried debugging it, but I understand there is a shell script that is run in the install somewhere that would have to be debugged, not just civicrm. The stack trace just says failed at createTable - no information on what. Watchdog no detail of course. So mysql audit. INSERT INTO civicrm_custom_group... Thanks for ruling out the environment.
Answers.UserDisplayName: Interlated
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-16T21:37:57.310Z
Answers.Text: I've added some more comments. Would you describe the steps you're taking to install CiviVolunteer, and maybe link to the documentation you're working from? That might shed light on how it's possible to be installing an extension without PEAR loaded. (If your hosting environment has preloaded a file called `PEAR.php`, that could prevent CiviCRM's `PEAR.php` being included later and defining this constant?)
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-17T01:45:25.733Z
Answers.Text: Installed the extension by selecting from the civicrm UI. Prior to 4.7 we used git to manage, but the download and push install method seems to be the latest way. I've got a local copy (homebrew install php), so will see about the pear libraries being called. The software instance of CiviCRM is new - git rm -r /unzip/. Had CiviCRM for about 10 years.
Answers.UserDisplayName: Interlated
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-17T01:46:51.090Z
Answers.Text: Mysql debug log says that the date format is wrong - all zeros - as the root cause of the error.  INSERT INTO civicrm_custom_group  ... 00000000000000 ,  1 )',1292
Answers.UserDisplayName: Interlated
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-17T02:03:28.163Z
Answers.Text: I changed volunteer-customdata.xml.tpl set a current date and it worked. A different problem to 'this just died how do I find out what happened' or specifically, how do I get rid of the PEAR error to find an error that is helpful.
Answers.UserDisplayName: Interlated
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-18T06:00:44.443Z
Answers.Text: Nice work, and good on you for persisting   I see this same CiviVolunteer issue has been [asked/answered on SE before](https://civicrm.stackexchange.com/a/19425/149), and there's a couple of issues in JIRA about this ([VOL-299](https://issues.civicrm.org/jira/browse/VOL-299), [CRM-19546](https://issues.civicrm.org/jira/browse/CRM-19546)). If you want to engage this further, you could try there or on https://chat.civicrm.org/
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-15T19:21:34.797Z
Answers.LastActivityDate: 2017-10-16T21:35:54.860Z
Answers.LastEditDate: 2017-10-16T21:35:54.860Z
Answers.UserDisplayName: Chris Burgess
Body: <p>I am trying to reinstall the volunteers extension and am getting an error that isn't clear. Is this my version of PHP or missing PEAR packages that is causing the lack of clarity?</p>
  
  <pre><code>Use of undefined constant PEAR_ERROR_CALLBACK 
  - assumed \'PEAR_ERROR_CALLBACK\'\";s:9:\"%function\";s:38:\"CRM_Core_TemporaryErrorScope::create()
  </code></pre>
  
  <p>CiviCRM 4.7.25
  PHP 5.5.38</p>
  
Tags: <extension><error>
Title: How do I get the genuine error message
ThreadText: # How do I get the genuine error message
  
  (Asked by: username_0 on 2017-10-15)
  
  I am trying to reinstall the volunteers extension and am getting an error that isn't clear. Is this my version of PHP or missing PEAR packages that is causing the lack of clarity?
  
  ```
  Use of undefined constant PEAR_ERROR_CALLBACK 
  - assumed \'PEAR_ERROR_CALLBACK\'\";s:9:\"%function\";s:38:\"CRM_Core_TemporaryErrorScope::create()
  
  ```
  
  CiviCRM 4.7.25
  PHP 5.5.38
  
  **Tags:** extension, error
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2017-10-15. Score: 4 | Accepted answer
  
  A look at the [only code which references `PEAR_ERROR_CALLBACK` in CiviCRM core](https://github.com/civicrm/civicrm-core/search?utf8=%E2%9C%93&q=PEAR_ERROR_CALLBACK&type=) is telling - the [file comment starts with *This is an evil, evil workaround ...*](https://github.com/civicrm/civicrm-core/blob/d40b6649e8af7fa55a5a71beee3483cdf6c68bf3/CRM/Core/TemporaryErrorScope.php).
  
  So you've probably uncovered a legit unexpected bug or misbehaviour here. Something about the site setup or the volunteers extension seems to be upsetting things, but in a way that might not be experienced by the majority of sites.
  
  Your PHP version is [OK if not great](https://docs.civicrm.org/sysadmin/en/latest/requirements/), and your installed PEAR libraries should not interact with CiviCRM (which bundles its own copies of PEAR libs). So I don't think those should be your problem.
  
  In your situation, I'd first check the [Debugging and Error Handling settings](https://docs.civicrm.org/sysadmin/en/latest/config/error-handling/) (see `civicrm/admin/setting/debug` in your CiviCRM install) and make sure there aren't any unexpected "error callback" settings. Also check out what other extensions (especially debug related) are present in your install; try disabling those if present.
  
  Next steps to debug would be to find backtraces in the CiviCRM debug log, and understand what code path is leading to this error.
  
  ---
  
  *More thoughts ...* Assuming [`CRM_Core_TemporaryErrorScope::create()`](https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/TemporaryErrorScope.php) works the rest of the time, then we know `PEAR_ERROR_CALLBACK` is defined the rest of the time. This means that when you hit this error, you're hitting that method when PEAR hasn't been loaded at all.
  
  The constant [ought to be defined when PEAR is loaded](https://github.com/civicrm/civicrm-packages/search?utf8=%E2%9C%93&q=PEAR_ERROR_CALLBACK&type=) during CiviCRM bootstrap; CiviCRM isn't going to get much done without PEAR, since it relies on that for essentials like DB access. This suggests CiviCRM has not been fully bootstrapped - we see similar issues also when the CMS is not bootstrapped, so Drupal / Joomla / whatever functions or constants are not available.
  
  The above could mean that the means of installing CiviVolunteer is being incorrectly applied, or that CiviVolunteer installation is broken. I don't know which; if you expand your question to **describe the steps you're taking to install CiviVolunteer**, that could improve the quality of answer you can get.
  
  > **Comments:**
  > **username_2**: The comment in that mentioned file goes on to say "this code should be removed in CiviCRM 4.3/4.4 when we adopt exception handling" - CiviCRM 4.3 came out in 2013 I think.  
  > **username_0**: Thanks. Tricky thing. I don't think that the uninstall script for civivolunteer cleans up properly. Started hacking it. Tried debugging it, but I understand there is a shell script that is run in the install somewhere that would have to be debugged, not just civicrm. The stack trace just says failed at createTable - no information on what. Watchdog no detail of course. So mysql audit. INSERT INTO civicrm_custom_group... Thanks for ruling out the environment.  
  > **username_2**: I've added some more comments. Would you describe the steps you're taking to install CiviVolunteer, and maybe link to the documentation you're working from? That might shed light on how it's possible to be installing an extension without PEAR loaded. (If your hosting environment has preloaded a file called `PEAR.php`, that could prevent CiviCRM's `PEAR.php` being included later and defining this constant?)  
  > **username_0**: Installed the extension by selecting from the civicrm UI. Prior to 4.7 we used git to manage, but the download and push install method seems to be the latest way. I've got a local copy (homebrew install php), so will see about the pear libraries being called. The software instance of CiviCRM is new - git rm -r /unzip/. Had CiviCRM for about 10 years.  
  > **username_0**: Mysql debug log says that the date format is wrong - all zeros - as the root cause of the error.  INSERT INTO civicrm_custom_group  ... 00000000000000 ,  1 )',1292  
  > **username_0**: I changed volunteer-customdata.xml.tpl set a current date and it worked. A different problem to 'this just died how do I find out what happened' or specifically, how do I get rid of the PEAR error to find an error that is helpful.  
  > **username_2**: Nice work, and good on you for persisting   I see this same CiviVolunteer issue has been [asked/answered on SE before](https://civicrm.stackexchange.com/a/19425/149), and there's a couple of issues in JIRA about this ([VOL-299](https://issues.civicrm.org/jira/browse/VOL-299), [CRM-19546](https://issues.civicrm.org/jira/browse/CRM-19546)). If you want to engage this further, you could try there or on https://chat.civicrm.org/  
  
  ---
  
  ### Answer by username_1 on 2017-10-17. Score: 2
  
  The genuine error message you're looking for is likely buried in the stack trace that CiviCRM will have written to the CiviCRM log file, and will likely require some sleuthing.
  
  As per username_2' notes, it probably indicates an unhandled exception in CiviVolunteer, and helping them handle it better would be very nice.
  
  Shameless plug: you can use [this extension](https://github.com/adixon/ca.civicrm.logviewer) to make it easy to view/parse that log file.
  
  > **Comments:**
  > **username_2**: That extension looks great, thanks for plugging it!  
  
  ---
  
  