Bug 1044225 - Newlines are stripped in error messages returned by cartridge control script
Summary: Newlines are stripped in error messages returned by cartridge control script
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Dan McPherson
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-17 22:58 UTC by Clayton Coleman
Modified: 2015-05-15 00:36 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-30 00:53:39 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.