luci / luci-py

LUCI in python
Apache License 2.0
78 stars 35 forks source link

swarming client: Should bubble up error message to stdout #282

Open mithro opened 7 years ago

mithro commented 7 years ago

Take the following cmd line where I have forgotten to add a -d pool Chrome value;

$ python tools/swarming_client/swarming.py run --hard-timeout=86400 --io-timeout=86400 --user=tansell@chromium.org -d os Ubuntu   -d gpu none   -S https://chromium-swarm-dev.appspot.com   -I https://isolateserver.appspot.com   out/Release/webkit_layout_tests.isolated   -- --verbose  --platform=linux --isolated-script-test-output "\${ISOLATED_OUTDIR}/out.json"
Sending the report ... done.
Report URL: https://chromium-swarm-dev.appspot.com/restricted/ereporter2/errors/5825642811621376
Failed to trigger task webkit_layout_tests/gpu=none_os=Ubuntu/529ce04b984370ecb0e9d3fa88807ed5db696ece
Sending the report ... done.
Report URL: https://chromium-swarm-dev.appspot.com/restricted/ereporter2/errors/5827890287476736
Failed to trigger the task.

The reported error links don't provide any useful information, but if I add a -v to the command line, I get the following;

$ python tools/swarming_client/swarming.py run -v --hard-timeout=86400 --io-timeout=86400 --user=tansell@chromium.org -d os Ubuntu   -d gpu none   -S https://chromium-swarm-dev.appspot.com   -I https://isolateserver.appspot.com   out/Release/webkit_layout_tests.isolated   -- --verbose  --platform=linux --isolated-script-test-output "\${ISOLATED_OUTDIR}/out.json"                    
26095 2016-11-15 07:20:32.098 I: Starting new HTTPS connection (1): chromium-swarm-dev.appspot.com
26095 2016-11-15 07:20:32.918 I: Refreshing access_token
26095 2016-11-15 07:20:33.755 I: OAuth access_token refreshed. Expires in 0:59:59.997618.
26095 2016-11-15 07:20:33.760 I: Starting new HTTPS connection (1): chromium-swarm-dev.appspot.com
26095 2016-11-15 07:20:34.488 I: Logged in to https://chromium-swarm-dev.appspot.com: tansell@google.com
26095 2016-11-15 07:20:34.491 I: Starting new HTTPS connection (1): isolateserver.appspot.com
26095 2016-11-15 07:20:35.301 I: Refreshing access_token
26095 2016-11-15 07:20:35.994 I: OAuth access_token refreshed. Expires in 0:59:59.997765.
26095 2016-11-15 07:20:35.999 I: Starting new HTTPS connection (1): isolateserver.appspot.com
26095 2016-11-15 07:20:36.670 I: Logged in to https://isolateserver.appspot.com: tansell@google.com
26095 2016-11-15 07:20:36.673 I: Triggering: webkit_layout_tests/gpu=none_os=Ubuntu/529ce04b984370ecb0e9d3fa88807ed5db696ece
26095 2016-11-15 07:20:36.979 W: Able to connect to https://chromium-swarm-dev.appspot.com/api/swarming/v1/tasks/new but an exception was thrown.
400 Client Error: Bad Request for url: https://chromium-swarm-dev.appspot.com/api/swarming/v1/tasks/new
----------
X-google-appengine-version: 2477-12edff7
Content-length: 83
X-google-shellfish-status: CA0gBEBJ
X-google-gfe-response-code-details-trace: response_code_set_by_backend
Access-control-allow-methods: DELETE, GET, OPTIONS, POST, PUT
X-google-appengine-module: default
X-google-appengine-appid: s~chromium-swarm-dev
X-cloud-trace-context: eed79e2ead3edf5c67fd8680699617cd
X-google-gfe-backend-request-info: eid=RLcqWILvLubMjATzhJjoBA
Alt-svc: quic=":443"; ma=2592000; v="36,35,34"
X-google-gfe-service-trace: apphosting
X-google-netmon-label: /bns/jd/borg/jd/bns/apphosting/prod-appengine.edge.frontend/490
Cache-control: no-cache
X-google-backends: /bns/in/borg/in/bns/apphosting/prod-appengine.appserver/181,infa205.prod.google.com:4499,/bns/jd/borg/jd/bns/apphosting/prod-appengine.edge.frontend/490,acsfob13:443
Date: Tue, 15 Nov 2016 07:20:36 GMT
Access-control-allow-origin: *
Access-control-allow-headers: Origin, Authorization, Content-Type, Accept
X-google-gfe-request-trace: acsfob13:443,/bns/jd/borg/jd/bns/apphosting/prod-appengine.edge.frontend/490,acsfob13:443
X-google-dos-service-trace: main:apphosting
X-google-service: apphosting
Server: Google Frontend
X-google-gfe-cloud-project-number: 20770472288
Content-type: application/json; charset=utf-8

{"error": {"message": "At least one of 'id' or 'pool' must be used as dimensions"}}
----------
Sending the report ...26095 2016-11-15 07:20:36.984 I: Starting new HTTPS connection (1): chromium-swarm-dev.appspot.com
 done.
Report URL: https://chromium-swarm-dev.appspot.com/restricted/ereporter2/errors/5851643469889536
Failed to trigger task webkit_layout_tests/gpu=none_os=Ubuntu/529ce04b984370ecb0e9d3fa88807ed5db696ece
Sending the report ... done.
Report URL: https://chromium-swarm-dev.appspot.com/restricted/ereporter2/errors/5861013075263488
Failed to trigger the task.

The useful error information is shown (highlighted below);

{"error": {"message": "At least one of 'id' or 'pool' must be used as dimensions"}}
maruel commented 7 years ago

It's because of the way net.py swallows error code. Paging @vadimsht