Mattermost, Inc.

Mattermost's Slack Importer Imports Messages Twice

Summary

Mattermost’s Slack importer imports messages twice in every channel. https://i.zelakto.tv/Urbq9c4.png

Steps to reproduce

Fresh Mattermost install running v4.4.3 on CentOS 6.

Expected behavior

Importer doesn’t duplicate messages.

Observed behavior

Importer duplicates messages, when noticed, Mattermost took a while to load messages in desired channel. I restarted the server (which killed the import) and tried again, this appears in console.

2017/12/12 03:24:48 http: multiple response.WriteHeader calls
[2017/12/12 03:24:48 EST] [EROR] websocket connect err: websocket: not a websocket handshake: 'upgrade' token not found in 'Connection' header
[2017/12/12 03:24:48 EST] [EROR] /api/v4/websocket:connect code=500 rid=za3sep9cgpy8xcupdfdo1yi8oo uid=pdgbziwhjfdq9mqar3nuqqbhac ip=IPADDRESS Failed to upgrade websocket connection [details: ]

With this, Mattermost becomes unresponsive, then I have to wipe the MySQL database.

Any help would be much appreciated, thanks!

Can you clarify the steps that you took? By

I restarted the server (which killed the import) and tried again

it sounds like you ran the import operation twice, which would explain the duplicate messages. Did the import operation ever successfully complete?

Please try these steps:

  • Wipe your MySQL database so that it is clean
  • Start Mattermost and verify that you can log in and send messages as expected
  • Run the Slack import exactly once, log into the MySQL database, and verify that the messages appear in the Posts table
  • Start Mattermost again, and verify that you can see the imported messages in the UI

I suspect that you’re conflating two or more issues here. It’ll be easier to debug if we can figure out exactly which step is failing.