Mattermost-server: Using emoji triggers error "Custom emoji have been disabled by the system admin"

Created on 10 Apr 2020  路  4Comments  路  Source: mattermost/mattermost-server

Summary

Using emoji on an instance with the custom emoji feature disabled triggers noisy errors.

Steps to reproduce

Mattermost server details:

Mattermost Version: 5.21.0
Database Schema Version: 5.21.0
Database: mysql

I was able to reproduce the last time by using emoji (for reactions) on the Android app:

  1. Disable the custom emoji option for a Mattermost instance
  2. Log into the Mattermost instance on an Android app
  3. Use emoji reactions on messages
  4. Check the logs (ERROR level)

Expected behavior

Using emojis shouldn't trigger any errors.

Observed behavior (that appears unintentional)

The error is triggered on two methods. Here's a sample log entry for each:

GetEmoji:

{
  "level": "error",
  "ts": 1586534413.1520584,
  "caller": "mlog/log.go:175",
  "msg": "Custom emoji have been disabled by the system admin.",
  "path": "/api/v4/emoji/name/+1",
  "request_id": "pqajzykpabbnmco6xosy1dgaby",
  "ip_addr": "188.154.179.71",
  "user_id": "y3yo89tmttr18qytsnhzgdo33o",
  "method": "GET",
  "err_where": "GetEmoji",
  "http_code": 501,
  "err_details": ""
}

SearchEmoji:

{
  "level": "error",
  "ts": 1586535998.0065868,
  "caller": "mlog/log.go:175",
  "msg": "Custom emoji have been disabled by the system admin.",
  "path": "/api/v4/emoji/search",
  "request_id": "pftcu446upg58jzw8i7j1dk34h",
  "ip_addr": "88.130.49.2",
  "user_id": "rp8196yejigwty5yfhby5e4uzw",
  "method": "POST",
  "err_where": "SearchEmoji",
  "http_code": 501,
  "err_details": ""
}

Possible fixes

n/a

Bug ReporOpen

All 4 comments

When mobile receives notification of a reaction to a post, it calls app/actions/websocket.ts:1067 which in turn calls app/mm-redux/actions/posts.ts:591, where a check for the emoji name is made in a map called systemEmojis. That map is never populated (always empty) and thus the code passes through to the custom emoji call. That triggers the error on the server.

This bug will be passed to mobile team to implement populating the map.

Thank you for investigating and finding the root cause @wiggin77! I'll follow this issue to see when the fix is out 馃檪

A fix for this has been submitted to upcoming Mobile app v1.32 release which is scheduled to be released in June 16th,

Was this page helpful?
0 / 5 - 0 ratings