Answers.Body: <p>In the end (since @Demerit helped isolate that these errors only occurred on some admin-only lifetime memberships) I ended up deleting those membership types completely and recreating (and re-importing the relatively few who had those memberships). That seems to have solved the strangeness. Those types were set up before I started helping on this site but in the UI they looked identical to the ones I set up new... so I'm not sure what the actual issue was.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-20T17:06:26.350Z
Answers.LastActivityDate: 2022-04-20T17:06:26.350Z
Answers.UserDisplayName: Laryn
Answers.Body: <p>Looking at the code lines in the stacktrace, it's possible your price set or membership setup does not end up generating any line items related to memberships. Check the price sets and membership types setup.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T03:09:01.540Z
Answers.Text: Ah, interesting -- this helped me discover that it is only happening on membership types that are complimentary, admin-only "1 lifetime" memberships. The standard annual membership seems to work as expected. (Question updated) But those memberships that it is not working for are $0 memberships (no prices or price sets associated with them)...
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T03:13:56.800Z
Answers.Text: If you can replicate that on https://dmaster.demo.civicrm.org (or https://bmaster.demo.civicrm.org/) then I'd say it's a bug related to $0 memberships.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T14:38:33.277Z
Answers.Text: Thanks. I'll see if I can replicate the issue (no luck yet).
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T02:59:40.220Z
Answers.LastActivityDate: 2022-04-07T02:59:40.220Z
Answers.UserDisplayName: Demerit
Body: <p>I have a site that is spinning whenever I try to create a membership in the CiviCRM interface. The server logs don't have any particular errors, but the CiviCRM backtrace shows the following:</p>
  <pre><code>$Fatal Error Details = array:3 [
    &quot;message&quot; =&gt; &quot;invalid criteria for IN&quot;
    &quot;code&quot; =&gt; null
    &quot;exception&quot; =&gt; CiviCRM_API3_Exception {#1048
      -extraParams: array:3 [
        &quot;is_error&quot; =&gt; 1
        &quot;error_message&quot; =&gt; &quot;invalid criteria for IN&quot;
        &quot;error_code&quot; =&gt; &quot;undefined&quot;
      ]
      #message: &quot;invalid criteria for IN&quot;
      #code: 0
      #file: &quot;/app/modules/civicrm/api/api.php&quot;
      #line: 135
      trace: {
        /app/modules/civicrm/api/api.php:135 {
          › if (is_array($result) &amp;&amp; !empty($result['is_error'])) {
          ›   throw new CiviCRM_API3_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result);
          › }
        }
        /app/modules/civicrm/CRM/Member/Form/Membership.php:1836 { …}
        /app/modules/civicrm/CRM/Member/Form/Membership.php:1525 { …}
        /app/modules/civicrm/CRM/Member/Form/Membership.php:1319 { …}
        /app/modules/civicrm/CRM/Member/Form/Membership.php:882 { …}
        /app/modules/civicrm/CRM/Core/Form.php:573 { …}
        /app/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php:152 { …}
        /app/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php:119 { …}
        /app/modules/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
        /app/modules/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
        /app/modules/civicrm/CRM/Core/Controller.php:355 { …}
        /app/modules/civicrm/CRM/Member/Page/Tab.php:324 { …}
        /app/modules/civicrm/CRM/Member/Page/Tab.php:394 { …}
        /app/modules/civicrm/CRM/Core/Invoke.php:319 { …}
        /app/modules/civicrm/CRM/Core/Invoke.php:69 { …}
        /app/modules/civicrm/CRM/Core/Invoke.php:36 { …}
        /app/modules/civicrm/backdrop/civicrm.module:547 { …}
        /app/core/includes/menu.inc:584 { …}
        /app/core/modules/layout/layout.module:621 { …}
        /app/core/includes/menu.inc:531 { …}
        /app/index.php:21 { …}
      }
    }
  ]
  </code></pre>
  <p>I'm having trouble figuring out the best way to troubleshoot this one. It's CiviCRM 5.47.3 on Backdrop (but I've tested a separate Backdrop site and it works fine, so it's something particular to this site/setup/server... I just need to figure out what that something is).</p>
  <p>Update: it is only happening on membership types that are complimentary, admin-only &quot;1 lifetime&quot; memberships. The standard annual membership seems to work as expected.</p>
  <p>Any advice would be appreciated!</p>
  
