{"action":"created","issue":{"url":"https://api.github.com/repos/cf-tm-bot/capi/issues/609","repository_url":"https://api.github.com/repos/cf-tm-bot/capi","labels_url":"https://api.github.com/repos/cf-tm-bot/capi/issues/609/labels{/name}","comments_url":"https://api.github.com/repos/cf-tm-bot/capi/issues/609/comments","events_url":"https://api.github.com/repos/cf-tm-bot/capi/issues/609/events","html_url":"https://github.com/cf-tm-bot/capi/issues/609","id":194228768,"number":609,"title":"Check params for application_path when using nginx upload - Story Id: 86070338","user":{"login":"cf-tm-bot","id":20690070,"avatar_url":"https://avatars.githubusercontent.com/u/20690070?v=3","gravatar_id":"","url":"https://api.github.com/users/cf-tm-bot","html_url":"https://github.com/cf-tm-bot","followers_url":"https://api.github.com/users/cf-tm-bot/followers","following_url":"https://api.github.com/users/cf-tm-bot/following{/other_user}","gists_url":"https://api.github.com/users/cf-tm-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/cf-tm-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cf-tm-bot/subscriptions","organizations_url":"https://api.github.com/users/cf-tm-bot/orgs","repos_url":"https://api.github.com/users/cf-tm-bot/repos","events_url":"https://api.github.com/users/cf-tm-bot/events{/privacy}","received_events_url":"https://api.github.com/users/cf-tm-bot/received_events","type":"User","site_admin":false},"labels":[{"id":447324187,"url":"https://api.github.com/repos/cf-tm-bot/capi/labels/bug","name":"bug","color":"ee0701","default":true},{"id":447329964,"url":"https://api.github.com/repos/cf-tm-bot/capi/labels/unscheduled","name":"unscheduled","color":"c8cbd0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-08T02:08:51Z","updated_at":"2016-12-08T02:08:53Z","closed_at":null,"body":"Upload of bits fails in nginx:\n\nnginx.error.log\n\n```\n2015/01/13 17:38:52 [alert] 3908#0: *1415 aborted uploading file \"application.zip\" to \"/var/vcap/data/cloud_controller_ng/tmp/uploads/0000000023\", dest file removed, client: 10.70.128.100, server: _, request: \"PUT /v2/apps/0a40a258-4d50-4db7-a9db-45e76bc66aa9/bits?async=true HTTP/1.1\", host: \"api.system.10.70.128.91.xip.io\"\n```\n\n* When HttpUploadModule (http://wiki.nginx.org/HttpUploadModule) aborts upload, params['application_path'] is not present,\n* VCAP::CloudController::AppBitsUploadController#upload calls CloudController::DependencyLocator.instance.upload_handler.uploaded_file which returns nil for uploaded_zip_of_files_not_in_blobstore_path\n* Then, in CloudController::Blobstore::LocalAppBits.from_compressed_bits the compressed_bits_path is not set, so no package files are ever unzipped, therefore they are missing from the package that AppBitsPackage.create creates from local_app_bits.uncompressed_path\n\n\nWhen nginx aborts a file upload, it will not pass the 'application_path' param to the controller. This will cause an App bits upload to continue but not work as specified above. We should guard against this and return an error.\n\nThis is an issue for all API endpoints that use the upload module, not just Apps.\n\n\n\nThe initial symptom is that staging fails because there are no bits other the those that are already cached.\n\n---\n\nMirrors: [story 86070338](https://www.pivotaltracker.com/story/show/86070338) submitted on Jan 14, 2015 UTC\n- **Estimate**: 0.0"},"comment":{"url":"https://api.github.com/repos/cf-tm-bot/capi/issues/comments/265632937","html_url":"https://github.com/cf-tm-bot/capi/issues/609#issuecomment-265632937","issue_url":"https://api.github.com/repos/cf-tm-bot/capi/issues/609","id":265632937,"user":{"login":"cf-tm-bot","id":20690070,"avatar_url":"https://avatars.githubusercontent.com/u/20690070?v=3","gravatar_id":"","url":"https://api.github.com/users/cf-tm-bot","html_url":"https://github.com/cf-tm-bot","followers_url":"https://api.github.com/users/cf-tm-bot/followers","following_url":"https://api.github.com/users/cf-tm-bot/following{/other_user}","gists_url":"https://api.github.com/users/cf-tm-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/cf-tm-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cf-tm-bot/subscriptions","organizations_url":"https://api.github.com/users/cf-tm-bot/orgs","repos_url":"https://api.github.com/users/cf-tm-bot/repos","events_url":"https://api.github.com/users/cf-tm-bot/events{/privacy}","received_events_url":"https://api.github.com/users/cf-tm-bot/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T02:08:53Z","updated_at":"2016-12-08T02:08:53Z","body":"Chad Woolley [commented](https://www.pivotaltracker.com/n/projects/966314/stories/86070338/comments/91023620) on Jan 29, 2015, 8.06 PM UTC:\n\n`@pt:sergueif` `@pt:dieu` So, a remaining questions are: \n\n1) why did the nginx upload module in the runtime hand off an (aborted, incomplete) file upload for further processing, rather than just aborting if the client killed the request?  Seems like there's still some inadequate or buggy handling in it.\n\n2) If the client killed the connection due to running out of disk space, why didn't we see nginx error log contain the same sort of \"client closed prematurely connection\" message we saw when the connection was killed manually during testing?  e.g.:\n```\n2015/01/23 23:30:51 [info] 21245#0: *5454 client closed prematurely connection, client: 10.70.142.10, server: _, request: \"PUT /v2/apps/5b18bd1c-00db-481f-9a43-050e91b36174/bits?async=true HTTP/1.1\", host: \"api.sys.anvil.nonprod.io\"\n2015/01/23 23:30:51 [alert] 21245#0: *5454 aborted uploading file \"application.zip\" to \"/var/vcap/data/cloud_controller_ng/tmp/uploads/0030626552\", dest file removed, client: 10.70.142.10, server: _, request: \"PUT /v2/apps/5b18bd1c-00db-481f-9a43-050e91b36174/bits?async=true HTTP/1.1\", host: \"api.sys.anvil.nonprod.io\"\n```\n\n<!--\nComment Id: 91023620\n-->"}}
{"actor":{"display_login":"cf-tm-bot"}}