Bug 1033768

Summary: The application is not started after deploying an invalid binary file by artifact_url
Product: OpenShift Container Platform Reporter: Brenton Leanhardt <bleanhar>
Component: ImageStreamsAssignee: Luke Meyer <lmeyer>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.0.0CC: agoldste, chunchen, dmace, gpei, lmeyer
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-openshift-origin-node-1.17.5.3-1 rubygem-openshift-origin-msg-broker-mcollective-1.17.4-1 openshift-origin-msg-node-mcollective-1.17.5-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1032906 Environment:
Last Closed: 2014-01-17 16:20:40 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: 1032906    
Bug Blocks:    

Description Brenton Leanhardt 2013-11-22 20:14:15 UTC
+++ This bug was initially created as a clone of Bug #1032906 +++

Description of problem:
The application will be stopped after deploying  an invalid binary file by artifact_url

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

How reproducible:
always

Steps to Reproduce:
1. Create an app
rhc app create cphp00 php-5.3
2. Configure deployment type to binary
curl -k -H "Accept: application/xml" --user "chunchen:redhat7" https://ec2-23-22-121-187.compute-1.amazonaws.com/broker/rest/application/528dbe7ae55e7539ba00013e -X PUT -d deployment_type=binary
3. Deploy an invalid binary file to this app by artifact_url,the http://cphp-ccyd.rhcloud.com/cp1.tar.gz indeed is a ASCII text format file
curl -k -H "Accept: application/xml" --user "chunchen:redhat7" https://ec2-23-22-121-187.compute-1.amazonaws.com/broker/rest/application/528dbe7ae55e7539ba00013e/deployments -X POST -d artifact_url=http://cphp-ccyd.rhcloud.com/cp1.tar.gz
4. Check the status of this app
rhc app show cphp00 --state

Actual results:
at step 3:
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>created</status>
  <type>deployment</type>
  <data>
    <deployment>
      <created-at>2013-11-21T03:58:41Z</created-at>
      <hot-deploy>false</hot-deploy>
      <force-clean-build>false</force-clean-build>
      <ref>master</ref>
      <sha1 nil="true"></sha1>
      <id>b525ae05</id>
      <activations>
        <activation>2013-11-21T03:58:45Z</activation>
      </activations>
    </deployment>
  </data>
  <messages>
    <message>
      <severity>info</severity>
      <text>Added b525ae05 to application cphp00</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>
  <version>1.6</version>
  <api-version>1.6</api-version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
    <supported-api-version>1.4</supported-api-version>
    <supported-api-version>1.5</supported-api-version>
    <supported-api-version>1.6</supported-api-version>
  </supported-api-versions>
</response>

at step 4: Cartridge php-5.3 is stopped

Expected results:
1. deploy should be failed and response some messages like "Invalid Binary Artifact URL(<url>)".
2. the app should be started.

Additional info:

--- Additional comment from Dan Mace on 2013-11-22 12:49:48 EST ---

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

Fixed the error reporting. The state of the application is not something we can  control in this case due to the deployments/builds being non-transactional (as a design decision). Moving this ON_QA for the improved error handling; we'll need to discuss whether to treat the transaction issue as a bug or an RFE.

--- Additional comment from openshift-github-bot on 2013-11-22 12:59:09 EST ---

Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/70fc1810e4cb781543466d79905206392513e6aa
Bug 1032906: Fix generic error handling in Openshift agent

Comment 2 Luke Meyer 2013-12-23 16:44:00 UTC
Next build of rubygem-openshift-origin-node and the mcollective plugins.

commit 70fc1810e4cb781543466d79905206392513e6aa
Author: Dan Mace <ironcladlou>
Date:   Thu Nov 21 11:04:39 2013 -0500

    Bug 1032906: Fix generic error handling in Openshift agent


https://github.com/openshift/enterprise-server/pull/175

Comment 3 Gaoyun Pei 2013-12-25 05:30:31 UTC
Verify this bug with rubygem-openshift-origin-node-1.17.5.3-1 rubygem-openshift-origin-msg-broker-mcollective-1.17.4-1.

After deploying the app with an invaild binary file by artifact_url, it exits with error message. 
Try to deploy something valid to the app, then the app become started.