1

Hi this is one of those really intractable problems which appears to have no obvious cause.

CiviCRM 5.28.3/Wordpress 5.5 (upgraded from 5.27 today, so unknown if upgrade could resolve problem).

Attempts to purchase a membership (using PayPal) fail at 'continue to payment' stage. Clicking the button shows the user the 'We cannot provide that at the moment" screen and adds:

Expected one Membership but found 0

The log for a single incidence of this error is 16,000+ lines long! So I'm wondering if there is some sort of infinite loop error going on.

It's difficult to include a full backtrace with such a vast error entry, and just anonymizing the data would take time. However, here is a brief extract from the start of the log:

Aug 13 10:42:55  [error]
$Fatal Error Details = array(3) {
  ["message"]=>
  string(35) "Expected one Membership but found 0"
  ["code"]=>
  NULL
  ["exception"]=>
  object(CiviCRM_API3_Exception)#6479 (8) {
    ["extraParams":"CiviCRM_API3_Exception":private]=>
    array(3) {
      ["is_error"]=>
      int(1)
      ["error_message"]=>
      string(35) "Expected one Membership but found 0"
      ["error_code"]=>
      string(9) "undefined"
    }
    ["message":protected]=>
    string(35) "Expected one Membership but found 0"
    ["string":"Exception":private]=>
    string(0) ""
    ["code":protected]=>
    int(0)
    ["file":protected]=>
    string(113) "/path/to/website/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Relationship.php"
    ["line":protected]=>
    int(1062)
    ["trace":"Exception":private]=>
    array(25) {
      [0]=>
      array(6) {
        ["file"]=>
        string(114) "/path/to/website/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Contact/Utils.php"
        ["line"]=>
        int(412)
        ["function"]=>
        string(11) "setIsActive"
        ["class"]=>
        string(28) "CRM_Contact_BAO_Relationship"
        ["type"]=>
        string(2) "::"
        ["args"]=>
        array(2) {
          [0]=>
          string(4) "1239"
          [1]=>
          bool(false)
        }
      }
      [1]=>
      array(6) {
        ["file"]=>
        string(114) "/path/to/website/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Contact/Utils.php"
        ["line"]=>
        int(290)
        ["function"]=>
        string(20) "clearCurrentEmployer"
        ["class"]=>
        string(29) "CRM_Contact_BAO_Contact_Utils"
        ["type"]=>
        string(2) "::"
        ["args"]=>
        array(2) {
          [0]=>
          string(4) "3579"
          [1]=>
          string(4) "1849"
        }
      }
      [2]=>
      array(6) {
        ["file"]=>
        string(108) "/path/to/website/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Contact.php"
        ["line"]=>
        int(203)
        ["function"]=>
        string(33) "createCurrentEmployerRelationship"
        ["class"]=>
        string(29) "CRM_Contact_BAO_Contact_Utils"
        ["type"]=>
        string(2) "::"
        ["args"]=>
        array(4) {
          [0]=>
          string(4) "3579"
          [1]=>
          string(4) "8194"
          [2]=>
          string(4) "1849"
          [3]=>
          bool(false)
        }
      }
      [3]=>
      array(6) {
        ["file"]=>
        string(108) "/path/to/website/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Contact.php"
        ["line"]=>
        int(290)
        ["function"]=>
        string(3) "add"
        ["class"]=>
        string(23) "CRM_Contact_BAO_Contact"
        ["type"]=>
        string(2) "::"
        ["args"]=>
        array(1) {
          [0]=>
          &array(35) {
            ["source"]=>
            NULL
            ["contact_type"]=>
            string(10) "Individual"
            ["contact_sub_type"]=>
            NULL
            ["contact_id"]=>
            string(4) "3579"
            ["qfKey"]=>
            string(35) "ab6ab1bff51cb50fdb2476be3c8d8359_53"
            ["entryURL"]=>
            string(78) "https://example.com/join/?civiwp=CiviCRM&q=civicrm%2Fcontribute%2Ftransact"
            ["first_name"]=>
            string(5) "Tracy"
            ["last_name"]=>
            string(6) "Hussey"
            ["current_employer"]=>
            string(23) "Trumpton Fire Station"
            ["job_title"]=>
            string(18) "Executive Director"
            ["email"]=>
            array(2) {
              [1]=>
              array(3) {
                ["location_type_id"]=>
                string(1) "2"
                ["is_primary"]=>
                int(1)
                ["email"]=>
                string(31) "example@example.com"
              }
              [3]=>
              array(3) {
                ["location_type_id"]=>
                string(1) "5"
                ["is_billing"]=>
                int(1)
                ["email"]=>
                string(31) "example@example.com"
              }
            }
            ["phone"]=>
            array(1) {
              [2]=>
              array(4) {
                ["location_type_id"]=>
                string(1) "2"
                ["is_primary"]=>
                int(1)
                ["phone_type_id"]=>
                string(1) "1"
                ["phone"]=>
                string(10) "5555555555"
              }
            }
            ["address"]=>
            array(1) {
              [1]=>
              array(5) {
                ["location_type_id"]=>
                string(1) "2"
                ["is_primary"]=>
                int(1)
                ["city"]=>
                string(10) "Trumpton"
                ["state_province_id"]=>
                string(4) "1108"
                ["country_id"]=>
                string(4) "1039"
              }
            }
            ["onbehalf"]=>
            array(8) {
              ["organization_name"]=>
              string(23) "Trumpton Fire Station"
              ["phone-3-1"]=>
              string(10) "6666666666"
              ["email-3"]=>
              string(29) "example@example.com"
              ["street_address-3"]=>
              string(31) "123 Chigley Street"
              ["city-3"]=>
              string(10) "Trumpton"
              ["postal_code-3"]=>
              string(7) "1A1A1A"
              ["state_province-3"]=>
              string(4) "1108"
              ["country-3"]=>
              string(4) "1039"
            }
            ["hidden_processor"]=>
            string(1) "1"
            ["payment_processor_id"]=>
            string(1) "5"
            ["priceSetId"]=>
            string(3) "164"
            ["price_64"]=>
            string(3) "103"
            ["selectProduct"]=>
            string(0) ""
            ["MAX_FILE_SIZE"]=>
            string(8) "20971520"
            ["ip_address"]=>
            string(11) "0.0.0.0"
            ["amount"]=>
            float(180)
            ["tax_amount"]=>
            NULL
            ["currencyID"]=>
            string(3) "CAD"
            ["selectMembership"]=>
            NULL
            ["is_pay_later"]=>
            int(0)
            ["invoiceID"]=>
            string(32) "53d78c803925d95bc576e06481e33943"
            ["description"]=>
            string(91) "OOnline"
            ["accountingCode"]=>
            NULL
            ["updateBlankLocInfo"]=>
            bool(false)
            ["email_greeting_id"]=>
            string(1) "1"
            ["postal_greeting_id"]=>
            string(1) "1"
            ["addressee_id"]=>
            string(1) "1"
            ["addressee_custom"]=>
            string(18) "Executive Director"
            ["is_deceased"]=>
            bool(false)
          }
        }
      }

I'd very much appreciate any suggestions as to what might be going on. This is a longstanding website and this is a new problem arising in the last few days.

3
  • 1
    so this problem preceded the civi upgrade?
    – petednz - fuzion
    Aug 23 '20 at 23:12
  • 1
    The question from @petednz-fuzion is crucial - I believe there was a bug in 5.27.x that replaced Null with '0' in some places and caused some issues: this could be related to that? In which case upgrading to 5.28.3 should have fixed it.
    – Hugh
    Aug 24 '20 at 0:34
  • @petednz-fuzion Thanks - yes it did precede the upgrade. Ok, that gives me some hope that the problem may go away. Time will tell.
    – fred2
    Aug 24 '20 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.