Body: <p><a href="https://i.sstatic.net/ZdN5l.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZdN5l.png" alt="enter image description here"></a>
  When I click Analyse (again) button on the review page i.e.(civicrm/banking/review?s_list=45)
  I get 500 service unavailable error in console 
  <a href="https://i.sstatic.net/m5fsb.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/m5fsb.png" alt="enter image description here"></a></p>
  
  <pre><code> https://www.example.com/civicrm/ajax/rest 500 (Service unavailable (with message))
    send @ jquery.js:9664
    ajax @ jquery.js:9215
    (anonymous) @ crm.ajax.js?p52hox:143
    CRM.api @ crm.ajax.js?p52hox:152
    analysePayment @ review?s_list=45:752 
    onclick @ review?s_list=45:685
  </code></pre>
  
  <p>The code at analysePayment@review?s_list=45:752 is</p>
  
  <pre><code>  CRM.api('BankingTransaction', 'analyselist', query,
      {success: function(data) {
      console.log(data);
          if (!data['is_error']) {
            // remove 'execute' bit from URL before reload
            var newURL = window.location.href.replace(reload_regex, '');
            if (window.location.href == newURL) {
              window.location.reload(false);
            } else {
              window.location = newURL;
            }
          } else {
            cj('&lt;div title="Fout"&gt;&lt;span class="ui-icon ui-icon-alert" style="float:left;"&gt;&lt;/span&gt;' + data['error_message'] + '&lt;/div&gt;').dialog({
              modal: true,
              buttons: {
                Ok: function() {
                  window.location = window.location.href.replace(reload_regex, '');
                }
              }
            });
          }
        }
      }
    );
  </code></pre>
  
  <p>While debugging the above issue, I have traced it back to the below function
  which you can find it here in github
  <a href="https://github.com/Project60/org.project60.banking/blob/9dc6bdcc486753f70948edfd4ea36df0eb9d2f86/extension/CRM/Banking/Matcher/Engine.php" rel="nofollow noreferrer">https://github.com/Project60/org.project60.banking/blob/9dc6bdcc486753f70948edfd4ea36df0eb9d2f86/extension/CRM/Banking/Matcher/Engine.php</a>
  and the exact code where I think the issue is $continue value turns out to be 1 and which results in return value to be false since it does not enter the if(!$continue) condition</p>
  
  <pre><code> foreach ($matchers as $matcher) {
            try {
              // run matchers to generate suggestions
              $logger-&gt;setTimer('matcher');
              $continue = $this-&gt;matchPlugin( $matcher, $context );
              $logger-&gt;logTime("Matcher [{$matcher-&gt;getPluginID()}]", 'matcher');
              if (!$continue) {
                $lock-&gt;release();
                $logger-&gt;logTime("Matching of btx [{$btx_id}]", 'matcher');
                return true;
              }
  </code></pre>
  
  <p>Now I need to find out a way to make it true so I can see options to match contributions
  The matcher I am using is
  <a href="https://github.com/Project60/org.project60.banking/blob/9dc6bdcc486753f70948edfd4ea36df0eb9d2f86/configuration_database/matcher/default/EnglishDefaults.json" rel="nofollow noreferrer">https://github.com/Project60/org.project60.banking/blob/9dc6bdcc486753f70948edfd4ea36df0eb9d2f86/configuration_database/matcher/default/EnglishDefaults.json</a>
  I think this is where I need to alter json so that $continue value turns out to be false,but unsure how I can alter it and what does each key value pair does specifically.</p>
  
  <pre><code> /**
     * Run this BTX through the matchers
     *
     * @param CRM_Banking_BAO_BankTransaction $btx
     * @param bool $override_processed   Set this to TRUE if you want to re-match processed transactions.
     *                                    This will destroy all records of the execution!
     */
    public function match( $btx_id, $override_processed = FALSE ) {
      // TODO: timeout is 30s - do we need a setting here?
      $lock_timeout = 30.0;
      $lock = CRM_Utils_BankingSafeLock::acquireLock('org.project60.banking.tx'.'-'.$btx_id, $lock_timeout);
      if (empty($lock)) {
        error_log("org.project60.banking - couldn't acquire lock. Timeout is $lock_timeout.");
        return false;
      }
  
      // load btx
      $btx = new CRM_Banking_BAO_BankTransaction();
      $btx-&gt;get('id', $btx_id);
  
      if (!$override_processed) {
        // don't match already executed transactions...
        $processed_status_id = banking_helper_optionvalueid_by_groupname_and_name('civicrm_banking.bank_tx_status', 'Processed');
        $ignored_status_id = banking_helper_optionvalueid_by_groupname_and_name('civicrm_banking.bank_tx_status', 'Ignored');
        if ($btx-&gt;status_id == $processed_status_id || $btx-&gt;status_id == $ignored_status_id) {
          // will not match already executed transactions
          $lock-&gt;release();
          return true;
        }
      }
  
      // reset the BTX suggestion list
      $btx-&gt;resetSuggestions();
  
      // reset the cache / context object
      $context = new CRM_Banking_Matcher_Context( $btx );
      $logger = CRM_Banking_Helpers_Logger::getLogger();
  
      // run through the list of matchers
      $logger-&gt;setTimer('matching');
      // run through the list of matchers
      $all_matchers = $this-&gt;getMatchers();
      if (empty($all_matchers)) {
        CRM_Core_Session::setStatus(ts("No matcher plugins configured!"), ts('No processors'), 'alert');
      } else {
        foreach ($all_matchers as $weight =&gt; $matchers) {
          foreach ($matchers as $matcher) {
            try {
              // run matchers to generate suggestions
              $logger-&gt;setTimer('matcher');
              $continue = $this-&gt;matchPlugin( $matcher, $context );
              $logger-&gt;logTime("Matcher [{$matcher-&gt;getPluginID()}]", 'matcher');
              if (!$continue) {
                $lock-&gt;release();
                $logger-&gt;logTime("Matching of btx [{$btx_id}]", 'matcher');
                return true;
              }
              // check if we can execute the suggestion right aways
              $abort = $this-&gt;checkAutoExecute($matcher, $btx);
              if ($abort) {
                $logger-&gt;logDebug("Matcher [{$matcher-&gt;getPluginID()}] executed automatically.");
                $lock-&gt;release();
                $logger-&gt;logTime("Matching of btx [{$btx_id}]", 'matcher');
                return false;
              }
            } catch (Exception $e) {
              $matcher_id = $matcher-&gt;getPluginID();
              error_log("org.project60.banking - Exception during the execution of matcher [$matcher_id], error was: ".$e-&gt;getMessage());
              $lock-&gt;release();
              return false;
            }
          }
        }
      }
  
      $btx-&gt;saveSuggestisons();
      // set the status
      $newStatus = banking_helper_optionvalueid_by_groupname_and_name('civicrm_banking.bank_tx_status', 'Suggestions');
  
      $btx-&gt;status_id = $newStatus;
      $btx-&gt;setStatus($newStatus);
  
      $lock-&gt;release();
      $context-&gt;destroy();
      $logger-&gt;logTime("Matching of btx [{$btx_id}]", 'matcher');
      return false;
    }
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-04T19:01:40.163Z
Comments.Text: You may want to add this to the Extension's project page at https://github.com/Project60/org.project60.banking/releases
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-04T19:36:28.443Z
Comments.Text: @petednz-fuzion, yes I have added it,but I now seem may be something is missing with respect to matcher plugin , I might have added it.  https://github.com/Project60/org.project60.banking/issues/190
Comments.UserDisplayName: harshal
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-05T09:25:06.453Z
Comments.Text: This is ually caused by a misconfiguration of one of the matchers. You can probably see the error in the logs or in the netwerk tab on the response of the ajax call
Comments.UserDisplayName: Jaap Jansma - CiviCooP
Tags: <civibanking>
Title: Review Bank Page Issue on Analyse (again) button
ThreadText: # Review Bank Page Issue on Analyse (again) button
  
  (Asked by: username_0 on 2018-03-04)
  
  When I click Analyse (again) button on the review page i.e.(civicrm/banking/review?s_list=45)
  I get 500 service unavailable error in console 
  
   https://www.example.com/civicrm/ajax/rest 500 (Service unavailable (with message))
    send @ jquery.js:9664
    ajax @ jquery.js:9215
    (anonymous) @ crm.ajax.js?p52hox:143
    CRM.api @ crm.ajax.js?p52hox:152
    analysePayment @ review?s_list=45:752 
    onclick @ review?s_list=45:685
  
  The code at analysePayment@review?s_list=45:752 is
    CRM.api('BankingTransaction', 'analyselist', query,
      {success: function(data) {
      console.log(data);
          if (!data['is_error']) {
            // remove 'execute' bit from URL before reload
            var newURL = window.location.href.replace(reload_regex, '');
            if (window.location.href == newURL) {
              window.location.reload(false);
            } else {
              window.location = newURL;
            }
          } else {
            cj('' + data['error_message'] + '').dialog({
              modal: true,
              buttons: {
                Ok: function() {
                  window.location = window.location.href.replace(reload_regex, '');
                }
              }
            });
          }
        }
      }
    );
  
  While debugging the above issue, I have traced it back to the below function
  which you can find it here in github
  https://github.com/Project60/org.project60.banking/blob/9dc6bdcc486753f70948edfd4ea36df0eb9d2f86/extension/CRM/Banking/Matcher/Engine.php
  and the exact code where I think the issue is $continue value turns out to be 1 and which results in return value to be false since it does not enter the if(!$continue) condition
   foreach ($matchers as $matcher) {
            try {
              // run matchers to generate suggestions
              $logger->setTimer('matcher');
              $continue = $this->matchPlugin( $matcher, $context );
              $logger->logTime("Matcher [{$matcher->getPluginID()}]", 'matcher');
              if (!$continue) {
                $lock->release();
                $logger->logTime("Matching of btx [{$btx_id}]", 'matcher');
                return true;
              }
  
  Now I need to find out a way to make it true so I can see options to match contributions
  The matcher I am using is
  https://github.com/Project60/org.project60.banking/blob/9dc6bdcc486753f70948edfd4ea36df0eb9d2f86/configuration_database/matcher/default/EnglishDefaults.json
  I think this is where I need to alter json so that $continue value turns out to be false,but unsure how I can alter it and what does each key value pair does specifically.
   /**
     * Run this BTX through the matchers
     *
     * @param CRM_Banking_BAO_BankTransaction $btx
     * @param bool $override_processed   Set this to TRUE if you want to re-match processed transactions.
     *                                    This will destroy all records of the execution!
     */
    public function match( $btx_id, $override_processed = FALSE ) {
      // TODO: timeout is 30s - do we need a setting here?
      $lock_timeout = 30.0;
      $lock = CRM_Utils_BankingSafeLock::acquireLock('org.project60.banking.tx'.'-'.$btx_id, $lock_timeout);
      if (empty($lock)) {
        error_log("org.project60.banking - couldn't acquire lock. Timeout is $lock_timeout.");
        return false;
      }
  
      // load btx
      $btx = new CRM_Banking_BAO_BankTransaction();
      $btx->get('id', $btx_id);
  
      if (!$override_processed) {
        // don't match already executed transactions...
        $processed_status_id = banking_helper_optionvalueid_by_groupname_and_name('civicrm_banking.bank_tx_status', 'Processed');
        $ignored_status_id = banking_helper_optionvalueid_by_groupname_and_name('civicrm_banking.bank_tx_status', 'Ignored');
        if ($btx->status_id == $processed_status_id || $btx->status_id == $ignored_status_id) {
          // will not match already executed transactions
          $lock->release();
          return true;
        }
      }
  
      // reset the BTX suggestion list
      $btx->resetSuggestions();
  
      // reset the cache / context object
      $context = new CRM_Banking_Matcher_Context( $btx );
      $logger = CRM_Banking_Helpers_Logger::getLogger();
  
      // run through the list of matchers
      $logger->setTimer('matching');
      // run through the list of matchers
      $all_matchers = $this->getMatchers();
      if (empty($all_matchers)) {
        CRM_Core_Session::setStatus(ts("No matcher plugins configured!"), ts('No processors'), 'alert');
      } else {
        foreach ($all_matchers as $weight => $matchers) {
          foreach ($matchers as $matcher) {
            try {
              // run matchers to generate suggestions
              $logger->setTimer('matcher');
              $continue = $this->matchPlugin( $matcher, $context );
              $logger->logTime("Matcher [{$matcher->getPluginID()}]", 'matcher');
              if (!$continue) {
                $lock->release();
                $logger->logTime("Matching of btx [{$btx_id}]", 'matcher');
                return true;
              }
              // check if we can execute the suggestion right aways
              $abort = $this->checkAutoExecute($matcher, $btx);
              if ($abort) {
                $logger->logDebug("Matcher [{$matcher->getPluginID()}] executed automatically.");
                $lock->release();
                $logger->logTime("Matching of btx [{$btx_id}]", 'matcher');
                return false;
              }
            } catch (Exception $e) {
              $matcher_id = $matcher->getPluginID();
              error_log("org.project60.banking - Exception during the execution of matcher [$matcher_id], error was: ".$e->getMessage());
              $lock->release();
              return false;
            }
          }
        }
      }
  
      $btx->saveSuggestisons();
      // set the status
      $newStatus = banking_helper_optionvalueid_by_groupname_and_name('civicrm_banking.bank_tx_status', 'Suggestions');
  
      $btx->status_id = $newStatus;
      $btx->setStatus($newStatus);
  
      $lock->release();
      $context->destroy();
      $logger->logTime("Matching of btx [{$btx_id}]", 'matcher');
      return false;
    }
  
  **Tags:** civibanking
  
  > **Comments:**
  > **username_1**: You may want to add this to the Extension's project page at https://github.com/Project60/org.project60.banking/releases  
  > **username_0**: @petednz-fuzion, yes I have added it,but I now seem may be something is missing with respect to matcher plugin , I might have added it.  https://github.com/Project60/org.project60.banking/issues/190  
  > **username_2**: This is ually caused by a misconfiguration of one of the matchers. You can probably see the error in the logs or in the netwerk tab on the response of the ajax call  
  
  ---
  
  ## 0 answers
  
  