Bug 872123 - Stopped app's ~/app-root/runtime/.state file changed from "stopped" to "started" after git push
Stopped app's ~/app-root/runtime/.state file changed from "stopped" to "start...
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Jhon Honce
libra bugs
: FutureFeature, Regression
Depends On:
  Show dependency treegraph
Reported: 2012-11-01 06:29 EDT by Meng Bo
Modified: 2015-05-14 19:01 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-04-16 12:16:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Meng Bo 2012-11-01 06:29:06 EDT
Description of problem:
Create app and stop the app via rhc client. Do some changes in the git repo and push it to the server. Check the status of the app from client side, it will say:
"Geargroup <cart> is started". 

Login to the app via ssh can found the service for the framework is not running.
Access the app URL via browser, got 503 error.

So the app status is actually STOPPED but the .state file changed after git push.

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

How reproducible:

Steps to Reproduce:
1.Create app
2.Stop the app
3.Do some change iin the git repo and git push
4.Check the app status via rhc client

Actual results:
Geargroup jbossas-7 is started

Expected results:
It should show the Geargroup is stopped.

Additional info:

[bmeng@localhost openshift_testdir]$ rhc app stop jbas1

jbas1 stopped
[bmeng@localhost jbas1]$ touch 123;git add .;git commit -am test;git push
[master d589bdd] test
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 1234
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 239 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: restart_on_add=false
remote: Application is already stopped
remote: Done
remote: restart_on_add=false
remote: ~/git/jbas1.git ~/git/jbas1.git
remote: ~/git/jbas1.git
remote: Running .openshift/action_hooks/pre_build
remote: Running .openshift/action_hooks/build
remote: Running .openshift/action_hooks/deploy
remote: hot_deploy_added=false
remote: Application is explicitly stopped!  Use 'rhc app start -a jbossas-7' to start back up.
remote: Done
remote: Running .openshift/action_hooks/post_deploy
To ssh://ca3edacc01bc49e790e927d2d0d075c5@jbas1-bmengint.int.rhcloud.com/~/git/jbas1.git/
   4ba63c7..d589bdd  master -> master

[bmeng@localhost jbas1] rhc app show --state jbas1

Geargroup jbossas-7 is started
Comment 1 Dan Mace 2012-11-01 12:09:24 EDT
Reducing priority for this release. The bug still exists in production (but takes a slightly different form: the state is incorrect post-build, but is stuck in "deploying" rather than "started").

The problem in the current master branch is in the stop_app function in the abstract cart util:


The function does an unconditional "set_app_state started" which doesn't honor any stop_lock which might be present in the gear's cart directories. Unfortunately, this hook is invoked from the abstract start_app.sh script which doesn't provide enough context to easily check the locks, meaning it'll take too much time and testing to sort out this late in the release.

So, given the fact that it's not a regression, and that the fix is non-trivial, we're going to lower the priority for now and tackle it in the next release.
Comment 2 Rony Gong 2012-11-08 03:07:39 EST
Also faild for set app idle first, then gitpush to this app.
After gitpush, app is idle actuall, but app status show app is started.
Comment 3 Dan Mace 2012-11-29 14:51:01 EST
Resolved by https://github.com/openshift/origin-server/pull/992
Comment 4 Meng Bo 2012-12-02 21:56:45 EST
Checked on devenv_2547, issue has been fixed.

Make app stopped or idle before git push, do some change and push it, check the app status again. The status is still keeping idle or stopped. Check the .state file under $OPENSHIFT_REPO_DIR/runtime, it is still keeping idle or stopped.

Mark bug as VERIFIED.
Comment 5 Jhon Honce 2013-01-16 19:12:15 EST
Fix broke 'rhc app start...' 

Fix reverted in https://github.com/openshift/origin-server/pull/1157

No easy solution to problem.
Comment 6 Jhon Honce 2013-01-31 11:25:30 EST
The issue is the code from git push and rhc start use the same function, one requires the state to change while the other does not. The cartridge refactor will not create the same problem.
Comment 7 manoj 2013-02-11 11:21:28 EST

Can this be fixed before the cartridge refactor?
Comment 8 Jhon Honce 2013-02-12 00:35:05 EST
The issue is the code from git push and rhc start use the same function, one requires the state to change while the other does not. The cartridge refactor will not create the same problem.
Comment 9 Mike McGrath 2013-04-16 12:12:16 EDT
Note: This is being worked on in v2 and will likely not be valid after that.
Comment 10 Jhon Honce 2013-04-16 12:16:31 EDT
Fixed in new cartridge format

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