Uploaded image for project: 'SlamData'
  1. SD-1828

Trying to add a user to a security group that is already a member of that group results in a 500 Internal Server Error

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0, ASAP
    • Component/s: Advanced, Quasar
    • Labels:
      None
    • Environment:

      Description

      Making a PATCH/update to a security group and trying to add a user that already exists results in an 500 Internal Server Error. My hope would be to get a better error code if the user already exists, rather than a generic Internal Server Error code.

      Example with curl:

      1. Verify group does not exist:

      [/Users/damon/scripts]$ curl -sSG http://localhost:8080/security/group/texas | jq
      {
        "error": {
          "status": "Group not found.",
          "detail": {
            "message": "The group '/texas' was not found."
          }
        }
      }
      

      2. Create group "Texas"

      [/Users/damon/scripts]$ curl -iX POST http://localhost:8080/security/group/texas
      HTTP/1.1 201 Created
      Date: Wed, 06 Jul 2016 00:51:17 UTC
      Content-Length: 0
      

      3. Verify group exists, but with no members:

      [/Users/damon/scripts]$ curl -sSG http://localhost:8080/security/group/texas | jq
      {
        "members": [],
        "allMembers": [],
        "subGroups": []
      }
      

      4. Add user "damon@lacailles.com" to group:

      [/Users/damon/scripts]$ curl -iH "Accept: application/json" -H "Content-type: application/json" -X PATCH -d ' {"addUsers":["damon@lacailles.com"],"removeUsers":[]} ' http://localhost:8080/security/group/texas
      HTTP/1.1 204 No Content
      Date: Wed, 06 Jul 2016 00:52:36 UTC
      

      5. Verify user exists:

      [/Users/damon/scripts]$ curl -sSG http://localhost:8080/security/group/texas | jq
      {
        "members": [
          "damon@lacailles.com"
        ],
        "allMembers": [
          "damon@lacailles.com"
        ],
        "subGroups": []
      }
      

      6. Attempt to add user again and get error:

      [/Users/damon/scripts]$ curl -iH "Accept: application/json" -H "Content-type: application/json" -X PATCH -d ' {"addUsers":["damon@lacailles.com"],"removeUsers":[]} ' http://localhost:8080/security/group/texas
      HTTP/1.1 500 Internal Server Error
      Connection: close
      Date: Wed, 06 Jul 2016 00:53:40 UTC
      Content-Length: 0
      

        Attachments

          Activity

            People

            • Assignee:
              moss Moss Prescott
              Reporter:
              damon Damon LaCaille
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: