title: Calendar agent - error: sql cached statement NSSQLiteStatement
body: <p>So after spending quite a lot of time trying to fix my iCalendar app
  from the Spinning beach ball lag every time I make a new event or edit an event,
  I found this error in the console application:</p>
  
  <pre><code>"error: sql cached statement NSSQLiteStatement &lt;0x7f8eef4c0fd0&gt; on entity 'Group' with sql text 'SELECT t0.Z_ENT, t0.Z_PK, t0.Z_OPT, t0.ZCOLORSTRING, t0.ZISENABLED, ....... ( t0.Z_PK IN (SELECT * FROM _Z_intarray0)  AND  t0.Z_ENT &gt;= ? AND  t0.Z_ENT &lt;= ?) ' failed due to missing variable binding for (null) with expecting bindings (
      "&lt;NSSQLBindVariable: 0x7f8eef47bdd0&gt;",
      "&lt;NSSQLBindVariable: 0x7f8eef47be70&gt;"
  ) but actual substitution variables {
      objects = "{&lt;NSManagedObject: 0x7f8eef540140&gt; (entity: ExchangePrincipal; id: 0x240092b &lt;x-coredata://93547915-498F-4251-8E7E-23DD04782C04/ExchangePrincipal/p9&gt; ; data: &lt;fault&gt;)}";
  }
  
  
  error: sql cached statement NSSQLiteStatement &lt;0x7f8eef48daa0&gt; on entity 'Attendee' with sql text 'SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZADDRESSSTRING, t0.ZCOMMONNAME, t0.ZEMAIL, t0.ZINCLUDEDINALLRESPONDED, t0.ZINVITERNAME, t0.ZISSELFINVITED, t0.ZLIKENESSDATASTRING, t0.ZOMITSYNCRECORD, t0.ZPROPOSALENDDATE, t0.ZPROPOSALSTARTDATE, t0.ZPROPOSALSTATUS, t0.ZROLE, t0.ZRSVP, t0.ZSCHEDULEAGENT, t0.ZSCHEDULEFORCESEND, t0.ZSCHEDULESTATUS, t0.ZSTATUS, t0.ZSTATUSMODIFIEDDATE, t0.ZTYPE, t0.ZEVENT, t0.ZMYATTENDEEFOREVENT FROM ZATTENDEE t0 WHERE  t0.ZMYATTENDEEFOREVENT IN (SELECT * FROM _Z_intarray0)  ' failed due to missing variable binding for (null) with expecting bindings (
  ) but actual substitution variables {
      destinations = "{0x122c009eb &lt;x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1163&gt;, 0x1230009eb &lt;x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1164&gt;, 0x1234009eb &lt;x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1165&gt;, 0x123c009eb &lt;x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1167&gt;, 0x1258009eb &lt;x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1174&gt;, 0x1264009eb &lt;x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1177&gt;, 0x126c009eb &lt;x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1179&gt;, 0x127c009eb &lt;x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1183&gt;, 0x1280009eb &lt;x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1184&gt;, 0x1284009eb &lt;x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1185&gt;}";
  }"
  </code></pre>
  
  <p>There are around 8-10 of such errors each time I make a new event.
  Can you please help me with this issue?
  I already reinstalled mac os sierra few times,
  but it made no difference.</p>