Bug 1044225

Summary: Newlines are stripped in error messages returned by cartridge control script
Product: OpenShift Online Reporter: Clayton Coleman <ccoleman>
Component: ImageAssignee: Dan McPherson <dmcphers>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.xCC: bmeng, dmcphers, xtian
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: 2014-01-30 00:53:39 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 Clayton Coleman 2013-12-17 22:58:42 UTC
When running:

  rhc create-app cdk https://cdk-claytondev.rhcloud.com/manifest/failure_output

the broker returns:

{"api_version":1.5,"data":null,"messages":[{"exit_code":157,"field":null,"index":null,"severity":"error","text":"Stderr outputDeliberate failureCLIENT_ERROR: Stderr output"}],"status":"unprocessable_entity","supported_api_versions":[1.0,1.1,1.2,1.3,1.4,1.5,1.6],"type":null,"version":"1.5"}

The actual output in the cart control script is:

  echo "Deliberate failure" 
  echo "Stderr output" 2>&1

There should be newlines between each failure - and CLIENT_ERROR shouldn't even be in the message (it should have been separated out or not duplicated).

Comment 1 Lili Nader 2014-01-07 00:49:51 UTC
A line break is required at the end of each error message in order to be parsed correctly by broker.

I recommend a re-factoring of the node to broker messaging and error handling.  Please see  https://trello.com/c/VCHIrBlh

Comment 2 Dan McPherson 2014-01-16 19:41:48 UTC
https://github.com/openshift/origin-server/pull/4497

It now outputs:

Creating application 'cdk' ... 
Stderr output
Deliberate failure
Stderr output


The duplicate message is because it fails for both post-configure and deconfigure.

Comment 4 Meng Bo 2014-01-17 11:29:00 UTC
# rhc create-app cdk1 https://cdk-claytondev.rhcloud.com/manifest/failure_output
The cartridge 'https://cdk-claytondev.rhcloud.com/manifest/failure_output' will be downloaded and installed

Application Options
-------------------
Domain:     bmengdev
Cartridges: https://cdk-claytondev.rhcloud.com/manifest/failure_output
Gear Size:  default
Scaling:    no

Creating application 'cdk1' ... 
Stderr output
Deliberate failure
Stderr output


Issue has been fixed on devenv_4236.