Bug 803190 - Should give friendly error message while scaling down an scalable app which only has 2 gears
Should give friendly error message while scaling down an scalable app which o...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Pod (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Rajat Chopra
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-14 03:31 EDT by jizhao
Modified: 2015-05-14 21:48 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-03-19 14:23:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description jizhao 2012-03-14 03:31:21 EDT
Description of problem:
Create an scalable app and scale it down manually. The server threw out an exception but didn't handle it.

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


How reproducible:
Always

Steps to Reproduce:
1.Create a scalable app using REST API
$ curl -k -H "Accept: application/xml" --user "<user>:<pass>"  https://localhost/broker/rest/domains/<domain_name>/applications -X POST -d name=<appname> -d cartridge=php-5.3 -d scale=true
2.Scale the app down
$ curl -k -H "Accept: application/xml" --user "<user>:<pass>"  https://localhost/broker/rest/domains/<user>/applications/<appname>/events -X POST -d event=scale-down
3.
  
Actual results:
<--------output------------>
............
  NoMethodError
    in AppEventsController#create
</h1>
<pre>undefined method `code' for #&lt;Exception: Cannot scale below one gear&gt;</pre>


<p><code>Rails.root: /var/www/stickshift/broker</code></p>

<div id="traces">
    <a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
    <a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
    <a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a> 

    <div id="Application-Trace" style="display: block;">
      <pre><code></code></pre>
    </div>
    <div id="Framework-Trace" style="display: none;">
      <pre><code>stickshift-controller (0.6.8) lib/stickshift-controller/app/controllers/app_events_controller.rb:69:in `create'
actionpack (3.0.10) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.10) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.10) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.10) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.10) lib/abstract_controller/callbacks.rb:18:in `process_action'
activesupport (3.0.10) lib/active_support/callbacks.rb:436:in `_run__561805178__process_action__885441822__callbacks'
activesupport (3.0.10) lib/active_support/callbacks.rb:410:in `send'
activesupport (3.0.10) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
activesupport (3.0.10) lib/active_support/callbacks.rb:94:in `send'
activesupport (3.0.10) lib/active_support/callbacks.rb:94:in `run_callbacks'
actionpack (3.0.10) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.10) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.0.10) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
activesupport (3.0.10) lib/active_support/notifications.rb:52:in `instrument'
activesupport (3.0.10) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.10) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.10) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.0.10) lib/abstract_controller/base.rb:119:in `process'
actionpack (3.0.10) lib/abstract_controller/rendering.rb:41:in `process'
actionpack (3.0.10) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.10) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.10) lib/action_controller/metal.rb:178:in `action'
actionpack (3.0.10) lib/action_dispatch/routing/route_set.rb:62:in `call'
actionpack (3.0.10) lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
actionpack (3.0.10) lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.13) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:82:in `optimized_each'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.13) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.10) lib/action_dispatch/routing/route_set.rb:493:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.1.0) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/cookies.rb:302:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/callbacks.rb:46:in `call'
activesupport (3.0.10) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.10) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.1.0) lib/rack/sendfile.rb:105:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.10) lib/rails/rack/logger.rb:13:in `call'
rack (1.1.0) lib/rack/runtime.rb:17:in `call'
rack (1.1.0) lib/rack/lock.rb:11:in `call'
rack (1.1.0) lib/rack/lock.rb:11:in `synchronize'
rack (1.1.0) lib/rack/lock.rb:11:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.10) lib/rails/application.rb:168:in `call'
railties (3.0.10) lib/rails/application.rb:77:in `send'
railties (3.0.10) lib/rails/application.rb:77:in `method_missing'
passenger (3.0.4) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.4) lib/phusion_passenger/abstract_request_handler.rb:514:in `accept_and_process_next_request'
passenger (3.0.4) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.4) lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler'
passenger (3.0.4) lib/phusion_passenger/rack/application_spawner.rb:78:in `spawn_application'
passenger (3.0.4) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.4) lib/phusion_passenger/rack/application_spawner.rb:63:in `spawn_application'
passenger (3.0.4) lib/phusion_passenger/spawn_manager.rb:264:in `spawn_rack_application'
passenger (3.0.4) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
passenger (3.0.4) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.4) helper-scripts/passenger-spawn-server:102</code></pre>
    </div>
    <div id="Full-Trace" style="display: none;">
      <pre><code>stickshift-controller (0.6.8) lib/stickshift-controller/app/controllers/app_events_controller.rb:69:in `create'
actionpack (3.0.10) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.10) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.10) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.10) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.10) lib/abstract_controller/callbacks.rb:18:in `process_action'
activesupport (3.0.10) lib/active_support/callbacks.rb:436:in `_run__561805178__process_action__885441822__callbacks'
activesupport (3.0.10) lib/active_support/callbacks.rb:410:in `send'
activesupport (3.0.10) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
activesupport (3.0.10) lib/active_support/callbacks.rb:94:in `send'
activesupport (3.0.10) lib/active_support/callbacks.rb:94:in `run_callbacks'
actionpack (3.0.10) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.10) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.0.10) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
activesupport (3.0.10) lib/active_support/notifications.rb:52:in `instrument'
activesupport (3.0.10) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.10) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.10) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.0.10) lib/abstract_controller/base.rb:119:in `process'
actionpack (3.0.10) lib/abstract_controller/rendering.rb:41:in `process'
actionpack (3.0.10) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.10) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.10) lib/action_controller/metal.rb:178:in `action'
actionpack (3.0.10) lib/action_dispatch/routing/route_set.rb:62:in `call'
actionpack (3.0.10) lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
actionpack (3.0.10) lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.13) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:82:in `optimized_each'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.13) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.10) lib/action_dispatch/routing/route_set.rb:493:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.1.0) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/cookies.rb:302:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/callbacks.rb:46:in `call'
activesupport (3.0.10) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.10) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.1.0) lib/rack/sendfile.rb:105:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.10) lib/rails/rack/logger.rb:13:in `call'
rack (1.1.0) lib/rack/runtime.rb:17:in `call'
rack (1.1.0) lib/rack/lock.rb:11:in `call'
rack (1.1.0) lib/rack/lock.rb:11:in `synchronize'
rack (1.1.0) lib/rack/lock.rb:11:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.10) lib/rails/application.rb:168:in `call'
railties (3.0.10) lib/rails/application.rb:77:in `send'
railties (3.0.10) lib/rails/application.rb:77:in `method_missing'
passenger (3.0.4) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.4) lib/phusion_passenger/abstract_request_handler.rb:514:in `accept_and_process_next_request'
passenger (3.0.4) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.4) lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler'
passenger (3.0.4) lib/phusion_passenger/rack/application_spawner.rb:78:in `spawn_application'
passenger (3.0.4) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.4) lib/phusion_passenger/rack/application_spawner.rb:63:in `spawn_application'
passenger (3.0.4) lib/phusion_passenger/spawn_manager.rb:264:in `spawn_rack_application'
passenger (3.0.4) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
passenger (3.0.4) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.4) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.4) helper-scripts/passenger-spawn-server:102</code></pre>
    </div>
</div>
........
<-------------------------->

Expected results:
Should give friendly error message.

Additional info:
Comment 1 Rajat Chopra 2012-03-14 17:14:12 EDT
Improved error message. Rev# ccd0034aee5b919e26f8f7bb4115eeb4e8f268d3
Comment 2 jizhao 2012-03-15 04:44:41 EDT
Verified on devenv_1662.

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