ページを保存すると Unable to Communicate with Server メッセージが表示される
プラットフォームについて: サーバーと Data Center のみ。この記事は、サーバーおよび Data Center プラットフォームのアトラシアン製品にのみ適用されます。
This article only applies to Confluence 7.2 and before. The problem has been solved in Confluence v7.3.
問題
Confluence のエディタでページを保存しようとすると次のいずれかのエラーが返される。
Unable to communicate with server. Saving is not possible at the moment.
Unsupported character
We can’t save because the character isn’t supported by your database.
Remove this character or use a Confluence symbol or emoticon instead.
atlassian-confluence.log
に次のログが記録される。
2017-06-26 17:07:18,451 ERROR [http-nio-8090-exec-4622] [common.error.jersey.ThrowableExceptionMapper] toResponse Uncaught exception thrown by REST service: Hibernate operation: could not execute statement; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1366]; Incorrect string value: '\xF0\x9F\x99\x8F</...' for column 'BODY' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xF0\x9F\x99\x8F</...' for column 'BODY' at row 1
-- referer: https://confluence.mycompany.com/pages/resumedraft.action?draftId=27691324&draftShareId=15edb6ff-92ab-4e11-b404-7ee318e9deaa | url: /rest/tinymce/1/drafts | traceId: 49d8e79835835a7b | userName: myusername
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute statement; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1366]; Incorrect string value: '\xF0\x9F\x99\x8F</...' for column 'BODY' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xF0\x9F\x99\x8F</...' for column 'BODY' at row 1
診断
環境
utf8
を使用している MySQL
原因
ページのコンテンツに、http://www.unicode.org/emoji/charts/full-emoji-list.html の拡張 UTF8 絵文字が含まれています。
MySQL utf8
では、4 bit 文字はサポートされていません。この問題については次の 2 つのバグ レポートが登録されています。
回避策
Remove the extended emoji characters from the page and use the built in emoticons in Confluence. See Symbols, emojis and special characters. Note that you can't use emoticons in page titles.
ソリューション
Confluence を Confluence 7.3 以降にアップグレードします。ここでは MySQL 5.7 および 8.0 用の utf8mb4 照合がサポートされています。
MySQL サーバーとデータベースのエンコーディングおよび照合を utf8mb4 および utf8mb4_bin に更新するか、<confluence-home>/confluence.cfg.xml でコネクション文字列を次のように更新します。"jdbc:mysql://<DB_IP>:<DB_PORT>/<confluenceDB>?connectionCollation=utf8mb4_bin"