Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-12999

AM with large number of policies cannot list policies through REST API

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.0.0
    • 6.5.0
    • console, performance, rest
    • AM 6.0.0-SNAPSHOT Build c756aa8ed6 (2018-April-24 13:10) @ Tomcat 8.0.46 @ CentOS 7.3
    • Rank:
      1|hzwbzz:
    • Yes
    • Yes and I used the same an in the description
    • 0
    • No
    • TESLA

    Description

      Bug description

      API for retrieving list of policies can timeout, when large count of policies is created. For 10k it is OK, but for 100k it fails with 504 - Gateway timeout. Loading of policies can fail also in WebUI due to this bug.

      Reason might be that the response is not paginated by default.

      How to reproduce the issue

      1. Default AM configuration
      2. Create 100k policies in top level realm
      3. Send request for listing properties like
        curl --request GET \
          --url 'http://brie.internal.forgerock.com:8081/openam/json/policies?_queryFilter=true' \
          --header 'accept: text/html' \
          --header 'accept-api-version: resource=2.0' \
          --header 'content-type: application/json' \
          --cookie 'amlbcookie=01; iPlanetDirectoryPro=szvyE...xAAA.*'
        
      Expected behaviour
      {
      	"result": [
      		{
      			"_id": "policy1955",
      			"_rev": "1459410117234",
      			"name": "policy1955",
      			"active": true,
      			"description": "",
      			"applicationName": "iPlanetAMWebAgentService",
      			"actionValues": {
      				"POST": true,
      				"GET": true
      			},
      			"resources": [
      				"http://*:*/Resource1955.html"
      			],
      			"subject": {
      				"type": "Identity",
      				"subjectValues": [
      					"id=user.1955,ou=user,dc=openam,dc=forgerock,dc=org"
      				]
      			},
      			"resourceTypeUuid": "76656a38-5f8e-401b-83aa-4ccb74ce88d2",
      			"lastModifiedBy": "id=amAdmin,ou=user,dc=com",
      			"lastModifiedDate": "2016-03-31T07:41:57.234Z",
      			"createdBy": "id=amAdmin,ou=user,dc=com",
      			"creationDate": "2016-03-31T07:41:57.234Z"
      		},
      		{
      			"_id": "policy1956",
      			"_rev": "1459410117234",
      			"name": "policy1956",
      			"active": true,
      			"description": "",
      			"applicationName": "iPlanetAMWebAgentService",
      			"actionValues": {
      				"POST": true,
      				"GET": true
      			},
      			"resources": [
      				"http://*:*/Resource1956.html"
      			],
      			"subject": {
      				"type": "Identity",
      				"subjectValues": [
      					"id=user.1956,ou=user,dc=openam,dc=forgerock,dc=org"
      				]
      			},
      			"resourceTypeUuid": "76656a38-5f8e-401b-83aa-4ccb74ce88d2",
      			"lastModifiedBy": "id=amAdmin,ou=user,dc=com",
      			"lastModifiedDate": "2016-03-31T07:41:57.234Z",
      			"createdBy": "id=amAdmin,ou=user,dc=com",
      			"creationDate": "2016-03-31T07:41:57.234Z"
      		},
      		...
      	],
      	"resultCount": 1000,
      	"pagedResultsCookie": null,
      	"totalPagedResultsPolicy": "NONE",
      	"totalPagedResults": -1,
      	"remainingPagedResults": 100
      }
      
      Current behaviour
      504 - Gateway timeout
      

      Work around

      Use _pageSize parameter with some reasonable value.

      Attachments

        Issue Links

          Activity

            People

              ken.stubbings Ken Stubbings
              tomas.hejret Tomas Hejret
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: