Answers.Body: <p>Maybe I'll save someone some time until there is some sort of integrated fix or if these are just flukes (however, I see them on multiple sites).</p>
  
  <p>On one site with only one smart group: 
  I disabled it
  I created a new smart group
  Successfully ran rebuild system cache!</p>
  
  <p>It seemed to clear up an error in our dblog about htmlentities (htmlentities() expects parameter 1 to be string, array given in CRM_Utils_Type::escape() (line 261 of sites\all\modules\civicrm\CRM\Utils\Type.php)) and also mailing issues to that smart group.</p>
  
  <p>Tonight I'll try to disable all of my smart groups on another site, run the rebuild and see if it clears it up there.</p>
  
  <p><strong>Update:</strong>
  On site with multiple smart groups, I went to Manage Groups, clicked on Contacts for each Smart Group and on one group, I got the error message about is not of the type Int.</p>
  
  <p>All other Smart Groups correctly displayed the contacts within that group. </p>
  
  <p>So I disabled that Smart Group and successfully ran Rebuild Smart Group Cache.</p>
  
  <p>If I re-enabled that group and ran the  rebuild again, the htmlentities error came back.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-04T15:25:08.590Z
Answers.Text: In my experience, smart groups can break between upgrades, when the search form / database schema changes and the smart group is still expecting to see the old schema.
Answers.UserDisplayName: michaelmcandrew
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-08T10:58:20.327Z
Answers.Text: on the site with multiple, does it work if you delete the smart group and recreate it? I think we had this once: the group broke for reasons unknown, but recreating fixed it and it hasn't recurred.
Answers.UserDisplayName: Andrew West
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-07T21:12:41.483Z
Answers.LastActivityDate: 2015-07-08T09:22:18.447Z
Answers.LastEditDate: 2015-07-08T09:22:18.447Z
Answers.UserDisplayName: pmoz
Answers.Body: <p>Try PR created at <a href="https://github.com/civicrm/civicrm-core/pull/6437" rel="nofollow">this link</a> which fixes some searches leading to DB error. May be, it should be able to fix your issue.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-07T08:55:41.820Z
Answers.LastActivityDate: 2015-08-07T08:55:41.820Z
Answers.UserDisplayName: jitendra - fuzion
Answers.Body: <p>could you create a new issue for this on JIRA and link it as related to <a href="https://issues.civicrm.org/jira/browse/CRM-15816" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-15816</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-13T20:54:03.823Z
Answers.Text: Sure thing. Thx. ;-)
Answers.UserDisplayName: BruceW
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-13T21:06:59.690Z
Answers.Text: Created https://issues.civicrm.org/jira/browse/CRM-16288
Answers.UserDisplayName: BruceW
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-13T13:37:29.457Z
Answers.LastActivityDate: 2015-04-13T13:37:29.457Z
Answers.UserDisplayName: Joe Murray
Body: <p>(Sorry, was hoping to not have to start a new Question but instead comment on another's but StackExchange doesn't allow it unless you have 50 points of privileges.)</p>
  
  <pre><code>CiviCRM 4.6.0
  Joomla 3.4.1
  </code></pre>
  
  <p>I am getting errors on both manual use and cronjob:</p>
  
  <p>Manual button in Groups:</p>
  
  <blockquote>
    <p>  @import url(/administrator/components/com_civicrm/civicrm/css/civicrm.css); @import url(/administrator/components/com_civicrm/civicrm/bower_components/jquery-ui/themes/smoothness/jquery-ui.min.css);    Sorry but we are not able to provide this at the moment.  is not of the type Int <p><a href="http://alcoholjustice.org/administrator/" rel="nofollow" title="Main Menu">Return to home page.</a></p>    function toggle( element ) { var className = element.className; if ( className == 'crm-accordion-wrapper collapsed crm-fatal-error-details-block') { element.className = 'crm-accordion-wrapper crm-fatal-error-details-block'; } else { element.className = 'crm-accordion-wrapper collapsed crm-fatal-error-details-block'; } } </p>
  </blockquote>
  
  <p>Scheduled Jobs (cronjob):</p>
  
  <blockquote>
    <p>Parameters raw (from db settings): 
    limit=Number optional-Limit the number of smart groups rebuild</p>
    
    <p>Parameters parsed (and passed to API method): 
    a:2:{s:7:"version";i:3;s:5:"limit";s:56:"Number optional-Limit the number of smart groups rebuild";}</p>
    
    <p>Full message: 
    Finished execution of Rebuild Smart Group Cache with result: Failure, Error message: A fatal error was triggered:  is not of the type Int</p>
  </blockquote>
  
Tags: <smartgroups>
Title: What do I do when rebuild Smart Group Cache fails?
ThreadText: # What do I do when rebuild Smart Group Cache fails?
  
  (Asked by: username_0 on 2015-04-13)
  
  (Sorry, was hoping to not have to start a new Question but instead comment on another's but StackExchange doesn't allow it unless you have 50 points of privileges.)
  
  ```
  CiviCRM 4.6.0
  Joomla 3.4.1
  
  ```
  
  I am getting errors on both manual use and cronjob:
  
  Manual button in Groups:
  
  > @import url(/administrator/components/com\_civicrm/civicrm/css/civicrm.css); @import url(/administrator/components/com\_civicrm/civicrm/bower\_components/jquery-ui/themes/smoothness/jquery-ui.min.css); Sorry but we are not able to provide this at the moment. is not of the type Int
  >
  > [Return to home page.](http://alcoholjustice.org/administrator/ "Main Menu")
  >
  > function toggle( element ) { var className = element.className; if ( className == 'crm-accordion-wrapper collapsed crm-fatal-error-details-block') { element.className = 'crm-accordion-wrapper crm-fatal-error-details-block'; } else { element.className = 'crm-accordion-wrapper collapsed crm-fatal-error-details-block'; } }
  
  Scheduled Jobs (cronjob):
  
  > Parameters raw (from db settings):
  > limit=Number optional-Limit the number of smart groups rebuild
  >
  > Parameters parsed (and passed to API method):
  > a:2:{s:7:"version";i:3;s:5:"limit";s:56:"Number optional-Limit the number of smart groups rebuild";}
  >
  > Full message:
  > Finished execution of Rebuild Smart Group Cache with result: Failure, Error message: A fatal error was triggered: is not of the type Int
  
  **Tags:** smartgroups
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_5 on 2015-04-13. Score: 4 | Accepted answer
  
  could you create a new issue for this on JIRA and link it as related to <https://issues.civicrm.org/jira/browse/CRM-15816>.
  
  > **Comments:**
  > **username_0**: Sure thing. Thx. ;-)  
  > **username_0**: Created https://issues.civicrm.org/jira/browse/CRM-16288  
  
  ---
  
  ### Answer by username_1 on 2015-07-07. Score: 1
  
  Maybe I'll save someone some time until there is some sort of integrated fix or if these are just flukes (however, I see them on multiple sites).
  
  On one site with only one smart group:
  I disabled it
  I created a new smart group
  Successfully ran rebuild system cache!
  
  It seemed to clear up an error in our dblog about htmlentities (htmlentities() expects parameter 1 to be string, array given in CRM\_Utils\_Type::escape() (line 261 of sites\all\modules\civicrm\CRM\Utils\Type.php)) and also mailing issues to that smart group.
  
  Tonight I'll try to disable all of my smart groups on another site, run the rebuild and see if it clears it up there.
  
  **Update:**
  On site with multiple smart groups, I went to Manage Groups, clicked on Contacts for each Smart Group and on one group, I got the error message about is not of the type Int.
  
  All other Smart Groups correctly displayed the contacts within that group.
  
  So I disabled that Smart Group and successfully ran Rebuild Smart Group Cache.
  
  If I re-enabled that group and ran the rebuild again, the htmlentities error came back.
  
  > **Comments:**
  > **username_3**: on the site with multiple, does it work if you delete the smart group and recreate it? I think we had this once: the group broke for reasons unknown, but recreating fixed it and it hasn't recurred.  
  > **username_2**: In my experience, smart groups can break between upgrades, when the search form / database schema changes and the smart group is still expecting to see the old schema.  
  
  ---
  
  ### Answer by username_4 on 2015-08-07. Score: 0
  
  Try PR created at [this link](https://github.com/civicrm/civicrm-core/pull/6437) which fixes some searches leading to DB error. May be, it should be able to fix your issue.
  
  
  ---
  
  