Bug 82491 - download-built-product build step should detect 404 errors
Summary: download-built-product build step should detect 404 errors
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks: 82494
  Show dependency treegraph
 
Reported: 2012-03-28 11:31 PDT by Simon Fraser (smfr)
Modified: 2012-03-30 15:30 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.59 KB, patch)
2012-03-28 13:55 PDT, Simon Fraser (smfr)
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2012-03-28 11:31:51 PDT
http://build.webkit.org/builders/SnowLeopard%20Intel%20Release%20%28WebKit2%20Tests%29/builds/19311/steps/download-built-product/logs/stdio

This shows no error, even though the file is missing.

curl -f would spit out an error message:

 76$ $ curl -f --output WebKitBuild/release.zip http://build.webkit.org/archives/mac-snowleopard-x86_64-release/112364.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
Comment 1 Simon Fraser (smfr) 2012-03-28 13:55:02 PDT
Created attachment 134389 [details]
Patch
Comment 2 Ryosuke Niwa 2012-03-28 14:03:52 PDT
Comment on attachment 134389 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=134389&action=review

> Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg:237
> +    command = ["curl", "--fail", "--output", WithProperties("WebKitBuild/%(configuration)s.zip"), WithProperties(c["buildbotURL"] + "archives/%(fullPlatform)s-%(architecture)s-%(configuration)s/%(got_revision)s.zip")]

On my SnowLeopard man curl says:
(HTTP)  Fail silently (no output at all) on server errors. This is mostly done to better enable scripts etc to better deal with failed attempts. In normal cases when a HTTP server fails to deliver
a document, it returns an HTML document stating so (which often also describes why and more). This flag will prevent curl from outputting that and return error 22.

This method is not fail-safe and there are occasions where non-successful response codes will slip through, especially when authentication is involved (response codes 401 and 407).

It seems like the opposite of what we want. Or maybe the man page is wrong?
Comment 3 Simon Fraser (smfr) 2012-03-28 14:08:05 PDT
I think the man page is confused:

smfr$ curl -O  http://www.webkit.org/nonexistant.html
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   214  100   214    0     0  10046      0 --:--:-- --:--:-- --:--:-- 17833
smfr$ echo $?
0
smfr$ curl -O --fail http://www.webkit.org/nonexistant.html
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
smfr$ echo $?
22
Comment 4 Ryosuke Niwa 2012-03-28 14:17:55 PDT
Comment on attachment 134389 [details]
Patch

Okay.
Comment 5 Simon Fraser (smfr) 2012-03-30 15:30:37 PDT
Fixed in r112443. Shown to be working.