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

PATCH remove a field could result in 500 error: Can not add or remove a 'null' value

    Details

    • Target Version/s:
    • Verified Version/s:
    • Story Points:
      2
    • Sprint:
      2019.11 - IDM
    • Support Ticket IDs:
    • Zendesk ID:
      39522

      Description

      There are two scenarios.

      1. Patch remove the same field twice. Steps to reproduce

      Make sure ldap DJ connector account/description doesn't use any flags.

                      "description" : {
                          "type" : "string",
                          "nativeName" : "description",
                          "nativeType" : "string",
                          "flags" : [ ],
      

      Patch replace description to /openidm/system/dj/account/<uuid>

      [{"operation":"replace","field":"/description","value":"orange"}]
      

      Patch remove description

      [{"operation":"remove","field":"/description"}]
      

      Patch remove description again

      [{"operation":"remove","field":"/description"}]
      

      and we have the 500 error:

      Apr 30, 2019 3:09:15.283 PM org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3 lambda$handleRequestWithLogging$8
      WARNING: Resource exception: 500 Internal Server Error: "Can not add or remove a 'null' value."
      org.forgerock.json.resource.InternalServerErrorException: Can not add or remove a 'null' value.
      at org.forgerock.openidm.provisioner.openicf.impl.ObjectClassResourceProvider.handlePatch(ObjectClassResourceProvider.java:415)
      at org.forgerock.openidm.provisioner.openicf.impl.ObjectClassRequestHandler.handlePatch(ObjectClassRequestHandler.java:121)
      ...
      Caused by: java.lang.IllegalArgumentException: Can not add or remove a 'null' value.
      at org.identityconnectors.framework.impl.api.local.operations.UpdateImpl.validateInput(UpdateImpl.java:252)
      at org.identityconnectors.framework.impl.api.local.operations.UpdateImpl.removeAttributeValues(UpdateImpl.java:120)

      2. Patch remove a NOT_READABLE and NOT_RETURNED_BY_DEFAULT field

      Set description to

                      "description" : {
                          "type" : "string",
                          "nativeName" : "description",
                          "nativeType" : "string",
                          "flags" : [
                              "NOT_READABLE",
                              "NOT_RETURNED_BY_DEFAULT"
                          ],
      

      Patch replace description to /openidm/system/dj/account/<uuid>

      [{"operation":"replace","field":"/description","value":"orange"}]
      

      Patch remove description

      [{"operation":"remove","field":"/description"}]
      

      And we get the same error/stack as scenario 1.

        Attachments

          Activity

            People

            • Assignee:
              alin Alin Brici
              Reporter:
              yinyan.cao Yinyan Cao
              QA Assignee:
              Son Nguyen
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: