RocketChat / RocketChat/Rocket.Chat

Slack import no longer works in 4.x

Open
#24,465 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

Slack import no longer works on any 4.x version

Steps to reproduce:
  1. Obtain a slack export
  2. Use import from file or public server url
  3. Start import
  4. After file is loaded and you select the messages/channels/users
Expected behavior:

Import to work

Actual behavior:

Import fails

Server Setup Information:
  • Version of Rocket.Chat Server: 4.4.1
  • Operating System: Ubuntu 18.04
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: 1
  • NodeJS Version: 14
  • MongoDB Version: 4.2
Client Setup Information
  • Desktop App or Browser Version: Firefox 97
  • Operating System: Windows
Additional context

File is loaded correctly but starting the import fails with error. Even the older backup files that were previously successfully imported with 3.x no longer work on 4.x. Manually inspecting slack export json files don't show up anything related to "" objects.

Relevant logs:

rocketchat_1 | {"level":50,"time":"2022-02-06T17:23:39.954Z","pid":1436,"hostname":"735a54cf786a","name":"","name":"Slack Importer","err":{"type":"Error","message":"object [\"\"] is not a valid ObjectId","stack":"Error: object [\"\"] is not a valid ObjectId\n at serializeObjectId (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:287:11)\n at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:941:17)\n at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)\n at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:947:17)\n at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)\n at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:729:17)\n at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)\n at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:947:17)\n at BSON.serialize (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/bson.js:64:28)\n at Msg.serializeBson (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:127:22)\n at Msg.makeDocumentSegment (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:119:33)\n at Msg.toBin (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:105:25)\n at MessageStream.writeCommand (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:55:28)\n at Connection.write (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:373:26)\n at _command (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/command.js:125:10)\n at command (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/command.js:28:5)\n at writeCommand (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/write_command.js:56:3)\n at Object.update (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/index.js:9:5)\n at Connection.update (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:195:8)\n at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/server.js:490:13\n at Object.callback (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection_pool.js:345:7)\n at processWaitQueue (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection_pool.js:468:23)"},"msg":"object [\"\"] is not a valid ObjectId"}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Slack import through the file or public server URL, then inspect the Slack Importer path associated with the logged invalid ObjectId error. Compare the 4.x behavior with the previously working 3.x backup files; done means selecting messages, channels, and users completes the import without the BSON serialization failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.