Answers.Body: <p>The missing tables are Drupal tables, and the exceptions are thrown from Drupal modules. So the Drupal database is missing (I do not know if you installed CiviCRM is a separate database). Maybe the connect string in the <code>settings.php</code> file is not correct.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-08T00:51:04.133Z
Answers.Text: I'd agree except for the "database is missing" part, since the error seems to actually be "mysql server has gone away". So it's possibly the connection string as you say, or some incompatibility in the bitnami components introduced by the "upgrades over the last few months", or possibly the drupal database is not missing but corrupt. You could try OPTIMIZE TABLE on your drupal tables.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-06T21:39:12.127Z
Answers.LastActivityDate: 2017-12-06T21:39:12.127Z
Answers.UserDisplayName: Kainuk - CiviCooP
Body: <p>Greetings CiviCRM Community,
  I am in need of rebuilding our organization CiviCRM DB. We are getting some odd issues when trying to create activities in CiviCRM. When I traced the error I got the following message below. I'm think we need to rebuild our CiviDB Schema since we have done a few upgrades over the last few months. I wanted to know if there is an updated process for rebuilding the CiviCRM schema. When looking at the documentation on the wiki site it states that this documentation have been archived and the new site does not include the process. Please advise on what we should do. </p>
  
  <p>Additional uncaught exception thrown while handling exception.</p>
  
  <p>Original</p>
  
  <p><code>PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] =&amp;gt; rules_get_cacheevent_watchdog ) in lock_may_be_available() (line 167 of /opt/bitnami/apps/civicrm/htdocs/includes/lock.inc).</code></p>
  
  <p>Additional</p>
  
  <p><code>PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT ff.* FROM {filter_format} ff WHERE (status = :db_condition_placeholder_0) ORDER BY weight ASC; Array ( [:db_condition_placeholder_0] =&amp;gt; 1 ) in filter_formats() (line 434 of /opt/bitnami/apps/civicrm/htdocs/modules/filter/filter.module).</code></p>
  
  <p>Uncaught exception thrown in session handler.</p>
  
  <p><code>PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 AS expression FROM {sessions} sessions WHERE ( (sid = :db_condition_placeholder_0) AND (ssid = :db_condition_placeholder_1) ); Array ( [:db_condition_placeholder_0] =&amp;gt; YeiL-YkRM2JyCIzmbtEZQP5wCjxN2hpMFaxcVuAQj88 [:db_condition_placeholder_1] =&amp;gt; ) in _drupal_session_write() (line 209 of /opt/bitnami/apps/civicrm/htdocs/includes/session.inc).</code></p>
  
  <p>Uncaught exception thrown in shutdown function.</p>
  
  <p><code>PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] =&amp;gt; 15704801665a2824bfaa38b2.28928446 ) in lock_release_all() (line 269 of /opt/bitnami/apps/civicrm/htdocs/includes/lock.inc).</code></p>
  
Tags: <database>
Title: Rebuilding CiviCRM Database
ThreadText: # Rebuilding CiviCRM Database
  
  (Asked by: username_0 on 2017-12-06)
  
  Greetings CiviCRM Community,
  I am in need of rebuilding our organization CiviCRM DB. We are getting some odd issues when trying to create activities in CiviCRM. When I traced the error I got the following message below. I'm think we need to rebuild our CiviDB Schema since we have done a few upgrades over the last few months. I wanted to know if there is an updated process for rebuilding the CiviCRM schema. When looking at the documentation on the wiki site it states that this documentation have been archived and the new site does not include the process. Please advise on what we should do.
  
  Additional uncaught exception thrown while handling exception.
  
  Original
  
  `PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => rules_get_cacheevent_watchdog ) in lock_may_be_available() (line 167 of /opt/bitnami/apps/civicrm/htdocs/includes/lock.inc).`
  
  Additional
  
  `PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT ff.* FROM {filter_format} ff WHERE (status = :db_condition_placeholder_0) ORDER BY weight ASC; Array ( [:db_condition_placeholder_0] => 1 ) in filter_formats() (line 434 of /opt/bitnami/apps/civicrm/htdocs/modules/filter/filter.module).`
  
  Uncaught exception thrown in session handler.
  
  `PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 AS expression FROM {sessions} sessions WHERE ( (sid = :db_condition_placeholder_0) AND (ssid = :db_condition_placeholder_1) ); Array ( [:db_condition_placeholder_0] => YeiL-YkRM2JyCIzmbtEZQP5wCjxN2hpMFaxcVuAQj88 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 209 of /opt/bitnami/apps/civicrm/htdocs/includes/session.inc).`
  
  Uncaught exception thrown in shutdown function.
  
  `PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 15704801665a2824bfaa38b2.28928446 ) in lock_release_all() (line 269 of /opt/bitnami/apps/civicrm/htdocs/includes/lock.inc).`
  
  **Tags:** database
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-12-06. Score: 2
  
  The missing tables are Drupal tables, and the exceptions are thrown from Drupal modules. So the Drupal database is missing (I do not know if you installed CiviCRM is a separate database). Maybe the connect string in the `settings.php` file is not correct.
  
  > **Comments:**
  > **username_2**: I'd agree except for the "database is missing" part, since the error seems to actually be "mysql server has gone away". So it's possibly the connection string as you say, or some incompatibility in the bitnami components introduced by the "upgrades over the last few months", or possibly the drupal database is not missing but corrupt. You could try OPTIMIZE TABLE on your drupal tables.  
  
  ---
  
  