Bug 835157 - haproxy_ctld doesn't handle errors nicely
Summary: haproxy_ctld doesn't handle errors nicely
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Rob Millner
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 835205
TreeView+ depends on / blocked
 
Reported: 2012-06-25 17:30 UTC by Dan McPherson
Modified: 2015-05-14 22:55 UTC (History)
3 users (show)

Fixed In Version: cartridge-haproxy-1.4-0.12.1+
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-13 23:43:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dan McPherson 2012-06-25 17:30:16 UTC
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
3. 
  
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 22:11:55 UTC
Raising pri/sev to match the bug it blocks.

Comment 2 Rob Millner 2012-06-30 01:09:06 UTC
Crankcase pull request #169.

Comment 3 Rob Millner 2012-07-02 18:15:23 UTC
Pull request accepted.

Comment 4 Rony Gong 🔥 2012-07-03 03:04:21 UTC
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-04 01:14:34 UTC
[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 18:08:11 UTC
Pull request merged.

Comment 7 joycezhang 2012-07-10 08:46:46 UTC
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.