Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 910092

Summary: [RESTAPI] Search by name when creating object don't work in user level API.
Product: Red Hat Enterprise Virtualization Manager Reporter: Ondra Machacek <omachace>
Component: ovirt-engine-restapiAssignee: Oved Ourfali <oourfali>
Status: CLOSED CURRENTRELEASE QA Contact: Ondra Machacek <omachace>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.2.0CC: acathrow, amureini, dyasny, iheim, mpastern, oramraz, pstehlik, Rhev-m-bugs, ykaul, yzaslavs
Target Milestone: ---   
Target Release: 3.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: sf9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 917401    

Description Ondra Machacek 2013-02-11 19:10:38 UTC
Description of problem:


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

How reproducible:
always

Steps to Reproduce:
1. Add user with DiskCreator to SD.
2. Create disk as user via user API by specifing SD name, not id


Expected results:
Disk is created.

Actual results:
$curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -H "Filter: $filter" \
    -u $PU2 -d "<disk><storage_domains><storage_domain><name>sd</name></storage_domain></storage_domains><provisioned_size>1048576</provisioned_size><interface>virtio</interface><format>cow</format></disk>" \
    https://url/api/disks

<html><head><title>JBoss Web/7.0.16..Final-redhat-1 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException
	org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:340)
	org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214)
	org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190)
	org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:540)
	org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502)
	org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
	org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
	org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
	org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
</pre></p><p><b>root cause</b> <pre>java.lang.NullPointerException
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the JBoss Web/7.0.16..Final-redhat-1 logs.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/7.0.16..Final-redhat-1</h3></body></html>

Additional info:
Problem is also for creating template by specifieng vm name:

curl -k -X POST -H "Accept: application/xml" -H "Content-Type: application/xml"  -H "Filter: $filter"\
    -d "<template><name>temp</name><vm><name>vm</name></vm></template>" \
    -u $U https://url:443/api/templates/

<fault>
    <reason>Operation Failed</reason>
    <detail>query execution failed due to insufficient permissions.</detail>
</fault>

Comment 1 Oved Ourfali 2013-02-21 15:48:51 UTC
Ondra - Please open a separate bug on the second issue. It has nothing to do with the first one.

Comment 4 Itamar Heim 2013-06-11 08:41:33 UTC
3.2 has been released

Comment 5 Itamar Heim 2013-06-11 08:41:33 UTC
3.2 has been released

Comment 6 Itamar Heim 2013-06-11 08:41:35 UTC
3.2 has been released

Comment 7 Itamar Heim 2013-06-11 08:48:55 UTC
3.2 has been released