[PUBLISHING-116] Exception root cause is lost when publishing fails for a new page Created: 29/Apr/21  Updated: 19/Jul/22  Resolved: 08/Jun/21

Status: Closed
Project: Publishing
Component/s: None
Affects Version/s: 1.1.8, 1.2.5
Fix Version/s: 1.1.10, 1.2.7

Type: Bug Priority: Neutral
Reporter: Boris Faniuk Assignee: Oanh Thai Hoang
Resolution: Fixed Votes: 0
Labels: VN-Implementation, maintenance
Remaining Estimate: 0d
Time Spent: 2.5h
Original Estimate: Not Specified

Issue Links:
Relates
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Epic Link: Nucleus Quality Maintenance
Sprint: Maintenance 61
Story Points: 1
Team: Nucleus

 Description   

Steps to reproduce

  1. Create a new page with Basic Template
  2. Create HTML component and insert UTF-16 symbol (e.g. this one)
  3. Try to publish the page

Actual behavior

  1. Publisher can only see very common message
    Publishing failed, please contact your system administrator to help you resolve the issue.
    
  2. Log message on public instance gives no additional information

Expected behavior

  1. Log message shows the exception root cause smth like
    javax.jcr.InvalidSerializedDataException: XML parse error
    ...
    Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 4047; Character reference "&#55357" is an invalid XML character.
    ...
    

Development Notes

  1. Exception is "eaten" on this line
  2. In the same class in other use-case exception is not eaten, see this line


 Comments   
Comment by Jürgen Brömmer [ 01/Jun/21 ]

Hi, 

customer is asking if it would be possible that this message also reaches the editor (not only hidden in the log) - would that be possible?

Thanks for considering

Jürgen

Comment by Richard Gange [ 01/Jun/21 ]

Yes, it should be possible.

Here we can see one of the issues. The only way to see the error is if debug was enabled. It should be changed to something like this:

        } catch (Exception e) {
            log.debug("Publishing failed: " + e.getMessage(), e);
            throw new OperationExecutionException(i18n.translate("publishing-receiver.publish.failed"), e.getMessage());
        }

where e.getMessage() is passed into the new exception.

In the case of the customer it's easy because the exception occurs on the author instance. We also need to consider the case where we need to pass info back from the public instance. Or maybe that already happens and it's "eaten" as well.

Comment by Boris Faniuk [ 03/Jun/21 ]

Hello! 

Probably this would be more compatible (this line is used for update use-case)

 throw new OperationExecutionException(i18n.translate("publishing-receiver.publish.failed"), e);
Generated at Mon Feb 12 10:35:33 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.