cloudfoundry / buildpackapplifecycle

The bit that takes some bits, mashes them together with other bits, and produces a new bit
Apache License 2.0
18 stars 19 forks source link

BAL emits confusing error if it is unable to download a zip buildpack #24

Closed sesmith177 closed 7 years ago

sesmith177 commented 7 years ago

For example, if the url doesn't exist:

$ cf push myapp -b https://example.com/notarealurl.zip
Creating app myapp in org winc / space winc as admin...
OK

Creating route myapp.baboon.cf-app.com...
OK

Binding myapp.baboon.cf-app.com to myapp...
OK

Uploading myapp...
Uploading app files from: /Volumes/SSD/workspace/wats/assets/nora/NoraPublished
Uploading 21.5K, 23 files
Done uploading
OK

Starting app myapp in org winc / space winc as admin...
Creating container
Successfully created container
Downloading app package...
Downloaded app package (3.6M)
Staging...
Failed to run all supply scripts: Failed to read buildpack directory '/tmp/buildpackdownloads/adcea7bc74dff6aa78bed69055931f75' for buildpack 'https://example.com/notarealurl.zip'
Exit status 225
Staging failed: STG: Exited with status 225
Stopping instance 856d65c7-b851-42d0-8287-c4303c21fb2b
Destroying container
Successfully destroyed container

FAILED
Error restarting application: StagingError

Note that this occurs regardless of whether the stack is Linux or Windows

cf-gitbot commented 7 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/150115460

The labels on this github issue will be updated when the story is started.

sclevine commented 7 years ago

Ben Hale also reports:

If you specify a buildpack not last that doesn't support multi-buildpack you get the following error:

[API/2] OUT Creating build for app with guid da8f8e99-105c-4612-a279-485d167ddb92
[STG/0] OUT Creating container
[STG/0] OUT Successfully created container
[STG/0] OUT Downloading build artifacts cache...
[STG/0] OUT Downloading app package...
[STG/0] OUT Downloaded app package (24M)
[STG/0] ERR Failed to run all supply scripts: fork/exec /tmp/buildpacks/821362ba2f4190f3fff4eaf18b56ff6b/bin/supply: no such file or directory
[STG/0] OUT Exit status 225
[STG/0] OUT Stopping instance efcb2653-efcf-4426-aa4d-bd3b9ac0b9fd
[STG/0] OUT Destroying container
[STG/0] OUT Successfully destroyed container
dgodd commented 7 years ago

@sclevine The error from Ben Hale seems good to me. What do you think should happen?

sclevine commented 7 years ago

See the AC in the associated story.

dgodd commented 7 years ago

Re: @sesmith177 report, it is due to example.com always returning a 200. eg.

pivotal@stega ~/workspace/nodejs-buildpack/fixtures/simple_app (develop) $ cf push aosdhsa -b https://google.com/asodh.zip
Using manifest file /home/pivotal/workspace/nodejs-buildpack/fixtures/simple_app/manifest.yml

Updating app aosdhsa in org pivotal / space integration-dotnet-core-1503000037 as admin...
OK

Uploading aosdhsa...
Uploading app files from: /home/pivotal/workspace/nodejs-buildpack/fixtures/simple_app
Uploading 926B, 3 files
Done uploading               
OK

Starting app aosdhsa in org pivotal / space integration-dotnet-core-1503000037 as admin...
Creating container
Successfully created container
Downloading app package...
Downloaded app package (1017B)
Staging...
Failed to download buildpack 'https://google.com/asodh.zip': Download failed: Status code 404
Exit status 1
Staging failed: Exited with status 1
Destroying container
Successfully destroyed container

FAILED
Error restarting application: StagingError

TIP: use 'cf logs aosdhsa --recent' for more information

which returns a better error

sclevine commented 7 years ago

example.com appear to be an edge case. Closing in favor of: https://www.pivotaltracker.com/story/show/150343156

sesmith177 commented 7 years ago

@sclevine @dgodd We don't see the same behavior:

cf push hwc -b https://google.com/notafile.zip
Updating app hwc in org winc / space winc as admin...
OK

Uploading hwc...
Uploading app files from: /Volumes/SSD/workspace/wats/assets/nora/NoraPublished
Uploading 21.1K, 21 files
Done uploading
OK

Starting app hwc in org winc / space winc as admin...
Creating container
Downloading app package...
Successfully created container
Downloaded app package (786.5K)
Staging...
Failed to run all supply scripts: Failed to read buildpack directory '/tmp/buildpackdownloads/b9b5080bb0142b95f551fdbfbcb682da' for buildpack 'https://google.com/notafile.zip'
Exit status 225
Staging failed: STG: Exited with status 225
Stopping instance 2baf8d96-29eb-4a03-ad16-481d6b70fe00
Destroying container
Successfully destroyed container

FAILED
Error restarting application: StagingError

Our version of Diego has BAL at commit 4b89532.

Also, if we curl the example URL from the first post, we get a 404:

$ curl -v https://example.com/notarealurl.zip
*   Trying 93.184.216.34...
* TCP_NODELAY set
* Connected to example.com (93.184.216.34) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: www.example.org
* Server certificate: DigiCert SHA2 High Assurance Server CA
* Server certificate: DigiCert High Assurance EV Root CA
> GET /notarealurl.zip HTTP/1.1
> Host: example.com
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Cache-Control: max-age=604800
< Content-Type: text/html
< Date: Thu, 17 Aug 2017 20:31:33 GMT
< Expires: Thu, 24 Aug 2017 20:31:33 GMT
< Server: EOS (lax004/280C)
< Vary: Accept-Encoding
< Content-Length: 1270
<

So it doesn't look like example.com always returning 200 is the issue