Bug 1405774

Summary: Access to action status doesn't work, returns HTTP 404
Product: [oVirt] ovirt-engine Reporter: Juan Hernández <juan.hernandez>
Component: RestAPIAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.0.6.1CC: bugs, juan.hernandez, lsvaty, mgoldboi, mperina, oourfali, s.kieske, vtunka
Target Milestone: ovirt-4.1.0-rcFlags: rule-engine: ovirt-4.1+
mgoldboi: planning_ack+
juan.hernandez: devel_ack+
pstehlik: testing_ack+
Target Release: 4.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-01 14:45:57 UTC 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:

Description Juan Hernández 2016-12-18 11:28:35 UTC
The API provides a mechanism to get the status of actions. For example, when a template is imported it returns a response like this:

  <action href="/ovirt-engine/api/storagedomains/123/templates/456/import/789">
    ...
  </action>

The user can then use the provided 'href' to get the status of the action.

Those links to action aren't currently working, they return 404 HTTP error messages.

Apparently this is an issue in the application server, as this used to work with JBoss 7.1.1 but doesn't work with WildFly 10.1.0.

The implementation of the action resource uses the following code:

  @Path("{action: (import|register)}/{oid}")
  ActionResource getActionResource(@PathParam("action") String action, @PathParam("oid") String oid) {
    ...
  }

But apparently the application server isn't handling correctly the parenthesis within the path template.

Note that this also affects version 3.6 of the engine, as it also uses WildFly (version 8).

Comment 1 Juan Hernández 2016-12-19 18:35:36 UTC
If we want to fix this without waiting for a new release of Resteasy/WildFly, we need to apply the following patches:

  https://gerrit.ovirt.org/#/q/topic:RESTEASY-1569

Comment 2 Juan Hernández 2016-12-22 20:22:33 UTC
In the linked Resteasy issue Bartosz Spyrko-Śmietanko is suggesting that using non-capturing groups works correctly. I verified that it does, and adapted the proposed patches. They are now much more simple: just one line.

Comment 3 Oved Ourfali 2017-01-24 08:09:47 UTC
Juan - is that "modified"? Anything missing and pending any review?

Comment 4 Juan Hernández 2017-01-24 08:48:46 UTC
It is missing the backport to 4.0.7. I am working on that.

Comment 5 Juan Hernández 2017-01-24 14:00:38 UTC
Moving to 4.1 and MODIFIED, as 4.0.7 won't be released.

Comment 6 Petr Matyáš 2017-01-31 12:21:44 UTC
Verified on 4.1.0-9