Skip to content

Audit fails when there are more than 5000 apps #21

@sneal

Description

@sneal

Running cf audit-stack against a foundation with more than 5000 apps and with CF_TRACE on you see the following output:

REQUEST:
GET /https://api.example.com/v3/apps?page=2&per_page=5000 HTTP/1.1
Host: api.example.com
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
 
RESPONSE:
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 86
Content-Type: application/json;charset=utf-8
Date: Wed, 28 Oct 2020 17:58:53 GMT
Server: nginx
X-Cascade: pass
X-Content-Type-Options: nosniff
X-Vcap-Request-Id: 74f943a4-e7c8-4d0f-4837-bca5161b006a::ab8e29bc-9694-472b-8714-2ad49eadcc33
{
  "description": "Unknown request",
  "error_code": "CF-NotFound",
  "code": 10000
}

This is happening because for each subsequent page returned by the v3 API has the full URL to the resource instead of the relative path which the curl command expects.

There are likely other failure cases besides just apps if it's using the v3 API and there are more than 5000 objects. This issue can more easily be reproduced by creating a custom binary and changing V3ResultsPerPage to something much smaller.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    ❓ Not scoped

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions