Bug 1122589

Summary: Create user API fails in SDK & CLI - HTTP 400 Request syntactically incorrect
Product: [Retired] oVirt Reporter: Nelly Credi <ncredi>
Component: ovirt-engine-sdkAssignee: Ravi Nori <rnori>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Stehlik <pstehlik>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.5CC: bazulay, ecohen, gklein, iheim, juan.hernandez, mishka8520, ncredi, oourfali, rbalakri, rnori, yeylon
Target Milestone: ---Keywords: AutomationBlocker, Regression
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: Infra
Fixed In Version: ovirt-engine-sdk-python-3.5.0.4-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-17 12:43:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 1073943    

Description Nelly Credi 2014-07-23 14:40:36 UTC
Description of problem:

Create user fails with error HTTP 400 Request syntactically incorrect

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

How reproducible:


Steps to Reproduce:
1.add user  --domain-name 'XXX' --user_name 'XXX' --expect '201-created'

Actual results:
  ========================================================================================= ERROR ======================================================================================
  status: 400
  reason: Bad Request
  detail: 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><usage_message><message>Request syntactically incorrect. See the link description below for the correct usage:</message></usage_message>
  ======================================================================================================================================================================================



Expected results:
User should be created

Additional info:

Comment 1 Barak 2014-07-27 11:31:14 UTC
Does it work using the API itself ? (not sdk cli)

Comment 2 Nelly Credi 2014-07-27 15:42:43 UTC
It works with REST

Comment 3 Michael Pasternak 2014-08-04 14:27:49 UTC
(In reply to Nelly Credi from comment #0)
> Description of problem:
> 
> Create user fails with error HTTP 400 Request syntactically incorrect
> 
> Version-Release number of selected component (if applicable):
> 3.5
> 
> How reproducible:
> 
> 
> Steps to Reproduce:
> 1.add user  --domain-name 'XXX' --user_name 'XXX' --expect '201-created'
> 
> Actual results:
>  
> =============================================================================
> ============ ERROR
> =============================================================================
> =========
>   status: 400
>   reason: Bad Request
>   detail: 
> <?xml version="1.0" encoding="UTF-8"
> standalone="yes"?><usage_message><message>Request syntactically incorrect.
> See the link description below for the correct
> usage:</message></usage_message>
>  
> =============================================================================
> =============================================================================
> ============================
> 
> 
> 
> Expected results:
> User should be created
> 
> Additional info:

Nelly,

Could you please run sdk/cli in debug mode [1] and attach the printed output,
also please consider always attaching debug data to bugs (it helps us a lot).

thanks.

[1]

- sdk: add debug=true to constructor
- cli: run cli with -debug flag

Comment 4 Nelly Credi 2014-08-06 05:51:31 UTC
[oVirt shell (connected)]# add user  --domain-name 'qa.lab.tlv.redhat.com' --user_name 'xxx@qa.lab.tlv.redhat.com' --expect '201-created'
send: 'POST /api/users HTTP/1.1\r\nHost: dhcp163-100.scl.lab.tlv.redhat.com\r\nAccept-Encoding: identity\r\nContent-Length: 143\r\nPrefer: persistent-auth\r\nAccept: application/xml\r\nFilter: False\r\ncookie: JSESSIONID=Zrn9Q-cZJ0wOBAk+IKsf6MKT.undefined\r\nExpect: 201-created\r\nX-Ovirt-Expect: 201-created\r\nContent-type: application/xml\r\n\r\n'
send: '<owner>\n    <domain>\n        <name>qa.lab.tlv.redhat.com</name>\n    </domain>\n    <user_name>xxx@qa.lab.tlv.redhat.com</user_name>\n</owner>\n'
reply: 'HTTP/1.1 400 Bad Request\r\n'
header: Date: Wed, 06 Aug 2014 05:47:57 GMT
header: JSESSIONID: Zrn9Q-cZJ0wOBAk+IKsf6MKT.undefined
header: Content-Type: application/xml
header: Content-Length: 191
header: Vary: Accept-Encoding
header: Connection: close
  ============================================== ERROR ============================================
  status: 400
  reason: Bad Request
  detail: 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><usage_message><message>Request syntactically incorrect. See the link description below for the correct usage:</message></usage_message>
  =================================================================================================

[oVirt shell (connected)]#

Comment 5 Oved Ourfali 2014-08-06 10:14:21 UTC
Ravi / Michael - the patch is now merged.
Does that require a new manual build for the CLI/SDK as well?

Comment 6 Ravi Nori 2014-08-06 12:52:14 UTC
We need to rebuild the sdk

Comment 7 Michael Pasternak 2014-08-06 18:09:08 UTC
(In reply to Ravi Nori from comment #6)
> We need to rebuild the sdk

Ravi,

Though you did that not once and aware of procedure, please notice that
Juan changed a bit codegen execution flow, he has pretty good explanations
on how it should be done in README (it should be pretty straightforward)

Comment 8 Oved Ourfali 2014-08-07 12:12:31 UTC
Ravi - please port to ovirt-engine-3.5 branch

Comment 9 Ravi Nori 2014-08-08 01:20:19 UTC
*** Bug 1125161 has been marked as a duplicate of this bug. ***

Comment 10 Juan Hernández 2014-08-20 07:49:20 UTC
*** Bug 1122591 has been marked as a duplicate of this bug. ***

Comment 11 Nelly Credi 2014-08-24 11:56:39 UTC
verified in ovirt-3.5.0_rc1.1

Comment 12 Sandro Bonazzola 2014-10-17 12:43:59 UTC
oVirt 3.5 has been released and should include the fix for this issue.