Bug 865268

Summary: Can not get correct cartridge status via rest api
Product: OKD Reporter: Rony Gong 🔥 <qgong>
Component: MasterAssignee: Lili Nader <lnader>
Status: CLOSED NOTABUG QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: ccoleman, mfisher
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-11 14:26:53 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-10-11 05:46:24 UTC
Description of problem:
It shows idle in file  db_gear_uuid/app-root/runtime/.state,  but  rhc cartridge status -a qsjbosseap -c postgresql  shows it's running 
This errror happened for all cartridge like haproxy-1.4,mongodb and mysql

And from rhc app show qsjbosseap --state , show  postgresq is idle 
OpenShiftmatoMacBook-Pro:rhc root# rhc app show qsjbosseap --state 
Password: 
RESULT:
Geargroup jbosseap-6.0 is started
Geargroup jbosseap-6.0+haproxy-1.4 is started
Geargroup postgresql-8.4 is idle

Version-Release number of selected component (if applicable):
devenv_2311
client(build from fork_ami_US2597_US2599_US2813_US2817_US2872_US2816_US2814_226)

How reproducible:
always

Steps to Reproduce:
1.Create scalable app and embed db(postgresql)
2.idle the db by ssh instance with root: rhc-idler -u gear_uuid
3.rhc cartridge status -a qsjbosseap -c postgresql
  
Actual results:
curl -k -H "Accept: application/json" --user "qgong:123456"  https://ec2-50-19-57-158.compute-1.amazonaws.com/broker/rest/domains/qgong6/applications/qsjbosseap/cartridges/postgresql-8.4?include=status_messages| python -mjson.tool
        "status_messages": [
            {
                "gear_id": "37aacc5613a04dc292d56712a3f9aadb", 
                "message": "PostgreSQL server instance is running\n"
            }
        ], 

OpenShiftmatoMacBook-Pro:rhc root# rhc cartridge status -a qsjbosseap -c postgresql
Password: 
RESULT:
PostgreSQL server instance is running

but ssh instance and, cat /var/lib/openshift/db_gear_uuid/app-root/runtime/.stat, it is idle

Expected results:
RESULT:
PostgreSQL server instance is idle

Additional info:

Comment 1 Clayton Coleman 2012-10-11 14:26:53 UTC
Cartridge status is not the same thing as idle gear.  "Status" means a message from the service on the cart.  Idle is a gear state, which means "Shut down elements of this item".

So a gear can be idle at the same time postgresql is running.