Red Hat Bugzilla – Bug 872123
Stopped app's ~/app-root/runtime/.state file changed from "stopped" to "started" after git push
Last modified: 2015-05-14 19:01:34 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):
Steps to Reproduce:
2.Stop the app
3.Do some change iin the git repo and git push
4.Check the app status via rhc client
Geargroup jbossas-7 is started
It should show the Geargroup is stopped.
[bmeng@localhost openshift_testdir]$ rhc app stop jbas1
[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: Application is already stopped
remote: ~/git/jbas1.git ~/git/jbas1.git
remote: Running .openshift/action_hooks/pre_build
remote: Running .openshift/action_hooks/build
remote: Running .openshift/action_hooks/deploy
remote: Application is explicitly stopped! Use 'rhc app start -a jbossas-7' to start back up.
remote: Running .openshift/action_hooks/post_deploy
4ba63c7..d589bdd master -> master
[bmeng@localhost jbas1] rhc app show --state jbas1
Geargroup jbossas-7 is started
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.
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.
Resolved by https://github.com/openshift/origin-server/pull/992
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.
Fix broke 'rhc app start...'
Fix reverted in https://github.com/openshift/origin-server/pull/1157
No easy solution to problem.
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.
Can this be fixed before the cartridge refactor?
Note: This is being worked on in v2 and will likely not be valid after that.
Fixed in new cartridge format