Confluence でページを表示する際に "The XML Content Could Not Be Parsed" エラーが返される

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

ページを表示しようとしてもレンダリングされず、ユーザー インターフェイスで次のエラーが返される。

atlassian-confluence.log に次の内容が表示される。

Error: The XML content could not be parsed. There is a problem at
line x, column y. Parser message: String ']]>' not allowed in
textual content, except as the end marker of CDATA section at [row,col
 
{unknown-source}
]: [x,y] 

原因 1

これは、XML 標準に競合する既存の文字によって発生します。この文字は、上述のログ エントリのエラー メッセージで String ']]>' として表示されます。この例では '>' が対象の文字です。 

原因 2

このエラーは、Confluence のアップグレード時に、XHTML Migration のあとに bodytypeid に NULL 値が存在することで発生することもあります。次のクエリを実行すると、この問題の影響を受けているページを特定できます。

SELECT *
FROM BODYCONTENT
WHERE contentid IN (
    SELECT c.contentid FROM CONTENT AS c WHERE CONTENTTYPE IN ('PAGE', 'COMMENT', 'BLOGPOST')
)
  AND bodytypeid IS NULL;

ソリューション 1

(warning) This resolution covers specifically > and replacing it with it's XML encoding of &gt.  For a list of other characters and their encodings please see List of XML and HTML character entity references.


As an initial troubleshooting step, we could also run the following SQL query from the Database for us to review what is being stored in Confluence Database for the affected page (source of truth):
(info) Please modify the pageName and spaceName parameters accordingly.

SELECT c.contentid, c.title, s.spacekey, bc.body 
FROM CONTENT c JOIN BODYCONTENT bc 
ON c.contentid = bc.contentid JOIN SPACES s 
ON c.spaceid = s.spaceid 
WHERE c.prevver IS NULL 
AND c.contenttype IN ('PAGE', 'BLOGPOST') 
AND c.title LIKE '<pageName>' 
AND s.spacename LIKE '<spaceName>';
  1. Confluence source editor プラグインをインストールします。
  2. Navigate to the offending page and click ... > View Storage Format, to get storage format of the affected page
  3. 結果のテキストをクリップボードにコピーします。
  4. On the same page click Edit > <>  to open the source editor    
  5. ソース エディタで既存のコンテンツを削除します。
  6. クリップボードのコンテンツをソース エディタにペーストします。
  7. Find any instance of >  that is not being used in a proper XML tag and replace with &gt 
  8. 変更を保存します。

ソリューション 2

(info) データベースへの変更を行う前に、データベースの完全なバックアップを作成済みで Confluence がシャットダウン済みであることをご確認ください。その後、次のクエリを実行します。

UPDATE
    BODYCONTENT
SET bodytypeid = 0
WHERE contentid IN (
    SELECT c.contentid FROM CONTENT AS c WHERE CONTENTTYPE IN ('PAGE', 'COMMENT', 'BLOGPOST')
)
  AND bodytypeid IS NULL;



最終更新日 2023 年 4 月 24 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.