Make sure you are pushing only needed files. By default, cf push will push all the contents of the current working directory. Make sure you are pushing only the directory for your application. If your application is too large, or if it has many small files, Cloud Foundry may time out during the upload. To reduce the number of files you are pushing, ensure that you push only the directory for your application, and remove unneeded files or use the .cfignore file to specify excluded files.
https://docs.cloudfoundry.org/devguide/deploy-apps/troubleshoot-app-health.html
FAILED
Error uploading application.
Error performing request: Put https://api.cf.example.com/v2/resource_match: http: ContentLength=91616 with Body length 0
FAILED
Error uploading application.
Error performing request: Put https://api.cf.example.com/v2/resource_match: http: ContentLength=91616 with Body length 0
This is a Nodejs app with 805 files and 76 folders. Size is 21 MB. Is this too much small files or folders? The docs.cloudfoundry.org doesn't name numbers.
The push fails after uploading. So there is not much logs
> cf logs exampleapp --recent
Connected, dumping recent logs for app exampleapp in org XXX / space XXX as XXX...
2015-08-11T14:24:30.15+0200 [API/3] OUT Updated app with guid 6004d9a9-a0b2-4fbf-881a-ada0d48b06eb ({"route"=>"75aceb7a-bab1-4a63-9c49-4ea78dd5866d"})
2015-08-11T14:58:55.49+0200 [API/2] OUT Updated app with guid 6004d9a9-a0b2-4fbf-881a-ada0d48b06eb ({"name"=>"exampleapp", "health_check_timeout"=>180})
2015-08-11T15:06:46.35+0200 [API/1] OUT Updated app with guid 6004d9a9-a0b2-4fbf-881a-ada0d48b06eb ({"name"=>"exampleapp", "health_check_timeout"=>180})
2015-08-11T15:18:29.71+0200 [API/2] OUT Updated app with guid 6004d9a9-a0b2-4fbf-881a-ada0d48b06eb ({"name"=>"exampleapp"})
2015-08-11T16:00:44.85+0200 [API/1] OUT Updated app with guid 6004d9a9-a0b2-4fbf-881a-ada0d48b06eb ({"name"=>"exampleapp"})
The issue is fixed after
for i in `seq 0 3`; do bosh -n restart api_z1 $i; done
Restart the API nodes (Cloud Controller). Upload goes trough CC to the S3.