Bug 1042891

Summary: Unable to perform a snapshot save after a snapshot save and deploy has occurred with binary deployment
Product: OpenShift Online Reporter: Chris Ryan <cryan>
Component: ContainersAssignee: Andy Goldstein <agoldste>
Status: CLOSED NOTABUG QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.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: 2013-12-13 15:40:48 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:

Description Chris Ryan 2013-12-13 14:59:51 UTC
Description of problem:
After a snapshot save (with --deployment) option has been deployed on an app with binary deploy configured, I am unable to save a normal snapshot (without the --deploy option)

Version-Release number of selected component (if applicable):
devenv_4133 (ami-8fcbe4e6)

How reproducible:
Always

Steps to Reproduce:
1. Create a php-5.3 app
rhc create-app p2 php-5.3
2. Configure binary deployments
rhc app configure --deployment-type binary -a p2
3. Perform a snapshot save using the --deployment flag
rhc snapshot save -a p2 -f app.tar.gz --deployment
4. Perform a deployment using this snapshot
rhc app deploy --ref app.tar.gz -a p2
5. Gunzip this snapshot
gunzip app.tar.gz
6. Attempt to deploy this incorrect snapshot:
rhc app deploy --ref app.tar -a p2
7. Attempt to save another snapshot, **without** the deploy flags
rhc snapshot save -a p2 -f wrong.tar.gz

Actual results:
The snapshot save errors out with the following stack trace:

$rhc snapshot save -a p2 -f wrong.tar.gz
Password: ******
Pulling down a snapshot to wrong.tar.gz...
Creating and sending tar.gz
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:1284:in `block in do_control_with_directory': Failed to execute: 'control start' for /var/lib/openshift/52ab1e932eb5c976f7000563/php (OpenShift::Runtime::Utils::ShellExecutionException)
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:1085:in `process_cartridges'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:1247:in `do_control_with_directory'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:1107:in `do_control'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:1469:in `start_cartridge'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:1408:in `block in start_gear'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:80:in `block in each_cartridge'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:1091:in `block in process_cartridges'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:1089:in `each'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:1089:in `process_cartridges'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:78:in `each_cartridge'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:1403:in `start_gear'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/v2_cart_model.rb:1412:in `start_gear'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/application_container.rb:443:in `start_gear'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.1/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:92:in `snapshot'
	from /usr/bin/gear:557:in `block (2 levels) in <main>'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:155:in `run'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/runner.rb:385:in `run_active_command'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/runner.rb:62:in `run!'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/delegates.rb:11:in `run!'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/import.rb:10:in `block in <top (required)>'
Error in trying to save snapshot. You can try to save manually by running:
ssh 52ab1e932eb5c976f7000563.rhcloud.com 'snapshot' > wrong.tar.gz

Expected results:
The snapshot should be saved successfully

Additional info:

Comment 1 Chris Ryan 2013-12-13 15:06:46 UTC
Note: if you perform the first snapshot, immediately followed by the second snapshot, this will work. The incorrect deployment in between (of the malformed app.tar file) will trigger the second snapshot save to fail.

Comment 2 Chris Ryan 2013-12-13 15:40:48 UTC
I'll implement a check on the rhc side of the house to verify that the file is, in fact, a .tar.gz.