Bug 798588

Summary: app will be stopped when moving this app
Product: OKD Reporter: Johnny Liu <jialiu>
Component: PodAssignee: Jhon Honce <jhonce>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 1.x   
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-03-02 21:56:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Johnny Liu 2012-02-29 10:39:41 UTC
Description of problem:


Version-Release number of selected component (if applicable):
rhc-broker-0.87.9-1.el6_2.noarch
rubygem-cloud-sdk-common-0.5.3-1.el6_2.noarch
rubygem-cloud-sdk-node-0.5.6-1.el6_2.noarch
rubygem-cloud-sdk-controller-0.5.9-1.el6_2.noarch


How reproducible:
Always

Steps to Reproduce:
1. Setup multi-node env
2. Create an app
3. Check the status of this app before move
$ rhc-ctl-app -a perltest -c status -p xx

RESULT:
Total Accesses: 2
Total kBytes: 0
Uptime: 2083
ReqPerSec: .000960154
BytesPerSec: 0
BytesPerReq: 0
BusyWorkers: 1
IdleWorkers: 0
Scoreboard: W....

$ curl http://perltest-jialiu.dev.rhcloud.com/
<index page is shown successfully>

4. Move this app from one node to another.
# rhc-admin-move --app_uuid b782dd3c27644b57a493410331de95e3 -i ip-10-80-102-43
URL: http://perltest-jialiu.dev.rhcloud.com
Login: jialiu
App UUID: b782dd3c27644b57a493410331de95e3
DEBUG: Source district uuid: 3216200e09274285af14d44a4b91df75
DEBUG: Destination district uuid: 3216200e09274285af14d44a4b91df75
DEBUG: District unchanged keeping uid
DEBUG: Moving app 'perltest' with uuid b782dd3c27644b57a493410331de95e3 from domU-12-31-39-0A-70-11 to ip-10-80-102-43
DEBUG: Getting existing app 'perltest' status before moving
DEBUG: App 'perltest' was stopped
DEBUG: Not accessing url since application was stopped
DEBUG: Force stopping existing app 'perltest' before moving
DEBUG: Creating new account for app 'perltest' on ip-10-80-102-43
DEBUG: Moving content for app 'perltest' to ip-10-80-102-43
Identity added: /var/www/libra/broker/config/keys/rsync_id_rsa (/var/www/libra/broker/config/keys/rsync_id_rsa)
Agent pid 12321
DEBUG: Performing cartridge level move for 'perltest' on ip-10-80-102-43
DEBUG: Performing cartridge level move for embedded 10gen-mms-agent-0.1 for 'perltest' on ip-10-80-102-43
DEBUG: Performing cartridge level move for embedded rockmongo-1.1 for 'perltest' on ip-10-80-102-43
DEBUG: Performing cartridge level move for embedded mongodb-2.0 for 'perltest' on ip-10-80-102-43
DEBUG: Fixing DNS and s3 for app 'perltest' after move
DEBUG: Changing server identity of 'perltest' from 'domU-12-31-39-0A-70-11' to 'ip-10-80-102-43'
URL: http://perltest-jialiu.dev.rhcloud.com
DEBUG: Deconfiguring old app 'perltest' on domU-12-31-39-0A-70-11 after move
Successfully moved 'perltest' with uuid 'b782dd3c27644b57a493410331de95e3' from 'domU-12-31-39-0A-70-11' to 'ip-10-80-102-43'

5. Check the status of this app again after move

Actual results:
After move, app is stopped.
$ rhc-ctl-app -a perltest -c status -p xx

RESULT:
Application 'perltest' is either stopped or inaccessible

and app's web is not accessible.

Expected results:
After move, app should keep the same status as before.

Additional info:

Comment 1 Jhon Honce 2012-02-29 20:49:49 UTC
commit 1b89626291279683cb8294b88e76fb711064e5d0

lib/util suffered a copy&paste accident. send_stopped_status() returned 'ALREADY_STOPPED' for any existing application without a .state file.

Comment 2 Johnny Liu 2012-03-01 06:35:17 UTC
Re-test this bug with devenv_stage_139, and FAIL.


Before move:
$ rhc-ctl-app -a phptest -c status -p xx

RESULT:
Total Accesses: 2
Total kBytes: 0
Uptime: 2083
ReqPerSec: .000960154
BytesPerSec: 0
BytesPerReq: 0
BusyWorkers: 1
IdleWorkers: 0
Scoreboard: W....


Moving:
# rhc-admin-move  --app_uuid 0c12471b26b54f6396ed40fd88dd7944
URL: http://phptest-jialiu.dev.rhcloud.com
Login: jialiu
App UUID: 0c12471b26b54f6396ed40fd88dd7944
DEBUG: Destination container: domU-12-31-39-0F-8A-52
DEBUG: Source district uuid: 22f87c9801a4456e89f831a6d84b5ff2
DEBUG: Destination district uuid: 22f87c9801a4456e89f831a6d84b5ff2
DEBUG: District unchanged keeping uid
DEBUG: Moving app 'phptest' with uuid 0c12471b26b54f6396ed40fd88dd7944 from ip-10-111-5-15 to domU-12-31-39-0F-8A-52
DEBUG: Getting existing app 'phptest' status before moving
DEBUG: App 'phptest' was stopped
DEBUG: Not accessing url since application was stopped
DEBUG: Force stopping existing app 'phptest' before moving
DEBUG: Creating new account for app 'phptest' on domU-12-31-39-0F-8A-52
DEBUG: Moving content for app 'phptest' to domU-12-31-39-0F-8A-52
Identity added: /var/www/libra/broker/config/keys/rsync_id_rsa (/var/www/libra/broker/config/keys/rsync_id_rsa)
Warning: Permanently added '10.111.5.15' (RSA) to the list of known hosts.
Agent pid 8218
DEBUG: Performing cartridge level move for 'phptest' on domU-12-31-39-0F-8A-52
DEBUG: Fixing DNS and s3 for app 'phptest' after move
DEBUG: Changing server identity of 'phptest' from 'ip-10-111-5-15' to 'domU-12-31-39-0F-8A-52'
URL: http://phptest-jialiu.dev.rhcloud.com
DEBUG: Deconfiguring old app 'phptest' on ip-10-111-5-15 after move
Successfully moved 'phptest' with uuid '0c12471b26b54f6396ed40fd88dd7944' from 'ip-10-111-5-15' to 'domU-12-31-39-0F-8A-52'


After moving:

$ rhc-ctl-app -a phptest -c status -p xx

RESULT:
Application 'phptest' is either stopped or inaccessible

Comment 3 Jhon Honce 2012-03-01 15:50:04 UTC
Fix for BZ798867 should have resolved this.

Comment 4 Johnny Liu 2012-03-02 02:57:33 UTC
Verified this bug with devenv_stage_141, and PASS.