Answers.Body: <p>DO you have DB logging turned on? If so turn it off &amp; back on again - the log_civicrm_status_pref table might be missing the field</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-20T06:04:46.973Z
Answers.Text: I do indeed have logging turned on. Turning it off and back on didn't do anything, but manually adding the field to log_civicrm_status_pref seems to have done it. Thanks!
Answers.UserDisplayName: RiverRunner
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-18T02:05:30.707Z
Answers.LastActivityDate: 2020-02-18T02:05:30.707Z
Answers.UserDisplayName: eileen
Answers.Body: <p>I had the same, the table was missing, I added it using</p>
  <p><a href="https://gist.github.com/xurizaemon/ac3d5bbc90712348d79a8d56bdd0b5ca" rel="nofollow noreferrer">https://gist.github.com/xurizaemon/ac3d5bbc90712348d79a8d56bdd0b5ca</a></p>
  <pre><code>CREATE TABLE `civicrm_status_pref` (
  
  
       `id` int unsigned NOT NULL AUTO_INCREMENT  COMMENT 'Unique Status Preference ID',
       `domain_id` int unsigned NOT NULL   COMMENT 'Which Domain is this Status Preference for',
       `name` varchar(255) NOT NULL   COMMENT 'Name of the status check this preference references.',
       `hush_until` date   DEFAULT NULL COMMENT 'expires ignore_severity.  NULL never hushes.',
       `ignore_severity` int unsigned   DEFAULT 1 COMMENT 'Hush messages up to and including this severity.',
       `prefs` varchar(255)    COMMENT 'These settings are per-check, and can\'t be compared across checks.',
       `check_info` varchar(255)    COMMENT 'These values are per-check, and can\'t be compared across checks.' 
  ,
          PRIMARY KEY (`id`)
   
      ,     INDEX `UI_status_pref_name`(
          name
    )
    
  ,          CONSTRAINT FK_civicrm_status_pref_domain_id FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain`(`id`)   
  )  ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci  ;
  </code></pre>
  <p>and disabling the foreign key check.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-17T13:04:54.863Z
Answers.LastActivityDate: 2020-07-17T13:04:54.863Z
Answers.UserDisplayName: asbl
Body: <p><strong>System:</strong>
  WordPress 5.3.2, CiviCRM 5.20.2, PHP 7.1.33</p>
  
  <p><strong>Problem:</strong>
  Since 1/1/2020 at 12:00am, every time our cron job runs on the hour I get an email notification that says </p>
  
  <p>DB Error: no such field
  Died during callApi</p>
  
  <p>In looking at the error log (shown below), the error is in an UPDATE statement on the civicrm_status_pref table, saying that the is_active field doesn't exist. But it does:</p>
  
  <p><a href="https://i.sstatic.net/YKd0S.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/YKd0S.png" alt="Structure of civicrm_status_prefs"></a></p>
  
  <p>I am not getting any other errors. System Status says that I'm a little behind with the PHP version and CiviCRM (but the error has persisted through one civi update). All extensions are up to date. And as near as I can tell, everything in CiviCRM is working fine. </p>
  
  <p>What am I missing? Why am I getting this error? Thanks!</p>
  
  <p>Error Log:</p>
  
  <pre><code>Feb 17 16:00:02  [error] $Fatal Error Details = Array
      (
          [callback] =&gt; Array
              (
                  [0] =&gt; CRM_Core_Error
                  [1] =&gt; exceptionHandler
              )
  
          [code] =&gt; -19
          [message] =&gt; DB Error: no such field
          [mode] =&gt; 16
          [debug_info] =&gt; UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ignore_severity = 0 , check_info = '1581987602' , is_active = 1   WHERE (  civicrm_status_pref.id = 1 )   [nativecode=1054 ** Unknown column 'is_active' in 'field list']
          [type] =&gt; DB_Error
          [user_info] =&gt; UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ignore_severity = 0 , check_info = '1581987602' , is_active = 1   WHERE (  civicrm_status_pref.id = 1 )   [nativecode=1054 ** Unknown column 'is_active' in 'field list']
          [to_string] =&gt; [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ignore_severity = 0 , check_info = '1581987602' , is_active = 1   WHERE (  civicrm_status_pref.id = 1 )   [nativecode=1054 ** Unknown column 'is_active' in 'field list']"]
      )
  
  
      Feb 17 16:00:02  [debug] $backTrace = #0 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(921): CRM_Core_Error::backtrace("backTrace", TRUE)
      #1 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
      #2 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(987): PEAR_Error-&gt;__construct("DB Error: no such field", -19, 16, (Array:2), "UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
      #3 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error-&gt;__construct(-19, 16, (Array:2), "UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
      #4 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR-&gt;_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), "UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...", "DB_Error", TRUE)
      #5 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1920): PEAR-&gt;__call("raiseError", (Array:7))
      #6 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common-&gt;raiseError(-19, NULL, NULL, "UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...", "1054 ** Unknown column 'is_active' in 'field list'")
      #7 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli-&gt;mysqliRaiseError()
      #8 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1229): DB_mysqli-&gt;simpleQuery("UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
      #9 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2416): DB_common-&gt;query("UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
      #10 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1318): DB_DataObject-&gt;_query("UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
      #11 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(560): DB_DataObject-&gt;update()
      #12 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/StatusPreference.php(86): CRM_Core_DAO-&gt;save()
      #13 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(93): CRM_Core_BAO_StatusPreference::create((Array:3))
      #14 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(134): CRM_Core_JobManager-&gt;execute(FALSE)
      #15 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(101): civicrm_api3_job_execute((Array:2))
      #16 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(168): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:9))
      #17 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(99): Civi\API\Kernel-&gt;runRequest((Array:9))
      #18 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/api/api.php(23): Civi\API\Kernel-&gt;runSafe("Job", "execute", (Array:2), NULL)
      #19 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.class.php(122): civicrm_api("Job", "execute", (Array:2))
      #20 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php(32): civicrm_cli-&gt;callApi()
      #21 {main}
  </code></pre>
  
Tags: <wordpress><error>
Title: DB Error: no such field Died during callApi - Error with civicrm_status_pref table
ThreadText: # DB Error: no such field Died during callApi - Error with civicrm_status_pref table
  
  (Asked by: username_0 on 2020-02-18)
  
  **System:**
  WordPress 5.3.2, CiviCRM 5.20.2, PHP 7.1.33
  
  **Problem:**
  Since 1/1/2020 at 12:00am, every time our cron job runs on the hour I get an email notification that says
  
  DB Error: no such field
  Died during callApi
  
  In looking at the error log (shown below), the error is in an UPDATE statement on the civicrm\_status\_pref table, saying that the is\_active field doesn't exist. But it does:
  
  [![Structure of civicrm_status_prefs](https://i.sstatic.net/YKd0S.png)](https://i.sstatic.net/YKd0S.png)
  
  I am not getting any other errors. System Status says that I'm a little behind with the PHP version and CiviCRM (but the error has persisted through one civi update). All extensions are up to date. And as near as I can tell, everything in CiviCRM is working fine.
  
  What am I missing? Why am I getting this error? Thanks!
  
  Error Log:
  
  ```
  Feb 17 16:00:02  [error] $Fatal Error Details = Array
      (
          [callback] => Array
              (
                  [0] => CRM_Core_Error
                  [1] => exceptionHandler
              )
  
          [code] => -19
          [message] => DB Error: no such field
          [mode] => 16
          [debug_info] => UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ignore_severity = 0 , check_info = '1581987602' , is_active = 1   WHERE (  civicrm_status_pref.id = 1 )   [nativecode=1054 ** Unknown column 'is_active' in 'field list']
          [type] => DB_Error
          [user_info] => UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ignore_severity = 0 , check_info = '1581987602' , is_active = 1   WHERE (  civicrm_status_pref.id = 1 )   [nativecode=1054 ** Unknown column 'is_active' in 'field list']
          [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ignore_severity = 0 , check_info = '1581987602' , is_active = 1   WHERE (  civicrm_status_pref.id = 1 )   [nativecode=1054 ** Unknown column 'is_active' in 'field list']"]
      )
  
      Feb 17 16:00:02  [debug] $backTrace = #0 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(921): CRM_Core_Error::backtrace("backTrace", TRUE)
      #1 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
      #2 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(987): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
      #3 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
      #4 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), "UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...", "DB_Error", TRUE)
      #5 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1920): PEAR->__call("raiseError", (Array:7))
      #6 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-19, NULL, NULL, "UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...", "1054 ** Unknown column 'is_active' in 'field list'")
      #7 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
      #8 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1229): DB_mysqli->simpleQuery("UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
      #9 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2416): DB_common->query("UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
      #10 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1318): DB_DataObject->_query("UPDATE  civicrm_status_pref  SET domain_id = 1 , name = 'checkLastCron' , ign...")
      #11 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(560): DB_DataObject->update()
      #12 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/StatusPreference.php(86): CRM_Core_DAO->save()
      #13 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(93): CRM_Core_BAO_StatusPreference::create((Array:3))
      #14 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(134): CRM_Core_JobManager->execute(FALSE)
      #15 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(101): civicrm_api3_job_execute((Array:2))
      #16 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(168): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
      #17 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(99): Civi\API\Kernel->runRequest((Array:9))
      #18 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/api/api.php(23): Civi\API\Kernel->runSafe("Job", "execute", (Array:2), NULL)
      #19 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.class.php(122): civicrm_api("Job", "execute", (Array:2))
      #20 /home/thefolks/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php(32): civicrm_cli->callApi()
      #21 {main}
  
  ```
  
  **Tags:** wordpress, error
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-02-18. Score: 2 | Accepted answer
  
  DO you have DB logging turned on? If so turn it off & back on again - the log\_civicrm\_status\_pref table might be missing the field
  
  > **Comments:**
  > **username_0**: I do indeed have logging turned on. Turning it off and back on didn't do anything, but manually adding the field to log_civicrm_status_pref seems to have done it. Thanks!  
  
  ---
  
  ### Answer by username_2 on 2020-07-17. Score: 1
  
  I had the same, the table was missing, I added it using
  
  <https://gist.github.com/xurizaemon/ac3d5bbc90712348d79a8d56bdd0b5ca>
  
  ```
  CREATE TABLE `civicrm_status_pref` (
  
       `id` int unsigned NOT NULL AUTO_INCREMENT  COMMENT 'Unique Status Preference ID',
       `domain_id` int unsigned NOT NULL   COMMENT 'Which Domain is this Status Preference for',
       `name` varchar(255) NOT NULL   COMMENT 'Name of the status check this preference references.',
       `hush_until` date   DEFAULT NULL COMMENT 'expires ignore_severity.  NULL never hushes.',
       `ignore_severity` int unsigned   DEFAULT 1 COMMENT 'Hush messages up to and including this severity.',
       `prefs` varchar(255)    COMMENT 'These settings are per-check, and can\'t be compared across checks.',
       `check_info` varchar(255)    COMMENT 'These values are per-check, and can\'t be compared across checks.' 
  ,
          PRIMARY KEY (`id`)
   
      ,     INDEX `UI_status_pref_name`(
          name
    )
    
  ,          CONSTRAINT FK_civicrm_status_pref_domain_id FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain`(`id`)   
  )  ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci  ;
  
  ```
  
  and disabling the foreign key check.
  
  
  ---
  
  