Bug 1038129

Summary: Gear is not started after restore when hot_deploy marker is present for all cartridges
Product: OpenShift Online Reporter: Michal Fojtik <mfojtik>
Component: ImageAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.xCC: bmeng, chunchen, jhadvig, lzhang, wzheng, xtian, yadu
Target Milestone: ---Keywords: UpcomingRelease
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1061423 (view as bug list) Environment:
Last Closed: 2014-03-12 03:05:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1061423    

Description Michal Fojtik 2013-12-04 13:33:27 UTC
Description of problem:

When restoring a snapshot of gear with hot_deploy marker present, the gear is not started after successfull restore.
This apply to all cartridges, initially this was found in Zend cartridge, where
the hot_deploy marker is included in the cartridge template.

Steps to Reproduce:

1. rhc app create ruby01 ruby-1.9
2. touch ruby01/.openshift/markers/hot_deploy
3. cd ruby01 && git add -A && git commit -am 'xxx' && git push
4. rhc snapshot save ruby01
5. rhc snapshot restore -a ruby01 -f ruby01.tar.gg
6. rhc cartridge status -a ruby01 -c ruby-1.9

Actual results:

 ~/ruby01 → rhc cartridge status -a ruby01 -c ruby-1.9
RESULT:
Application is either stopped or inaccessible


Expected results:

Application should be started.

Additional info:

14:24 < agoldste> mfojtik: yeah we don't start the cart if the hot deploy marker is present
14:24 < agoldste> mfojtik: in activate()
14:24 < agoldste> which is what restore calls

Comment 1 Michal Fojtik 2013-12-04 13:48:05 UTC
Marking this as not blocker, since this bug was there since 2.0.35 and it seems to be nor regression. Jhon, are you OK with this?

Comment 2 Vojtech Vitek 2013-12-04 13:54:14 UTC
*** Bug 1036513 has been marked as a duplicate of this bug. ***

Comment 3 openshift-github-bot 2013-12-11 14:17:24 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/a568bd63147b15e71ba41734421340eeee8b2b99
Bug 1038129 - Gear is not started after restore when hot_deploy marker is present

Comment 4 Yan Du 2013-12-12 10:20:58 UTC
Test on devenv_4127, 

Issue can't be reproduced, showing correct status after restore.

root@openshift-ubuntu:~# rhc snapshot restore -a r19 -f r19.tar.gz 
Restoring from snapshot r19.tar.gz...
Removing old git repo: ~/git/r19.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/r19.git and ~/app-root/data
Activation status: success

RESULT:
Success
root@openshift-ubuntu:~# rhc cartridge status -a r19 -c ruby-1.9
RESULT:
Application is running

Move to verified.

Comment 5 Lei Zhang 2013-12-18 10:54:17 UTC
This issue still exists on devenv-stage_619

There are my steps
Step 1 enable hot_deploy marker and git push
Step 2 save snapshot 
Step 3 restore snapshot
Step 4 check the statue of gear

[lijun@ray Work]$ rhc cartridge status -a myjbosseap6 -c jbosseap-6
RESULT:
Application is running
[lijun@ray Work]$ rhc snapshot restore -a  myjbosseap6 -f myjbosseap6.tar.gz -d
DEBUG: Using config file /home/lijun/.openshift/express.conf
DEBUG: Git config 'git config --get rhc.app-id' returned ''
DEBUG: Git config 'git config --get rhc.app-name' returned ''
DEBUG: Git config 'git config --get rhc.domain-name' returned ''
DEBUG: Authenticating with RHC::Auth::Token
DEBUG: Connecting to https://ec2-54-221-106-253.compute-1.amazonaws.com/broker/rest/api
DEBUG: Getting all domains
DEBUG: Client supports API versions 1.1, 1.2, 1.3, 1.4, 1.5
DEBUG: Using token authentication
DEBUG: Created new httpclient
DEBUG: Request GET https://ec2-54-221-106-253.compute-1.amazonaws.com/broker/rest/api
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200 1164 ms
DEBUG: Server supports API versions 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6
DEBUG:    Using API version 1.5
DEBUG: Client API version 1.5 is not current. Refetching API
DEBUG: Using token authentication
DEBUG: Request GET https://ec2-54-221-106-253.compute-1.amazonaws.com/broker/rest/api
DEBUG:    code 200  304 ms
DEBUG: Using token authentication
DEBUG: Request GET https://ec2-54-221-106-253.compute-1.amazonaws.com/broker/rest/domains
DEBUG:    code 200  326 ms
DEBUG: Using token authentication
DEBUG: Request GET https://ec2-54-221-106-253.compute-1.amazonaws.com/broker/rest/domains/chunchen/applications/myjbosseap6
DEBUG:    code 200  319 ms
Restoring from snapshot myjbosseap6.tar.gz...
DEBUG: cat 'myjbosseap6.tar.gz' | ssh 52b175f46fe14772bc0004a5.rhcloud.com 'restore INCLUDE_GIT'
Removing old git repo: ~/git/myjbosseap6.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/myjbosseap6.git and ~/app-root/data
Activation status: success

RESULT:
Success
[lijun@ray Work]$ rhc cartridge status -a myjbosseap6 -c jbosseap-6
RESULT:
Application is either stopped or inaccessible

Comment 6 Jakub Hadvig 2014-01-22 14:55:18 UTC
Tried to reproduce devenv_4258.
After restoring the app, the cartridge is running.

Tested on Ruby-1.9 and JBoss7-AS

Comment 7 chunchen 2014-01-23 11:01:07 UTC
It's fixed, verified on devenv_4263, please refer to the following results:

1. rhc app create ceap6 jbosseap-6
2. touch ceap6/.openshift/markers/hot_deploy
3. cd ceap6 && git add -A && git commit -am 'xxx' && git push
4. rhc snapshot save ceap6
5. rhc snapshot restore -a ceap6 -f ceap6.tar.gz
6. rhc cartridge status -a ceap6 -c jbosseap-6

RESULT:
Application is running