cloud_controller_ng: app update fails when app package is in a failed state

Issue

Update of an app (V2 API) with a failed package fails.

PUT /v2/apps/411589dc-6592-4428-94af-5ff82ec61123 HTTP/1.1
...
{
  "disk_quota": 1024,
  "health_check_type": "port",
  "instances": 1,
  "memory": 32,
  "name": "bigapp",
 }
RESPONSE: [2017-08-30T14:19:27-07:00]
HTTP/1.1 400 Bad Request
...
{
  "description": "The app package is invalid: bits have not been uploaded",
  "error_code": "CF-AppPackageInvalid",
  "code": 150001
}

When only including the “name” attribute, the API call does not return an error.

Context

Full details are here: https://github.com/cloudfoundry/cli/issues/1216

  1. User tries to push big app. App is created but upload fails with The app package is invalid: Package may not be larger than 1073741824 bytes.
  2. User reduces size of app and pushes again. CLI makes above PUT call before uploading the new app bits, but gets the above error response.

Steps to Reproduce

  1. cf push bigapp -p smallerfile.zip (bigfile.zip < 1GB) -> App should start successfully
  2. cf push bigapp -p bigfile.zip (bigfile.zip > 1GB) -> Deploy fails with the following message, but app remains in STARTED state:
Error processing app files: Error uploading application.
The app package is invalid: Package may not be larger than 1073741824 bytes
  1. cf push bigapp -p smallerfile.zip -i 1 -m 32M -s cflinuxfs2 (bigfile.zip < 1GB) -> Update fails with:
diesk@cloud-cf:~$ cf push bigfile -p smallfile.zip -i 1 -m 32M -s cflinuxfs2
Using stack cflinuxfs2...
OK
Updating app bigfile in org dies-test / space dev as admin...
FAILED
Server error, status code: 400, error code: 150001, message: The app package is invalid: bits have not been uploaded

Expected result

cf push bigapp -p smallerfile.zip -i 1 -m 32M -s cflinuxfs2 should not fail. I expected the PUT request to do nothing and just return success as this app’s state was already STARTED (even though package state FAILED), and the specified attributes already had those values.

Current result

After failing to upload my app bits and fixing the issue locally, I cannot simply try again.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 17 (6 by maintainers)

Most upvoted comments

Hi @dkoper,

@lisamcho and I pushed a fix for this issue today. Look for it in a future CAPI release.

Thanks for surfacing this issue!

Annie and @lisamcho