Unexpected end of input block in CDATA section error while accessing page or space after database conversion to utf8
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
You get the following error while accessing a page/space:
1
Error: The XML content could not be parsed. There is a problem at line 12, column 6. Parser message: Unexpected end of input block in CDATA section
The following appears in the atlassian-confluence.log
:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
2012-07-05 13:57:59,670 ERROR [http-8080-9] [content.render.xhtml.DefaultRenderer] render Error rendering content for view: The XML content could not be parsed. There is a problem at line 12, column 6. Parser message: Unexpected end of input block in CDATA section
at [row,col {unknown-source}]: [12,6]
-- url: /pages/editpage.action | page: 76546993 | userName: dave | referer: https://wiki.info.nl/display/HF/Bacula+overview+en+howto%27s | action: editpage
com.atlassian.confluence.content.render.xhtml.XhtmlParsingException: The XML content could not be parsed. There is a problem at line 12, column 6. Parser message: Unexpected end of input block in CDATA section
at [row,col {unknown-source}]: [12,6]
at com.atlassian.confluence.content.render.xhtml.StaxUtils.convertToXhtmlException(StaxUtils.java:303)
at com.atlassian.confluence.content.render.xhtml.storage.StorageXhtmlTransformer.transform(StorageXhtmlTransformer.java:49)
at com.atlassian.confluence.content.render.xhtml.TransformerChain.transform(TransformerChain.java:41)
at com.atlassian.confluence.content.render.xhtml.PluggableTransformerChain.transform(PluggableTransformerChain.java:53)
at com.atlassian.confluence.content.render.xhtml.DefaultRenderer.render(DefaultRenderer.java:63)
at com.atlassian.confluence.pages.actions.AbstractPreviewPageAction.getEditorFormattedContent(AbstractPreviewPageAction.java:189)
at com.atlassian.confluence.pages.actions.AbstractPreviewPageAction.getWysiwygContent(AbstractPreviewPageAction.java:169)
at sun.reflect.GeneratedMethodAccessor1408.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
...
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected end of input block in CDATA section
at [row,col {unknown-source}]: [12,6]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOB(StreamScanner.java:700)
at com.ctc.wstx.sr.StreamScanner.loadMoreFromCurrent(StreamScanner.java:1054)
at com.ctc.wstx.sr.StreamScanner.getNextCharFromCurrent(StreamScanner.java:811)
at com.ctc.wstx.sr.BasicStreamReader.skipCommentOrCData(BasicStreamReader.java:3457)
at com.ctc.wstx.sr.BasicStreamReader.skipToken(BasicStreamReader.java:3325)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2622)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
at com.ctc.wstx.evt.WstxEventReader.peek(WstxEventReader.java:306)
at com.ctc.wstx.evt.FilteredEventReader.peek(FilteredEventReader.java:120)
at com.ctc.wstx.evt.FilteredEventReader.hasNext(FilteredEventReader.java:70)
at com.atlassian.confluence.content.render.xhtml.XmlFragmentEventReader.hasNext(XmlFragmentEventReader.java:49)
at com.atlassian.confluence.content.render.xhtml.XmlFragmentBodyEventReader.hasNext(XmlFragmentBodyEventReader.java:41)
at com.atlassian.confluence.content.render.xhtml.ForwardingXmlEventReader.hasNext(ForwardingXmlEventReader.java:26)
at com.atlassian.confluence.content.render.xhtml.XmlFragmentEventReader.hasNext(XmlFragmentEventReader.java:49)
at com.atlassian.confluence.content.render.xhtml.XmlFragmentEventReader.close(XmlFragmentEventReader.java:74)
at com.atlassian.confluence.content.render.xhtml.ForwardingXmlEventReader.close(ForwardingXmlEventReader.java:51)
at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transform(DefaultFragmentTransformer.java:128)
at com.atlassian.confluence.content.render.xhtml.storage.StorageXhtmlTransformer.transform(StorageXhtmlTransformer.java:43)
... 236 more
Cause
Something goes wrong during the conversion and breaks some characters after the database import. Example of the broken characters:
latin1 database:
1
... some sample text financiën.doc
utf8 converted and imported:
1
... some sample text financi
Resolution
If it is a Production instance and you have new data in the database, it's best to follow the following steps to fix the problem:
Synchronized the old database backup with the new database to have all the data/content (old and new) intact. You can use the TOAD application.
Convert the database to utf8 with the following SQL statement for each table:
1
alter table <table name> convert to CHARACTER SET utf8;
Was this helpful?