Bug 1011751 - Assembly fails with "Failed to convert the Topic Error template into a DOM document"
Assembly fails with "Failed to convert the Topic Error template into a DOM do...
Status: CLOSED CURRENTRELEASE
Product: PressGang CCMS
Classification: Community
Component: CSProcessor (Show other bugs)
1.1
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 1.2
Assigned To: Lee Newson
:
: 1011745 (view as bug list)
Depends On:
Blocks: 1013825
  Show dependency treegraph
 
Reported: 2013-09-25 00:47 EDT by Ruediger Landmann
Modified: 2013-10-17 19:49 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-17 19:49:24 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ruediger Landmann 2013-09-25 00:47:10 EDT
Description of problem:

When I run "csprocessor assemble" on topic map 22451, I get the following error:

CSProcessor client version: 1.0.3
Loading configuration from /home/rlandmann/.config/csprocessor.ini
Connecting to PressGang server: http://skynet.usersys.redhat.com:8080/TopicIndex/

Attempting to download all the latest topics...
Starting first validation pass...
Starting second validation pass...
Starting bug link validation pass...
INFO:  The Content Specification is valid.

Starting to build...
Doing en-US Populate Database Pass
Doing Fixed URL Pass
org.jboss.resteasy.client.ClientResponseFailure: Error status 502 null returned
        at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:523)
        at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:514)
        at org.jboss.resteasy.client.core.BaseClientResponse.checkFailureStatus(BaseClientResponse.java:508)
        at org.jboss.resteasy.client.core.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:38)
        at org.jboss.resteasy.client.core.ClientInvoker.invoke(ClientInvoker.java:120)
        at org.jboss.resteasy.client.core.ClientProxy.invoke(ClientProxy.java:88)
        at com.sun.proxy.$Proxy27.updateJSONTopics(Unknown Source)
        at org.jboss.pressgang.ccms.provider.RESTTopicProvider.updateTopics(RESTTopicProvider.java:606)
        at org.jboss.pressgang.ccms.provider.RESTTopicProvider.updateTopics(RESTTopicProvider.java:589)
        at org.jboss.pressgang.ccms.contentspec.builder.DocbookBuilder.setFixedURLsPass(DocbookBuilder.java:3531)
        at org.jboss.pressgang.ccms.contentspec.builder.DocbookBuilder.populateDatabaseTopics(DocbookBuilder.java:777)
        at org.jboss.pressgang.ccms.contentspec.builder.DocbookBuilder.doPopulateDatabasePass(DocbookBuilder.java:699)
        at org.jboss.pressgang.ccms.contentspec.builder.DocbookBuilder.buildBook(DocbookBuilder.java:494)
        at org.jboss.pressgang.ccms.contentspec.builder.DocbookBuilder.buildBook(DocbookBuilder.java:403)
        at org.jboss.pressgang.ccms.contentspec.builder.ContentSpecBuilder.buildBook(ContentSpecBuilder.java:101)
        at org.jboss.pressgang.ccms.contentspec.client.commands.BuildCommand.buildContentSpec(BuildCommand.java:667)
        at org.jboss.pressgang.ccms.contentspec.client.commands.BuildCommand.process(BuildCommand.java:468)
        at org.jboss.pressgang.ccms.contentspec.client.commands.AssembleCommand.process(AssembleCommand.java:102)
        at org.jboss.pressgang.ccms.contentspec.client.Client.processArgs(Client.java:254)
        at org.jboss.pressgang.ccms.contentspec.client.Client.main(Client.java:106)

Doing Revisions Fixed URL Pass
Doing en-US First topic pass
        Processing 210 Topics
        First topic Pass 5% Done
        First topic Pass 10% Done
        First topic Pass 15% Done
        First topic Pass 20% Done
        First topic Pass 25% Done
        First topic Pass 30% Done
        First topic Pass 35% Done
        First topic Pass 40% Done
ERROR: Failed to convert the Topic Error template into a DOM document




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

CSProcessor client version: 1.0.3

How reproducible:
100%

Steps to Reproduce:
1. run "csprocessor assemble 22451"

Actual results:
Errors out

Expected results:
Does not error out

Additional info:
Comment 1 Matthew Casperson 2013-09-25 02:43:58 EDT
*** Bug 1011745 has been marked as a duplicate of this bug. ***
Comment 2 Misty Stanley-Jones 2013-09-25 21:33:48 EDT
We figured out why this happened in this instance. I think the essense of this bug report is that we want it to be more obvious why a book has failed to assemble or build. I propose that the right solution is that a failing topic should not fail building the book, but that a report should be generated of topics that had to be suppressed because of unrecoverably bad XML. 

In this case, there was another issue which is an import issue (entities like &lt; and &gt; were decoded to < and >, rendering XML invalid where it shouldn't have been. I don't know if we have root cause (was it chopbook or the csprocessor API that did it?)

So when this bug is up for consideration, it should really be divided into two.
Comment 3 Lee Newson 2013-09-26 00:47:04 EDT
Misty, just so this is easier to resolve would you mind specifying where the problem was? As that error shouldn't ever occur unless someone configured the template incorrectly on the server (which is why it's one of the few cases of an instant failure). ie was it invalid XML in the topic title?
Comment 4 Lee Newson 2013-09-26 00:48:47 EDT
I should also mention that exception shouldn't be printed to the output.
Comment 5 Misty Stanley-Jones 2013-09-26 00:53:56 EDT
It was content spec 22451 and Matt resolved it by taking some invalid characters out of some topic titles.
Comment 6 Lee Newson 2013-10-08 01:04:40 EDT
Fixed in 1.2-SNAPSHOT build 201310081448.

This was caused by the title being set before the base template was converted. I've updated the builder to leave the title as is and then replace it after the DOM Document conversion. Then when the builder gets to the docbook validation part if the title is invalid then the xml will be reverted to use "Invalid Topic" as the title.
Comment 9 Lee Newson 2013-10-16 00:19:51 EDT
Fixed in 1.2-SNAPSHOT build 201310161416

This was caused by the way the title was being set and the way the validation was done. Since the setTitle() method sets the title as a TextNode when the attempt to parse the title into DOM elements fails it was marking the XML as valid. This then meant that the title check was missed since the XML was valid. I've updated this so that the title valid check is always done.
Comment 11 Matthew Casperson 2013-10-16 01:40:03 EDT
Confirmed that titles with xml like markup are now correctly handled.

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