Uploaded image for project: 'COmanage'
  1. COmanage
  2. CO-1770

Internal Server Error when a "Required" attribute is not supplied in request

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • COmanage Match 1.0.0 (Suitable Pear)
    • Match
    • COmanage Match dated 6/23/2019
      PHP 7.3.6
      Postgres 11.1
      Windows Server 2016

    Description

      If a request to the Match API triggers a search of the MatchGrid, the first rule encountered that contains an attribute that is marked "Required", but is not included (or without non-null value) in the input object triggers an Internal Server Error response...

      debug.log:
      Debug:

      {SOR Name}

      /

      {SOR Ref ID}

      No value found for required attribute

      {attribute name}

      skipping rule

      {rule name}

      Debug: Preparing response with status code 500

      Error.log and response contain: Required attribute

      {attibute name}

      not found in request

      The language in the documentation and the debug log file indicate that the 500 is an unexpected result for this condition.

      Implemented at MatchService.php line 473-476
      if($ruleattr->attribute->required)

      { Log::write('debug', $sor . "/" . $sorid . " No value found for required attribute " . $ruleattr->attribute->name . " skipping rule " . $rule->name); --> throw new \RuntimeException(__('match.er.attr.req', [$ruleattr->attribute->name])); }

      Additionally, it appears that lines 478-479 make every attribute "Required" as defined in the Confluence page (No way to test an empty value against MatchGrid)
      Log::write('debug', $sor . "/" . $sorid . " No value found for attribute " . $ruleattr->attribute->name . " skipping rule " . $rule->name);
      continue 2;

      Attachments

        Activity

          People

            benn.oshrin@at.internet2.edu Benn Oshrin (internet2.edu)
            ross.wilper@at.internet2.edu Ross Wilper (stanford.edu)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: