VMware Tanzu TAS for VMS Get "argument list too long" error message when staging an application
search cancel

VMware Tanzu TAS for VMS Get "argument list too long" error message when staging an application

book

Article ID: 297517

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Resolution

Checklist:

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. 

  • total length, which is defined by ARG_MAX and can be fetched by `getconf ARG_MAX` it is 2097152. 
  • length of a single string, which is defined by MAX_ARG_STRLEN in binfmts.h, it is PAGE_SIZE * 32 = 131072.

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.