{"id":1011,"date":"2022-11-30T12:21:10","date_gmt":"2022-11-30T10:21:10","guid":{"rendered":"https:\/\/valentijn.sessink.nl\/?p=1011"},"modified":"2022-11-30T18:52:57","modified_gmt":"2022-11-30T16:52:57","slug":"mattermost-failed-to-save-post","status":"publish","type":"post","link":"https:\/\/valentijn.sessink.nl\/?p=1011","title":{"rendered":"Mattermost &#8211; failed to save Post?"},"content":{"rendered":"\n<p>Does your <a href=\"https:\/\/mattermost.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Mattermost<\/a> instance seem to be unable to send emoji? The solution could be as easy as fixing the database configuration.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>My Mattermost instance seemed to be unable to send emoji. I was able to send <em>:upside_down_face:<\/em> (<em>colon<\/em> upside <em>underscore<\/em> down <em>underscore<\/em> face <em>colon<\/em>), but you could not just send the \ud83d\ude43 emoji, because the message would fail to send.<\/p>\n\n\n\n<p>I just took this as the computer nuisance we all have to live with, when someone else mentioned the same problem: &#8220;I&#8217;m receiving everything, but whenever I try to send something, I&#8217;m getting an error message&#8221;. Others chimed in: &#8220;Could it be that you can&#8217;t send messages with emoji?&#8221;<\/p>\n\n\n\n<p>Searching through the Mattermost bug list at Github didn&#8217;t turn up anything. Weird. It&#8217;s 2022 and you cannot send emoji? But there is no bug report? Even SMS, a 30 year old standard originally based on 160 7-bit characters, is able to send smileys these days. (Yeah, that&#8217;s probably MMS, but hey, I cannot see the difference, it&#8217;s my phones messaging client\/protocol\/thing).<\/p>\n\n\n\n<p>The Mattermost log files showed an obscure error message: &#8220;<em>failed to save Post: Error 3988: Conversion from collation utf8mb3_general_ci into utf8mb4_0900_ai_ci impossible for parameter<\/em>&#8220;. No hits on that, either. Neither through duckduckgo, nor through other search machines.<\/p>\n\n\n\n<p>But hey, collation &#8211; maybe the database would have something to do with it?<\/p>\n\n\n\n<p>The Mysql tables all were all nice and friendly <em>utf8mb4 collate=utf8mb4_0900_ai_ci<\/em> just as they should, but the database configuration in Mattermost was wrong:<\/p>\n\n\n\n<p><code>\"DataSource\": \"mattermost:very_secret_password@tcp(somehost:3306)\/mattermost?charset=utf8\"<\/code><\/p>\n\n\n\n<p>Changing this to <strong>charset=utf8mb4,utf8<\/strong> (as is in de documentation, so we were wrong all the time!) was all that was needed.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Does your Mattermost instance seem to be unable to send emoji? The solution could be as easy as fixing the database configuration.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[175,174],"class_list":["post-1011","post","type-post","status-publish","format-standard","hentry","category-happy-hacking","tag-emoji","tag-mattermost"],"_links":{"self":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts\/1011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1011"}],"version-history":[{"count":3,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions"}],"predecessor-version":[{"id":1015,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions\/1015"}],"wp:attachment":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}