Answers.Body: <p>If installed locally, your <code>max_allowed_packet</code> in your .ini file or my.cnf file could be too low. Since it's local, I would set it high and forget it. Something like 100M or 500M should do the trick. See <a href="https://stackoverflow.com/questions/7942154/mysql-error-2006-mysql-server-has-gone-away">https://stackoverflow.com/questions/7942154/mysql-error-2006-mysql-server-has-gone-away</a>  or  <a href="http://drupal.org/node/1014172" rel="nofollow noreferrer">drupal.org/node/1014172</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-28T23:36:43.950Z
Answers.LastActivityDate: 2017-03-28T23:36:43.950Z
Answers.LastEditDate: 2017-05-23T12:38:59.763Z
Answers.UserDisplayName: Allen Hutchison
Body: <p>I am beginning to build a new version of our existing Drupal 7 site locally, which has CiviCRM 4.7.15 installed. I installed a fresh copy of the same version of CiviCRM into a fresh SoopterTheme Drupal 7 demo and the installation was successful, however, when I went to review permission settings or click on configuration check list, I get the following error, site-wide. Drupal and CiviCRM both have their own usernames and databases: </p>
  
  <blockquote>
    <p>Additional uncaught exception thrown while handling exception.</p>
  </blockquote>
  
  <p>I have run through this process multiple times and get the same error. I also received this same error when trying to set up a local copy of the existing site.</p>
  
  <p>If I run any drush commands, I get:</p>
  
  <pre><code>Drush command terminated abnormally due to an unrecoverable error.                                                                                       [error]
  &lt;p&gt;Initialization Error&lt;/p&gt;&lt;p&gt;&lt;pre&gt;Array
  (
      [callback] =&amp;gt; Array
          (
              [0] =&amp;gt; CRM_Core_Error
              [1] =&amp;gt; simpleHandler
          )
  
      [code] =&amp;gt; -24
      [message] =&amp;gt; DB Error: connect failed
      [mode] =&amp;gt; 16
      [debug_info] =&amp;gt;  [nativecode=No such file or directory]
      [type] =&amp;gt; DB_Error
      [user_info] =&amp;gt;  [nativecode=No such file or directory]
      [to_string] =&amp;gt; [db_error: message=&amp;quot;DB Error: connect failed&amp;quot; code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix=&amp;quot;&amp;quot; info=&amp;quot; [nativecode=No such file or directory]&amp;quot;]
  )
  &lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Initialization Error&lt;/p&gt;&lt;p&gt;&lt;pre&gt;Array
  (
      [callback] =&amp;gt; Array
          (
              [0] =&amp;gt; CRM_Core_Error
              [1] =&amp;gt; simpleHandler
          )
  
      [code] =&amp;gt; -24
      [message] =&amp;gt; DB Error: connect failed
      [mode] =&amp;gt; 16
      [debug_info] =&amp;gt;  [nativecode=No such file or directory]
      [type] =&amp;gt; DB_Error
      [user_info] =&amp;gt;  [nativecode=No such file or directory]
      [to_string] =&amp;gt; [db_error: message=&amp;quot;DB Error: connect failed&amp;quot; code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix=&amp;quot;&amp;quot; info=&amp;quot; [nativecode=No such file or directory]&amp;quot;]
  )
  &lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt; 
  </code></pre>
  
  <p><a href="https://i.sstatic.net/tqDEw.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tqDEw.png" alt="Screenshot of Drupal Site After Installing CiviCRM"></a></p>
  
  <p>Any guidance is appreciated.</p>
  
  <p><strong>Edit:</strong> I reinstalled using the same database user for Drupal and CiviCRM and it seemed to have worked initially but I am getting the same error again the next time I went to access the site locally.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-28T23:29:40.383Z
