Mattermost-server: Cannot load channel messages, Uncaught TypeError: e.replace is not a function

Created on 24 Feb 2017  Â·  23Comments  Â·  Source: mattermost/mattermost-server

For feature requests, please see: http://www.mattermost.org/feature-requests/.
For troubleshooting questions, please post on the forums: http://forum.mattermost.org/.

For issues with the product, please follow the steps at http://www.mattermost.org/filing-issues/ and post here in the following format:

Summary

Cannot load channel messages due to Uncaught TypeError: e.replace is not a function

Steps to reproduce

GitLab 8.17
Mattermost 3.6.2 or dev commit 80273d023

Enable Mattermost Commands in GitLab project integration settings, than input command /project issue search keyword works fine, but after /project issue show 1 the command fails, server log:

[2017/02/24 16:15:19 CST] [DEBG] /api/v3/teams/9edfubxufpn432lcknq6534apc/commands/execute
[2017/02/24 16:15:19 CST] [DEBG] Executing cmd=project userId=mk5xubd6mfnbasjnoehsptifzw
[2017/02/24 16:15:20 CST] [DEBG] /api/v3/general/log_client
[2017/02/24 16:15:20 CST] [EROR] /api/v3/general/log_client:client code=0 rid=euxx7uiqfbgpmd9p4452kamr7w uid=mk5xubd6mfnbasjnoehsptifzw ip=10.0.0.48 msg: Uncaught TypeError: e.replace is not a function
Please report this to https://github.com/chjj/marked. row: 54 col: 24264 stack: TypeError: e.replace is not a function
Please report this to https://github.com/chjj/marked. url: https://im.mm.com/static/main.e5c033d82bde5ac1d393.js [details: ]

Then restart Mattermost Desktop this channel couldn't load messages anymore:
4e9cecaf-b532-40f8-8084-ae809d08c1d4
screen shot 2017-02-24 at 4 18 31 pm

Expected behavior

Describe your issue in detail

Observed behavior

What did you see happen? Please include relevant error messages and/or screenshots.

Possible fixes

If you can, link to the line of code that might be responsible for the problem

Most helpful comment

Can we somehow change the chat-message with the slash-command that the chat is loadable again?

Currently, I'm not able to use a 1:1 chat with a team-member as it includes a broken slash-command - I'm not able to communicate with this one :frowning_face:

I've read the doc and find some command-line stuff but there're only commands to add/delete channels etc. I think we would need to manipulate the chat-message in the database directly. Is this possible (just change the text of the broken message, do not delete it)?

All 23 comments

Can we somehow change the chat-message with the slash-command that the chat is loadable again?

Currently, I'm not able to use a 1:1 chat with a team-member as it includes a broken slash-command - I'm not able to communicate with this one :frowning_face:

I've read the doc and find some command-line stuff but there're only commands to add/delete channels etc. I think we would need to manipulate the chat-message in the database directly. Is this possible (just change the text of the broken message, do not delete it)?

Same issue here. Cannot load my town-square channel due to the 'stuck on loading' issue. This is preventing me to use an entire 'Team' due to the fact the first channel it loads is the town-square..

Major problem...

GitLab released 8.17.1 today which fixes sth related to commands:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9408

Haven't tried it.

I've already updates GitLab today but it doesn't fix this.

The mentioned MR looks like a different problem. I'm waiting for a fix on their side like "fixed slash-commands in mattermost-integration".

This could be a fix though I cant find an exception in the Sources tab: https://gitlab.com/gitlab-org/gitlab-ce/issues/28640#note_24098466

I installed a third party client to del the messed up message to make the
chan load again.
On Wed, 1 Mar 2017 at 6:35 PM Stefan van Gastel notifications@github.com
wrote:

This could be a fix though I cant find an exception in the Sources tab:
https://gitlab.com/gitlab-org/gitlab-ce/issues/28640#note_24098466

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/mattermost/platform/issues/5520#issuecomment-283304710,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFZ9C3FRGu25q2E5dzbTsBm4zy75Ih_ks5rhUnYgaJpZM4MK8cb
.

>

Best regards,

-- yee

@jostyee What client?

I'd rather make Mattermost codes be more robust other than hoping only GitLab do the fix work to bypass the issue.

Super nasty workaround I used was to spam a lot of messages to the corrupted channel using mattertee. So the bad messages are not loaded...

I feel dirty..

Any progress on this? It's been a week with unusable in-production software without a comment from the makers :frowning:

Sorry @jostyee @hardysim @stefanvangastel for the slow response here

@ZJvandeWeg would you have any thoughts on this error? It appears that after using /project issue show <number> on GitLab 8.17, the channel cannot be loaded.

Looks like this is reported in a few places now

@jasonblais put GitLab aside, at lease Mattermost should assure that unparsable message won't tear down the whole channel.

Ill take a look this week. It will probably miss the merge window, but if its this serious Ill push for a patch release.

Edit: @jasonblais The first impression I get, is that this is a JS issue on the MM side. Not GitLabs. Internally we use the Slack format, its structured like this

We have created a ticket and are investigating the issue: https://mattermost.atlassian.net/browse/PLT-5722

@ZJvandeWeg where is the GitLab slash command plug-in stored? This would help us find the root cause

@jasonblais I linked a part of it, the rest can be found in /lib/chat_commands.

Is anyone affected by this issue able to get the raw text of an offending post from their database to send to me? You can send it privately to me on https://pre-release.mattermost.com since this could be used for a denial-of-service attack. I have an idea of what's causing the issue, but I haven't been able to reproduce it myself without manipulating the database directly

@hmhealey I have done the following using Mattermost shipped with Gitlab 8.17.1:

  • Create new channel
  • Use /<trigger> issue show <number>
  • This works for most issues though I found one giving no visible response
  • I'll send you the output, will have to redact some stuff though I'll keep all non [a-zA-Z0-9] chars in place.

Note: My channel doesn't break anymore. (Same version as far as I know). Could have to do with it being an empty channel? Last time I broke my town-square channel and I'm not going to try that again ;)

I've been unable to reproduce on the current omnibus nightly.

However, a fake JSON you might receive:

{"response_type"=>"in_channel", "status"=>200, "attachments"=>[{"title"=>"test issue · #1", "title_link"=>"http://git.zjvandeweg.nl/root/new-project/issues/1", "author_name"=>"Administrator", "author_icon"=>"http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", "fallback"=>"Issue #1: test issue", "pretext"=>"Issue *#1* from Administrator / new-project", "text"=>"**Open**", "color"=>"#38ae67", "fields"=>[{"title"=>"Assignee", "value"=>"_None_", "short"=>true}, {"title"=>"Milestone", "value"=>"_None_", "short"=>true}, {"title"=>"Labels", "value"=>"_None_", "short"=>true}], "mrkdwn_in"=>["pretext", "text", "fields"]}]}

FYI - this issue should be resolved through this PR: https://github.com/mattermost/platform/pull/5670

It'll be available in GitLab 9.0 as part of the Mattermost 3.7 release

That will be 9.0. To avoid confusion, there will be no 8.18 release, after 8.17 it will be 9.0

-- 
Zeger-Jan van de Weg

On 13 March 2017 at 18:21:34, Jason Blais ([email protected]) wrote:

FYI - this issue should be resolved through this PR: #5670

It'll be available in GitLab 8.18 as part of the Mattermost 3.7 release

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@ZJvandeWeg That's fantastic news! Looking forward to GitLab 9.0!!

(Also updated in my post above)

I'll close the issue, if any of you hit further issues please respond here

Was this page helpful?
0 / 5 - 0 ratings