Bug 1080381 - Fail to restart app with cartridge (perl, ruby, python) after force-stop it
Summary: Fail to restart app with cartridge (perl, ruby, python) after force-stop it
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Michal Fojtik
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-25 10:18 UTC by Qixuan Wang
Modified: 2015-05-15 00:40 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-24 21:36:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
development log (70.07 KB, text/plain)
2014-03-25 10:36 UTC, Qixuan Wang
no flags Details
platform log (184.67 KB, text/plain)
2014-03-25 10:36 UTC, Qixuan Wang
no flags Details
mcollective log (73.33 KB, text/plain)
2014-03-25 10:37 UTC, Qixuan Wang
no flags Details

Description Qixuan Wang 2014-03-25 10:18:51 UTC
Description of problem:
Create an app, force stop it and then the app can't be restarted. The issue can be reproduced on non-scale or scale app with cartridge perl-5.10, ruby-1.9, python-2.6, python-2.7, python-2.8.

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

How reproducible:
Always

Steps to Reproduce:
1. create an app with cartridge(perl-5.10, ruby-1.9, python-2.6, 2.7, 2.8)
   # rhc app create perl510 perl-5.10
2. force- stop the app
   # rhc app force-stop perl510
3. restart it
   # rhc app restart perl510

Actual results:
[root@dhcp-65-16 qwang]# rhc app force-stop perl510
RESULT:
perl510 force stopped
[root@dhcp-65-16 qwang]# rhc app restart perl510
Failed to execute: 'control restart' for
/var/lib/openshift/533150f587b853d763000001/perl


Expected results:
App should be restarted

Additional info:
php-5.3, nodejs-0.6, nodejs-0.10 is ok.

Comment 1 Qixuan Wang 2014-03-25 10:36:13 UTC
Created attachment 878378 [details]
development log

Comment 2 Qixuan Wang 2014-03-25 10:36:48 UTC
Created attachment 878379 [details]
platform log

Comment 3 Qixuan Wang 2014-03-25 10:37:44 UTC
Created attachment 878380 [details]
mcollective log

Comment 4 Lei Zhang 2014-03-25 11:37:48 UTC
Test on devenv_4570, 

Failed to restore snapshot after force-stop app

Step:
1. force-stop app
2. do restore snapshot

[lijun@ray Work]$ rhc snapshot restore -a myphp53 -f myphp53.tar.gz 
Restoring from snapshot myphp53.tar.gz...
Removing old git repo: ~/git/myphp53.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/myphp53.git and ~/app-root/data
Error in trying to restore snapshot. You can try to restore manually by running:
cat 'myphp53.tar.gz' | ssh 53315d8e87b85301db0004d1.rhcloud.com 'restore INCLUDE_GIT'

Comment 5 Michal Fojtik 2014-03-25 17:31:04 UTC
(In reply to Lei Zhang from comment #4)
> Test on devenv_4570, 
> 
> Failed to restore snapshot after force-stop app
> 
> Step:
> 1. force-stop app
> 2. do restore snapshot
> 
> [lijun@ray Work]$ rhc snapshot restore -a myphp53 -f myphp53.tar.gz 
> Restoring from snapshot myphp53.tar.gz...
> Removing old git repo: ~/git/myphp53.git/
> Removing old data dir: ~/app-root/data/*
> Restoring ~/git/myphp53.git and ~/app-root/data
> Error in trying to restore snapshot. You can try to restore manually by
> running:
> cat 'myphp53.tar.gz' | ssh
> 53315d8e87b85301db0004d1.rhcloud.com 'restore INCLUDE_GIT'

Can you please open a separe bug for this issue?

Comment 6 chunchen 2014-03-26 04:16:09 UTC
The issue also can be reproduced on INT(devenv_4574).

Comment 7 Michal Fojtik 2014-03-26 10:15:28 UTC
The fix for original problem is here:

https://github.com/openshift/origin-server/pull/5073

(should be merged in a moment. i'm looking on the snapshot issue now).

Comment 8 Michal Fojtik 2014-03-26 10:33:42 UTC
Lei Zhang:

The snapshot/restore is unrelated to this bug. I tried to debug it a bit and I found that when you do restore via 'rhc', it fails with return code 255:

DEBUG:    code 200  210 ms
Restoring from snapshot myphp53.tar.gz...
DEBUG: cat 'myphp53.tar.gz' | ssh 5332a91a9cd2dc6dba000001.rhcloud.com 'restore INCLUDE_GIT'
Removing old git repo: ~/git/myphp53.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/myphp53.git and ~/app-root/data
DEBUG: Activating deployment
Starting PHP 5.3 cartridge (Apache+mod_php)
Application directory "/" selected as DocumentRoot
return: 0 # <- this is from the end of control#start
Error in trying to restore snapshot. You can try to restore manually by running:
cat 'myphp53.tar.gz' | ssh 5332a91a9cd2dc6dba000001.rhcloud.com 'restore INCLUDE_GIT'

If you do:

cat 'myphp53.tar.gz' | ssh 5332a91a9cd2dc6dba000001.rhcloud.com 'restore INCLUDE_GIT'

then the app is restored and started, however the return code in shell is 255 for some reason... So far I don't have any good answer for this. Also, the rhc restore should preserve the state of the gear (force-stopped) and do not attempt to start it... in any case, we should move this to a new bug.

Comment 9 openshift-github-bot 2014-03-26 10:56:52 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/d379990619948b102facd9c518b5ca738953cc2e
Bug 1080381 - Fixed problem with httpd based carts restart after force-stop

Comment 10 Michal Fojtik 2014-03-26 12:49:58 UTC
Another interesting bit about the restore:

 ~/tmp → cat 'myphp53.tar.gz' | ssh 5332a91a9cd2dc6dba000001.rhcloud.com 'restore INCLUDE_GIT'
Removing old git repo: ~/git/myphp53.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/myphp53.git and ~/app-root/data
Activating deployment
Starting PHP 5.3 cartridge (Apache+mod_php)
Application directory "/" selected as DocumentRoot
 ~/tmp → echo $?
255

I think this is the primary cause of the error message rhc is giving us.

Comment 11 Michal Fojtik 2014-03-26 13:45:17 UTC
The restore bug was moved here:

https://bugzilla.redhat.com/show_bug.cgi?id=1081020

Comment 12 Qixuan Wang 2014-03-27 03:54:38 UTC
Test on devenv_4586:

Verified on python, ruby, perl(non-scale or scale), it works, thanks.

[root@qwang 20140327]# rhc app force-stop perl510
RESULT:
perl510 force stopped
[root@qwang 20140327]# rhc app restart perl510
RESULT:
perl510 restarted


[root@qwang 20140327]# rhc app force-stop perl510s
RESULT:
perl510s force stopped
[root@qwang 20140327]# rhc app restart perl510s
RESULT:
perl510s restarted


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