Application staging with a very large VCAP_SERVICES value could fail with error "argument list too long".
Staging app and tracing logs... Downloading nodejs_buildpack_... Downloaded nodejs_buildpack Cell 8572a6a2-3e39-480d-8e00-ac04babfa0f2 creating container for instance 55128f58-2dbc-46a4-1233-44958ad0e044 Cell 8572a6a2-3e39-480d-8e00-ac04babfa0f2 successfully created container for instance 55128f58-2dbc-46a4-1233-44958ad0e044 Downloading app package... Downloaded app package (69M) Failed to compile droplet: Failed to run finalize script: fork/exec /tmp/buildpacks/3f36b721bcdd1582488cdc63c9eeaf98/bin/supply: argument list too long
During staging an application, both scripts(supply, detect, finalize, etc) arguments and environment variables are passed to exec to start a new process. There are two limits with the arguments/environment variables length.
Usually the first limit ARG_MAX won't be exceeded. However MAX_ARG_STRLEN could be exceeded if the single app is binding to too many services, which results in VCAP_SERVICES longer than 128KBs (after credhub interpolation).
The solution is to reduce VCAP_SERVICES length to less than 128KBs.