Bug 1004213

Summary: REST MOP Import doesn't detect errors on commit
Product: [JBoss] JBoss Enterprise Portal Platform 6 Reporter: Toshiya Kobayashi <tkobayas>
Component: PortalAssignee: Boleslaw Dawidowicz <bdawidow>
Status: VERIFIED --- QA Contact: Tomas Kyjovsky <tkyjovsk>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0.0CC: bdawidow, epp-bugs, jpallich, ppalaga, theute, tkyjovsk
Target Milestone: DR02   
Target Release: 6.1.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: JCR
Fixed In Version: Doc Type: Bug Fix
Doc Text:
If an error occurs during Portal import at the JCR level using a REST call, then the transaction is rolled back and import fails. But it was discovered that REST call responded with the code "200 OK" indicating that import was successful, which is incorrect. The fix in the code returns correct error code "500".
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
throwExOnExoCommit.rule
none
throwExOnExoCommit-fix.rule none

Description Toshiya Kobayashi 2013-09-04 08:23:33 UTC
Description of problem:

Platform BZ for https://issues.jboss.org/browse/GTNPORTAL-3257

Steps to Reproduce:
1. Call REST MOP Import (e.g. curl command in GTNPORTAL-3257)
2. Throw an Exception on JCR commit (e.g. using Byteman)

Actual results:

Transaction is rolled back. But REST response is 200 OK.

Expected results:

Transaction is rolled back. REST response is 500 (or something appropriate?).

Comment 1 Toshiya Kobayashi 2013-09-04 08:29:05 UTC
Created attachment 793543 [details]
throwExOnExoCommit.rule

Comment 2 Toshiya Kobayashi 2013-09-04 08:29:45 UTC
Attached throwExOnExoCommit.rule which I tested with JPP 6.0.0

Comment 5 Toshiya Kobayashi 2013-11-13 05:10:41 UTC
Created attachment 823245 [details]
throwExOnExoCommit-fix.rule

Comment 6 Boleslaw Dawidowicz 2013-11-13 15:12:56 UTC
Looks like fixed in JCR 1.16.x Would require backport to 1.15.x

Comment 7 JBoss JIRA Server 2013-12-03 12:41:25 UTC
Nicolas Filotto <nfilotto> made a comment on jira GTNPORTAL-3257

This issue cannot be fixed as expected so we will simply add an error message in the log file instead. Please refer to https://jira.exoplatform.org/browse/WS-284 and https://jira.exoplatform.org/browse/WS-285 for more details

Comment 8 JBoss JIRA Server 2013-12-06 00:57:08 UTC
Nick Scavelli <nscavell> made a comment on jira GTNPORTAL-3257

Adding a call to ChromatticManager.endRequest during the import should help bring any issues that may surface when the REST container ends the RequestLifecyle. This issue depends on https://jira.exoplatform.org/browse/WS-285 which reverts the commit of https://jira.exoplatform.org/browse/WS-284.

Comment 9 Tomas Kyjovsky 2013-12-12 18:58:25 UTC
I reproduced the issue on DR01 and verified the fix with DR02, using throwExOnExoCommit-fix.rule.

On DR02 I got:

HTTP/1.1 500 Internal Server Error
...
{
   "failure": "Error during import. Tasks successfully rolled back. Portal should be back to consistent state.",
   "operationName": "import-resource"
}

Comment 10 Jared MORGAN 2014-02-11 03:14:47 UTC
Hey Bolek

As this issue has two customer cases attached to it, we should probably have a Known Issue written up for it.

Please reassign to anyone else if they can better create the release note.

Cheers

J

Comment 11 Boleslaw Dawidowicz 2014-02-17 11:56:09 UTC
Adding doc text proposal