Saving Page Throws Unable to Communicate with Server message
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
This article only applies to Confluence 7.2 and before. The problem has been solved in Confluence v7.3.
Problem
Saving a page in Confluence editor throws one of the following errors:
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.
The following appears in the 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
Diagnosis
Environment
- MySQL running
utf8
Cause
The content of the page contains extended UTF8 emoji from http://www.unicode.org/emoji/charts/full-emoji-list.html
The 4 bit characters are not supported in MySQL utf8
. We have two bug reports here for this issue
Workaround
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.
Resolution
Upgrade to Confluence to Confluence 7.3 or later, which adds support for utf8mb4 collation for MySQL 5.7 and 8.0.
Update the MYSQL server and database encoding and collation to utf8mb4 and utf8mb4_bin or update the connection string like this "jdbc:mysql://<DB_IP>:<DB_PORT>/<confluenceDB>?connectionCollation=utf8mb4_bin" in <confluence-home>/confluence.cfg.xml.