Bug 833697

Summary: Improper error if reach gear limit
Product: OKD Reporter: Rony Gong 🔥 <qgong>
Component: PodAssignee: Dan McPherson <dmcphers>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 2.xCC: rmillner, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: devenv-stage_219 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-25 18:26:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rony Gong 🔥 2012-06-20 07:17:44 UTC
Description of problem:


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

How reproducible:
always

Steps to Reproduce:
1.my account's maxgears is 3
2.create scalable app  and create jenkins server
3.embed mongdb/mysql to this scalable app.
  
Actual results:
[root@localhost ~]# rhc-ctl-app -a qsphp -e add-mongodb-2.0 -p 111111

Problem reported from server. Response code was 400.

Re-run with -d for more information.



RESULT:

Query condition failed to update application 'qsphp' for 'qgong+2'


Expected results:
should prompt message like the gears/app is limited.


Additional info:

Comment 1 Rob Millner 2012-06-20 18:07:33 UTC
Broker raises a "Query condition failed to update application" internally and returns code 400.

StickShift::MongoDataStore.put_app specifies a condition for updating the application information that includes:

 "_id" => user_id
 "apps.name" => id, 
 "$where" => "(this.consumed_gears + #{ngears}) <= this.max_gears"

It seems like the filter on gear count effectively returns the same error if the application doesn't exist, if mongodb has a temporary hiccup, and if the user has consumed all their gears.  Would this check be better done higher up?

Comment 2 Dan McPherson 2012-06-20 20:10:42 UTC
Fixed for Web and CLI.

Comment 3 Rony Gong 🔥 2012-06-21 02:59:39 UTC
retest on the newest int server(devenv_1860), CLI and Web fixed
[root@localhost ~]# rhc-ctl-app  -a  qsjboss -e add-mysql-5.1
Password: ******

Problem reported from server. Response code was 400.
Re-run with -d for more information.

RESULT:
qgong+2 has already reached the gear limit of 3