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.
Running
cf audit-stackagainst a foundation with more than 5000 apps and with CF_TRACE on you see the following output: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.