Bug 835157 - haproxy_ctld doesn't handle errors nicely
haproxy_ctld doesn't handle errors nicely
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Rob Millner
libra bugs
: Triaged
Depends On:
Blocks: 835205
  Show dependency treegraph
Reported: 2012-06-25 13:30 EDT by Dan McPherson
Modified: 2015-05-14 18:55 EDT (History)
3 users (show)

See Also:
Fixed In Version: cartridge-haproxy-1.4-0.12.1+
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-07-13 19:43:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dan McPherson 2012-06-25 13:30:16 EDT
Description of problem:

When running a scale up from the node.  If an errors occurs (like no gears left).  You get an error like:

[danmcp640-danmcp640.dev.rhcloud.com ~]\> haproxy_ctld -u
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/abstract_response.rb:48:in `return!': 422 Unprocessable Entity (RestClient::UnprocessableEntity)
	from /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:220:in `process_result'
	from /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:169:in `transmit'
	from /usr/lib/ruby/1.8/net/http.rb:543:in `start'
	from /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:166:in `transmit'
	from /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:60:in `execute'
	from /usr/libexec/stickshift/cartridges/embedded/haproxy-1.4/info/bin/add-gear:45:in `initialize'
	from /usr/libexec/stickshift/cartridges/embedded/haproxy-1.4/info/bin/add-gear:170:in `new'
	from /usr/libexec/stickshift/cartridges/embedded/haproxy-1.4/info/bin/add-gear:170

This error is thrown from request.execute but the error thrown from the rest api describes what actually happened.  In this case gear limit exceeded.  The more useful should be shown from haproxy_ctld -u

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create an app and a scaled app (to use up all 3 gears)
2. ssh to the scaled add and run haproxy_ctld -u
Actual results:
You'll see the error like above

Expected results:
You should see the message from the broker saying consumed gears are all used up

Additional info:
Comment 1 Rob Millner 2012-06-28 18:11:55 EDT
Raising pri/sev to match the bug it blocks.
Comment 2 Rob Millner 2012-06-29 21:09:06 EDT
Crankcase pull request #169.
Comment 3 Rob Millner 2012-07-02 14:15:23 EDT
Pull request accepted.
Comment 4 Rony Gong 2012-07-02 23:04:21 EDT
Retest on devenv_1870 with cartridge-haproxy-1.4-0.12.3-1.el6_3.noarch

case 1(max_gear=3, consumed=3):
[qsphp-qgong3.dev.rhcloud.com ~]\> haproxy_ctld -u
[qsphp-qgong3.dev.rhcloud.com ~]\> haproxy_ctld -u

case 2(max_gear=3, consumed=2):
[qsphp-qgong3.dev.rhcloud.com ~]\> haproxy_ctld -u
[qsphp-qgong3.dev.rhcloud.com ~]\> haproxy_ctld -u

I think there are no response message for whether could scale up success isn't well enough, it should show response message correspond.
Comment 5 Rob Millner 2012-07-03 21:14:34 EDT
[rmtest-rmillner0187.dev.rhcloud.com ~]\> haproxy_ctld -u
[rmtest-rmillner0187.dev.rhcloud.com ~]\> haproxy_ctld -u
Already at the maximum number of gears allowed for either the app or your account.

[rmtest-rmillner0187.dev.rhcloud.com ~]\> haproxy_ctld -d
[rmtest-rmillner0187.dev.rhcloud.com ~]\> haproxy_ctld -d
Cannot remove gear because min limit '1' reached.

Crankcase pull request #177.
Comment 6 Rob Millner 2012-07-09 14:08:11 EDT
Pull request merged.
Comment 7 joycezhang 2012-07-10 04:46:46 EDT
This bug has been verified with devenv_1882, rhc-0.95.11 on Fedora 17. It works well with friendly message pop up. So ths bug is fixed. It can be closed. Thanks.

Include following verified results for the reference:
[php0-mydm2.dev.rhcloud.com ~]\> haproxy_ctld -u
Already at the maximum number of gears allowed for either the app or your account.
[php0-mydm2.dev.rhcloud.com ~]\> haproxy_ctld -d
Cannot remove gear because min limit '1' reached.

Note You need to log in before you can comment on or make changes to this bug.