Bug 869226 - Got error when add cartridge to scalable app or scale it up after setting its min gear size to "16".
Got error when add cartridge to scalable app or scale it up after setting it...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Master (Show other bugs)
2.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Rajat Chopra
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-23 06:27 EDT by Mengjiao Gao
Modified: 2015-05-14 20:52 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-06 13:49:43 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
The error page when add cartridge in step 5. (123.07 KB, image/png)
2012-10-23 06:27 EDT, Mengjiao Gao
no flags Details
error page when add cartridges in step 6. (167.87 KB, image/png)
2012-10-23 06:29 EDT, Mengjiao Gao
no flags Details
The app detail page after step 6. (179.92 KB, image/png)
2012-10-23 06:30 EDT, Mengjiao Gao
no flags Details

  None (edit)
Description Mengjiao Gao 2012-10-23 06:27:14 EDT
Created attachment 632017 [details]
The error page when add cartridge in step 5.

Description of problem:
If I created a scalable app, and directely changed its min gear size as 16, I would get error when I tried to add cartridge to it or scaled up it.

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

How reproducible:
always

Steps to Reproduce:
1.Go to website and login.
2.Update the account to MegaShift
3.Created a scalable app used CLI :
   $rhc app create -s -a s490 -t php-5.3 -p redhat -l mgao+dev22@redhat.com -p redhat
4.Set its minimum gear size as 16.
5.Try to add cartridge to it.
6.Try to add cartridge again.
6.Try to scale up it use REST API:
    curl -k -X POST -H 'Accept: application/xml' -d event=scale-up --user mgao+dev22@redhat.com:redhat https://ec2-107-22-93-180.compute-1.amazonaws.com/broker/rest/domains/do1122/applications/s490/events


Actual results:
Error page in step 5 is shown as attachment #1 [details], and cartridges cannot be added successfully.
In Step 6, the cartridge still cannot added, but the error message said that:"You have reached the maximum allowed gears and cannot create another. You must scale down an application or remove an application or cartridge to continue." as attachment #2 [details] shown.
But I have checked the app detail page, the gear number in this page shown is "2" as attachment #3 [details] shown . 
Error message in step 7 as below:
**********************************************************************
  <messages>
    <message>
      <exit-code>104</exit-code>
      <severity>error</severity>
      <field nil="true"></field>
      <text>mgao+dev22@redhat.com has a gear limit of 16 and this app requires 13 more gears. Check the 'scales_from' limit of all cartridges of the app?</text>
    </message>
  </messages>
**********************************************************************


Expected results:
The cartridge should added successfully in step 5, and with this operation, the gear number of the app should be "16".

Additional info:
I think we should change a little in the scale your app page.User should not set the min gear size bigger than the app's real gear number.
Or when user set its min gear size bigger than the app's real gear number, the broker should scale up the app automaticly.
Comment 1 Mengjiao Gao 2012-10-23 06:29:08 EDT
Created attachment 632018 [details]
error page when add cartridges in step 6.
Comment 2 Mengjiao Gao 2012-10-23 06:30:02 EDT
Created attachment 632019 [details]
The app detail page after step 6.
Comment 3 Rajat Chopra 2012-10-29 12:53:08 EDT
Fixed with rev#9232307bf7cd12783692552d3aad33ae2c023d84
Comment 4 Rajat Chopra 2012-10-29 12:56:22 EDT
Yes, we want to have the broker scale up the app automatically, but that is not done yet and will be part of some user story in the future.

As of this fix, an appropriate message will guide the user about whats going on with gear additions and limits.
Comment 5 Mengjiao Gao 2012-10-30 02:17:10 EDT
Tested this issue on devenv_2403.
    Firstly, I set a scalable app's min gear size bigger than its available gear number. 
    Then I tried to add cartridge to the app, and I would get error message as this :"You have reached the maximum allowed gears and cannot create another. You must scale down an application or remove an application or cartridge to continue.".
    And when I tried to scale up it with RESTAPI, I will get message as below:
"
  <messages>
    <message>
      <text>rr has a gear limit of 19 and this app requires 3 more gears. Check the 'scales_from' limit of all cartridges of the app?</text>
      <field nil="true"></field>
      <severity>error</severity>
      <exit-code>104</exit-code>
    </message>
  </messages>
"

Since I think this are appropriate messages for user, so  I will put this issue to verified. Looking forward your later improvement to scale up the app automatically, thanks!

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