Bug 913217 - "remote: Failed to stop jbossews-1.0" error
Summary: "remote: Failed to stop jbossews-1.0" error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Bill DeCoste
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-20 16:37 UTC by Sumana Annam
Modified: 2015-05-14 23:05 UTC (History)
5 users (show)

Fixed In Version: https://github.com/openshift/origin-server/pull/1461
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-15 14:21:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sumana Annam 2013-02-20 16:37:32 UTC
Description of problem:

https://openshift.redhat.com/community/forums/openshift/git-push-error#comment-27693

git push to server results in the following:

MacBook-Pro:life office$ git push
Warning: Permanently added the RSA host key for IP address '0.0.0.18' to the list of known hosts.
Counting objects: 22, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 6.06 KiB, done.
Total 12 (delta 6), reused 0 (delta 0)
remote: restart_on_add=false
remote: Sending SIGTERM to jboss:25193 25933 ...
remote: kill -9 25193
remote: /usr/libexec/openshift/cartridges/jbossews-1.0/info/bin/app_ctl_impl.sh: line 34: kill: (25193) - No such process
remote: Failed to stop jbossews-1.0
To ssh://a69b7ca3069b46329eba7572c1704b23.com/~/git/life.git/
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://a69b7ca3069b46329eba7572c1704b23.com/~/git/life.git/'
MacBook-Pro:life office$

SSH into app gear and ctl_all restart also results in error:

[life-tony1016.rhcloud.com ~]\> ctl_app restart                              
Sending SIGTERM to jboss:25193 25933 ...
kill -9 25193
/usr/libexec/openshift/cartridges/jbossews-1.0/info/bin/app_ctl_impl.sh: line 34: kill: (25193) - No such process


To get user up and running, the following had to be done:

ssh into your app gear, cd into jbossews-1.0/run, remove the pid file and run ctl_all restart. 

Not sure what led to this but definitely not nice.


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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Paul Morie 2013-02-20 22:30:20 UTC
I wasn't able to reproduce this.  Please re-open if it happens again.

Comment 2 Mike McGrath 2013-02-21 14:26:05 UTC
Took me a bit but I've got the special sauce.

step 1) do as above

step 2) ctl_app stop

step 3) confirm jboss.pid still exists and has pids in it

step 4) run ctl_app stop again

confirm it exits with 141 (instead of 0)

Then log out, make a git edit, then git push.  The git push will be rejected because it can't stop the app.

I think this is one of those things where the stop should be silently failing if the app is already stopped.

Comment 3 Paul Morie 2013-02-21 18:19:46 UTC
I wasn't able to reproduce this again today.  Here's my shell from following Mike's steps:


[jtest-pmorie101.dev.rhcloud.com ~]\> ctl_app stop
Sending SIGTERM to jboss:9418 ...
kill -TERM 9613
kill -TERM 9418
[jtest-pmorie101.dev.rhcloud.com ~]\> ls jbosseap-6.0/run/jboss.pid 
jbosseap-6.0/run/jboss.pid
[jtest-pmorie101.dev.rhcloud.com ~]\> ctl_app stop
Application is already stopped
[jtest-pmorie101.dev.rhcloud.com ~]\> echo $?
0

As you can see, ctl_app exited with 0 instead of 141.  After that:

$ cd jtest; echo 'foo' >> README; git commit -am 'test'; git push; cd -
[master b9190ae] test
 1 file changed, 1 insertion(+)
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 282 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: restart_on_add=false
remote: Application is already stopped
remote: Done
remote: restart_on_add=false

Comment 4 Mike McGrath 2013-02-21 18:34:09 UTC
Ok, so I'm not quite sure how this would happen naturally but you can see the behavior if you replace jboss.pid with some other running pid like your bash pid.

I was in a scenario earlier where my app was completely wedged, I couldn't stop it, start it, git push, anything.  might be as simple as a ||: on the kill command but we should still verify after the kill that it's not running.

Comment 5 Paul Morie 2013-02-21 20:55:36 UTC
Bill, could you take a look on this one?  There's noise being added being added due to the policy change hosted is still waiting for.  It doesn't look like the jboss pid file is ever deleted by any hook or script in the abstract-jboss or specific jboss cart.

Comment 6 Bill DeCoste 2013-02-24 16:44:03 UTC
This ties into https://bugzilla.redhat.com/show_bug.cgi?id=884684. I think the stop logic for all of the JBoss apps should be:

1) Attempt to shutdown gracefully
2) If 1) does not not stop the process after some timeout then we should kill -9 the process.

The tomcat6 and tomcat7 scripts are not removing the pid file (neither are the AS/EAP scripts).

Comment 7 Bill DeCoste 2013-02-27 00:42:51 UTC
'ctl_app stop' doesn't create the stop_lock file since it doesn't call the stop hook which creates the file. This is different than 'rhc app stop' which goes through the stop hook and creates the stop_lock file. A git push will start the app if it was stopped with ctl_app but not if it was stopped with rhc.

Comment 8 Bill DeCoste 2013-02-27 00:58:21 UTC
Fixed PID logic

Comment 10 Wei Sun 2013-03-01 06:54:16 UTC
After bug 912215 is verified ,we'll verify this bug

Comment 11 Meng Bo 2013-03-04 12:02:38 UTC
Checked on devenv_2890,

1. Create jbossews app
2. ctl_app stop
3. ctl_app stop again
4. Modify git repo and push

[master 4e5d950] test
 0 files changed
 create mode 100644 123
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 241 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: restart_on_add=false
remote: Application(16231) is already stopped
remote: Done
remote: restart_on_add=false
remote: Running .openshift/action_hooks/pre_build


It will judge the app stopped or not from the pid.

Mark bug as VERIFIED.


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