Bug 1021371 - Met "can't convert Message into Array" when trying to add user with illegal role to a domain
Summary: Met "can't convert Message into Array" when trying to add user with illegal r...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Master
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Lili Nader
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-21 07:52 UTC by Meng Bo
Modified: 2015-05-15 00:55 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-24 03:25:36 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Meng Bo 2013-10-21 07:52:12 UTC
Description of problem:
Add user with non-exist role to a domain via rest api will get following error:

  <messages>
    <message>
      <severity>error</severity>
      <text>Unable to complete the requested operation due to: can't convert Message into Array.
Reference ID: 45eb59c7492b3a1933e9128bd3f07e2f</text>
      <exit-code>1</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>


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

How reproducible:
always

Steps to Reproduce:
1. Create domain with one login
2. Try to add another account to the domain with illegal role via rest api
# curl -k -H 'Accept: application/xml' --user bmeng:123123 https://localhost/broker/rest/domain/bmengdev/members -XPATCH -d login=bmeng1 -d role=test
3.

Actual results:
<text>Unable to complete the requested operation due to: can't convert Message into Array.
Reference ID: 45eb59c7492b3a1933e9128bd3f07e2f</text>

Expected results:
Should return the meaningful error message.

Additional info:
It is ok when using rhc:

$ rhc member-add bmeng3 -n bmengdev -r test
invalid option: -r  The provided role 'test' is not valid. Supported values: view, edit, admin

Comment 3 Meng Bo 2013-10-23 05:24:29 UTC
Checked on devenv_3932, issue has been fixed.

  <messages>
    <message>
      <severity>error</severity>
      <text>You must provide a role for each member - you can add or update (with 'view', 'edit', 'admin') or remove (with 'none').</text>
      <exit-code>1</exit-code>
      <field>role</field>
      <index>0</index>
    </message>
  </messages>


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