Comments.Text: If installed locally, your max_allowed_packet in your .ini file or my.cnf file could be far too low.  Since it's local, I would set it high and forget it.  Something like 100M or 500M should do the trick.  See http://stackoverflow.com/questions/7942154/mysql-error-2006-mysql-server-has-gone-away or https://www.drupal.org/node/1014172
Comments.UserDisplayName: Allen Hutchison
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-28T23:32:39.567Z
Comments.Text: Thanks! I was just reading the MySQL manual and found that. I only set it to 20M but I'm glad to know it can be much higher. It seemed to have done the trick once I restarted the LAMP stack.
Comments.UserDisplayName: Christia
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-28T23:34:15.657Z
Comments.Text: So it's working now?  Hooray!
Comments.UserDisplayName: Allen Hutchison
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-28T23:37:29.823Z
Comments.Text: This is the correct answer, thanks! I wasn't sure until you confirmed. Much appreciated.
Comments.UserDisplayName: Christia
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-28T23:45:04.463Z
Comments.Text: You're very welcome!
Comments.UserDisplayName: Allen Hutchison
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-10T23:21:06.610Z
Comments.Text: Funny, I increased my my.conf max_allowed_packet limit to 500M and though I'm not getting the error anymore on the website, I do get the error when I run certain drush commands. Any ideas?
Comments.UserDisplayName: Christia
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-11T02:50:38.157Z
Comments.Text: Are the drush errors the same as in your question above?
Comments.UserDisplayName: Allen Hutchison
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-11T02:56:51.250Z
Comments.Text: Yes, and it's only certain commands, such as `drush en some_module` which will work even though it throws the error.
Comments.UserDisplayName: Christia
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-27T01:14:58.907Z
Comments.Text: I'm having the above issue again (where it fixed the on-screen error but the initialization error comes up with some drush commands. I vaguely remember fixing something in one of the settings or .htaccess file or something, don't know
Comments.UserDisplayName: Christia
Tags: <drupal>
Title: Installing CiviCRM on Local: Getting Uncaught Exception Thrown
ThreadText: # Installing CiviCRM on Local: Getting Uncaught Exception Thrown
  
  (Asked by: username_0 on 2017-03-28)
  
  I am beginning to build a new version of our existing Drupal 7 site locally, which has CiviCRM 4.7.15 installed. I installed a fresh copy of the same version of CiviCRM into a fresh SoopterTheme Drupal 7 demo and the installation was successful, however, when I went to review permission settings or click on configuration check list, I get the following error, site-wide. Drupal and CiviCRM both have their own usernames and databases: 
  
  Additional uncaught exception thrown while handling exception.
  
  I have run through this process multiple times and get the same error. I also received this same error when trying to set up a local copy of the existing site.
  If I run any drush commands, I get:
  Drush command terminated abnormally due to an unrecoverable error.                                                                                       [error]
  Initialization ErrorArray
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => simpleHandler
          )
  
      [code] => -24
      [message] => DB Error: connect failed
      [mode] => 16
      [debug_info] =>  [nativecode=No such file or directory]
      [type] => DB_Error
      [user_info] =>  [nativecode=No such file or directory]
      [to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info=" [nativecode=No such file or directory]"]
  )
  Initialization ErrorArray
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => simpleHandler
          )
  
      [code] => -24
      [message] => DB Error: connect failed
      [mode] => 16
      [debug_info] =>  [nativecode=No such file or directory]
      [type] => DB_Error
      [user_info] =>  [nativecode=No such file or directory]
      [to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info=" [nativecode=No such file or directory]"]
  )
   
  
  
  Any guidance is appreciated.
  Edit: I reinstalled using the same database user for Drupal and CiviCRM and it seemed to have worked initially but I am getting the same error again the next time I went to access the site locally.
  
  **Tags:** drupal
  
  > **Comments:**
  > **username_1**: If installed locally, your max_allowed_packet in your .ini file or my.cnf file could be far too low.  Since it's local, I would set it high and forget it.  Something like 100M or 500M should do the trick.  See http://stackoverflow.com/questions/7942154/mysql-error-2006-mysql-server-has-gone-away or https://www.drupal.org/node/1014172  
  > **username_0**: Thanks! I was just reading the MySQL manual and found that. I only set it to 20M but I'm glad to know it can be much higher. It seemed to have done the trick once I restarted the LAMP stack.  
  > **username_1**: So it's working now?  Hooray!  
  > **username_0**: This is the correct answer, thanks! I wasn't sure until you confirmed. Much appreciated.  
  > **username_1**: You're very welcome!  
  > **username_0**: Funny, I increased my my.conf max_allowed_packet limit to 500M and though I'm not getting the error anymore on the website, I do get the error when I run certain drush commands. Any ideas?  
  > **username_1**: Are the drush errors the same as in your question above?  
  > **username_0**: Yes, and it's only certain commands, such as `drush en some_module` which will work even though it throws the error.  
  > **username_0**: I'm having the above issue again (where it fixed the on-screen error but the initialization error comes up with some drush commands. I vaguely remember fixing something in one of the settings or .htaccess file or something, don't know  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-03-28. Score: 1 | Accepted answer
  
  If installed locally, your `max_allowed_packet` in your .ini file or my.cnf file could be too low. Since it's local, I would set it high and forget it. Something like 100M or 500M should do the trick. See <https://stackoverflow.com/questions/7942154/mysql-error-2006-mysql-server-has-gone-away> or [drupal.org/node/1014172](http://drupal.org/node/1014172)
  
  
  ---
  
  