Tags: <civimember><backdrop>
Title: Troubleshooting "invalid criteria for IN"
ThreadText: # Troubleshooting "invalid criteria for IN"
  
  (Asked by: username_0 on 2022-04-07)
  
  I have a site that is spinning whenever I try to create a membership in the CiviCRM interface. The server logs don't have any particular errors, but the CiviCRM backtrace shows the following:
  $Fatal Error Details = array:3 [
    "message" => "invalid criteria for IN"
    "code" => null
    "exception" => CiviCRM_API3_Exception {#1048
      -extraParams: array:3 [
        "is_error" => 1
        "error_message" => "invalid criteria for IN"
        "error_code" => "undefined"
      ]
      #message: "invalid criteria for IN"
      #code: 0
      #file: "/app/modules/civicrm/api/api.php"
      #line: 135
      trace: {
        /app/modules/civicrm/api/api.php:135 {
          › if (is_array($result) && !empty($result['is_error'])) {
          ›   throw new CiviCRM_API3_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result);
          › }
        }
        /app/modules/civicrm/CRM/Member/Form/Membership.php:1836 { …}
        /app/modules/civicrm/CRM/Member/Form/Membership.php:1525 { …}
        /app/modules/civicrm/CRM/Member/Form/Membership.php:1319 { …}
        /app/modules/civicrm/CRM/Member/Form/Membership.php:882 { …}
        /app/modules/civicrm/CRM/Core/Form.php:573 { …}
        /app/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php:152 { …}
        /app/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php:119 { …}
        /app/modules/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
        /app/modules/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
        /app/modules/civicrm/CRM/Core/Controller.php:355 { …}
        /app/modules/civicrm/CRM/Member/Page/Tab.php:324 { …}
        /app/modules/civicrm/CRM/Member/Page/Tab.php:394 { …}
        /app/modules/civicrm/CRM/Core/Invoke.php:319 { …}
        /app/modules/civicrm/CRM/Core/Invoke.php:69 { …}
        /app/modules/civicrm/CRM/Core/Invoke.php:36 { …}
        /app/modules/civicrm/backdrop/civicrm.module:547 { …}
        /app/core/includes/menu.inc:584 { …}
        /app/core/modules/layout/layout.module:621 { …}
        /app/core/includes/menu.inc:531 { …}
        /app/index.php:21 { …}
      }
    }
  ]
  
  I'm having trouble figuring out the best way to troubleshoot this one. It's CiviCRM 5.47.3 on Backdrop (but I've tested a separate Backdrop site and it works fine, so it's something particular to this site/setup/server... I just need to figure out what that something is).
  Update: it is only happening on membership types that are complimentary, admin-only "1 lifetime" memberships. The standard annual membership seems to work as expected.
  Any advice would be appreciated!
  
  **Tags:** civimember, backdrop
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2022-04-20. Score: 2 | Accepted answer
  
  In the end (since @username_1 helped isolate that these errors only occurred on some admin-only lifetime memberships) I ended up deleting those membership types completely and recreating (and re-importing the relatively few who had those memberships). That seems to have solved the strangeness. Those types were set up before I started helping on this site but in the UI they looked identical to the ones I set up new... so I'm not sure what the actual issue was.
  
  
  ---
  
  ### Answer by username_1 on 2022-04-07. Score: 2
  
  Looking at the code lines in the stacktrace, it's possible your price set or membership setup does not end up generating any line items related to memberships. Check the price sets and membership types setup.
  
  > **Comments:**
  > **username_0**: Ah, interesting -- this helped me discover that it is only happening on membership types that are complimentary, admin-only "1 lifetime" memberships. The standard annual membership seems to work as expected. (Question updated) But those memberships that it is not working for are $0 memberships (no prices or price sets associated with them)...  
  > **username_1**: If you can replicate that on https://dmaster.demo.civicrm.org (or https://bmaster.demo.civicrm.org/) then I'd say it's a bug related to $0 memberships.  
  > **username_0**: Thanks. I'll see if I can replicate the issue (no luck yet).  
  
  ---
  
  