Bug 1258247 - [Per host CHAP] Modifying CHAP credentials fails with "Could not find resource for relative"
[Per host CHAP] Modifying CHAP credentials fails with "Could not find resourc...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.6.0
x86_64 Unspecified
unspecified Severity high
: ovirt-3.6.0-rc
: 3.6.0
Assigned To: Tal Nisan
Elad
:
Depends On:
Blocks: 1186812
  Show dependency treegraph
 
Reported: 2015-08-30 09:58 EDT by Elad
Modified: 2016-03-10 07:03 EST (History)
11 users (show)

See Also:
Fixed In Version: 3.6.0-11
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: Storage
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 45520 master MERGED restapi: Remove @Path from storage connection extension implementation Never
oVirt gerrit 45523 ovirt-engine-3.6 MERGED restapi: Remove @Path from storage connection extension implementation Never

  None (edit)
Description Elad 2015-08-30 09:58:59 EDT
Description of problem:
An attempt to modify the CHAP credentials for a specific host via REST API using the storageconnectionextension tag under hosts fails with the following error:


JBWEB000065: HTTP Status 404 - RESTEASY001185: Could not find resource for relative : /hosts/15d9db95-f353-4f3d-a17b-cad598381de6/storageconnectionextensions of full path: https://10.35.161.53/api/hosts/15d9db95-f353-4f3d-a17b-cad598381de6/storageconnectionextensions

JBWEB000309: type JBWEB000067: Status report

JBWEB000068: message RESTEASY001185: Could not find resource for relative : /hosts/15d9db95-f353-4f3d-a17b-cad598381de6/storageconnectionextensions of full path: https://10.35.161.53/api/hosts/15d9db95-f353-4f3d-a17b-cad598381de6/storageconnectionextensions

JBWEB000069: description JBWEB000124: The requested resource is not available.
JBoss Web/7.5.10.Final-redhat-1


Version-Release number of selected component (if applicable):
rhevm-3.6.0-0.12.master.el6.noarch

How reproducible:
Always

Steps to Reproduce:
Storage server with CHAP support
1. Discover and login to a storage server with CHAP credentials
1. Modify the credentials of a specific host in the storage server
2. Modify the credentials in RHEV via REST API as follows:

POST under:

https://engine-add/api/hosts/%host_id%/storageconnectionextensions

<storageconnectionextension>   
 <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c00</target>
    <username>elad</username>
    <password>456456456456</password>
</storageconnectionextension>



Actual results:
Modification fails with the mentioned exception appears only in the response body. No indication for the failure in engine log.
In server log all I got is:

2015-08-30 13:29:17,050 INFO  [org.apache.commons.httpclient.HttpMethodBase] (org.ovirt.thread.pool-7-thread-48) Response content length is not known



Expected results:
CHAP modification for a specific host should work

Additional info:
sosreport from engine:
http://file.tlv.redhat.com/ebenahar/sosreport-elad-rhevm3.scl.lab.tlv.redhat.com-20150830135444.tar.xz
Comment 1 Tal Nisan 2015-08-30 10:01:00 EDT
Juan, from checking the setup it seems that the relative link to the extensions appears under the host but once you try to GET it it ends with a 404, on master it works correctly, any idea why?
Comment 2 Juan Hernández 2015-08-31 04:57:25 EDT
This happens because the version of Resteasy included in JBoss EAP doesn't like the fact that the resource implementation for connection extensions contains an incorrect @Path annotation, it must be removed.
Comment 3 Juan Hernández 2015-08-31 04:58:29 EDT
Tal, please take the bug or assign it to someone in your team, so that it will be backported to the 3.6 branch. I already verified that the proposed fix solves the problem both in the master branch and in the 3.6 branch.
Comment 4 Juan Hernández 2015-08-31 05:07:49 EDT
By the way, the instructions to reproduce that appear in the description of the bug aren't correct: the XML tag should be "storage_connection_extension", not "storageconnectionextension". I used a the following script to reproduce:

---8<---
#!/bin/sh -ex

url="https://engine36.example.com/ovirt-engine/api"
user="admin@internal"
password="..."

curl \
--verbose \
--cacert /etc/pki/ovirt-engine/ca.pem \
--user "${user}:${password}" \
--request POST \
--header "Content-Type: application/xml" \
--header "Accept: application/xml" \
--data '
<storage_connection_extension>   
  <target>iqn.2015-06.com.example:mytarget</target>
  <username>foo</username>
  <password>bar</password>
</storage_connection_extension>
' \
"${url}/hosts/6bc0bc71-7201-4fcb-84d8-e5db1397144a/storageconnectionextensions"
--->8---
Comment 5 Tal Nisan 2015-08-31 05:21:28 EDT
I will take it from here, thanks a lot Juan.
Comment 6 Elad 2015-09-22 05:35:59 EDT
Adding a storage connection under storageconnectionextensions for a host now works as expected

Verified using:
rhevm-3.6.0-0.16.master.el6.noarch
rhevm-restapi-3.6.0-0.16.master.el6.noarch
Comment 8 Allon Mureinik 2016-03-10 05:41:23 EST
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE
Comment 9 Allon Mureinik 2016-03-10 05:46:36 EST
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE
Comment 10 Allon Mureinik 2016-03-10 07:03:11 EST
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE

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