Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-5813

REST interface returns 500 error when it should be a 404 Not Found

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Expired
    • Affects Version/s: OpenIDM 4.0.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      Some of the REST interfaces are returning a 500 Internal Server Error for a situation where it is most likely a 404 Not Found situation.

      Example: calling workflow/taskinstance/1468 normally returns the tasks details, if the tasks exists. If the task has been completed (thus deleted), the call returns 500 Internal Sever error:

      {
        "code": 500,
        "reason": "Internal Server Error",
        "message": "TypeError: Cannot read property \"assignee\" from null (/opt/forgerock/products/IDM/release/4.0.0/openidm/bin/defaults/script/router-authz.js#-1(eval)#1) in /opt/forgerock/products/IDM/release/4.0.0/openidm/bin/defaults/script/router-authz.js#-1(eval) at line number 1 at column number 0"
      }
      

      In this situation we are authenticated via OpenAM integration. If end-user is not logged in ... this REST call does return 401 as expected:

      {
        "code": 401,
        "reason": "Unauthorized",
        "message": "Access Denied"
      }
      

      You need to be authenticated to experience the 500 error situation.

      It would be better if this situation returned a 404 Not Found. Other similar REST APIs exhibit the same behavior

        Attachments

          Activity

            People

            Assignee:
            alin Alin Brici
            Reporter:
            sfehrman Scott Fehrman [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: