Slack Import Error: Meteor.userId

Description

I am Trying to import our current Slack Workspace into RocketChat. I have upgraded our Slack Account to Businiss for this month go get the complete export but now i can not import the files into RocketChat.

I have this log at the Bottom, i had some messages at the beginning about unknown SubTypes (for Slack user join stuff, that i manually deleted) but the error is still there.

Would really like to get some help here to figgure this out. All the DOMAIN / ID etc stuff in the logs is my redacting and has reall info.
Thanks for the support

Server Setup Information

Version 4.0.0

Apps Engine Version 1.28.0-alpha.5428

Node Version v12.22.1

Database Migration 239 (October 5, 2021 7:52 PM)

MongoDB 4.0.27 / mmapv1 (oplog Enabled)

Commit Details
HEAD: (2ffdd1379)
Branch: HEAD

PID 10

Any additional Information

{"level":35,"time":"2021-10-13T17:13:08.509Z","pid":10,"hostname":"598ca1b62990","name":"API","method":"GET","url":"/api/v1/getImportFileData","userId":"ID","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Electron/13.2.2 Safari/537.36","host":"DOMAIN","referer":"https://DOMAIN/admin/import/prepare","remoteIP":"IP","status":200,"responseTime":31662} 
{"level":35,"time":"2021-10-13T17:13:18.144Z","pid":10,"hostname":"598ca1b62990","name":"Meteor","method":"startImport","userId":"ID","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Electron/13.2.2 Safari/537.36","referer":"https://DOMAIN/admin/import/prepare","remoteIP":"IP","instanceId":"D7wWNbA53xYsrwJzs"} 
{"level":35,"time":"2021-10-13T17:13:18.160Z","pid":10,"hostname":"598ca1b62990","name":"API","method":"POST","url":"/api/v1/startImport","userId":"ID","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Electron/13.2.2 Safari/537.36","length":"5983","host":"DOMAIN","referer":"https://DOMAIN/admin/import/prepare","remoteIP":"IP","status":200,"responseTime":17} 
{"level":50,"time":"2021-10-13T17:13:18.178Z","pid":10,"hostname":"598ca1b62990","name":"Slack Importer","err":{"type":"Error","message":"Meteor.userId can only be invoked in method calls or publications.","stack":"Error: Meteor.userId can only be invoked in method calls or publications.<br>    at AccountsServer.userId (packages/accounts-base/accounts_server.js:117:13)<br>    at Object.Meteor.userId (packages/accounts-base/accounts_common.js:343:32)<br>    at 0 (app/lib/server/functions/setRealName.js:44:23)<br>    at packages/rate-limit/rate-limit.js:49:19<br>    at Array.every (<anonymous>)<br>    at Rule.match (packages/rate-limit/rate-limit.js:44:8)<br>    at packages/rate-limit/rate-limit.js:249:58<br>    at Array.filter (<anonymous>)<br>    at RateLimiter._findAllMatchingRules (packages/rate-limit/rate-limit.js:249:38)<br>    at RateLimiter.increment (packages/rate-limit/rate-limit.js:228:31)<br>    at app/lib/server/lib/RateLimiter.js:18:16<br>    at saveUserIdentity (app/lib/server/functions/saveUserIdentity.js:39:8)<br>    at ImportDataConverter.updateUser (app/importer/server/classes/ImportDataConverter.ts:245:4)<br>    at app/importer/server/classes/ImportDataConverter.ts:318:11<br>    at Array.forEach (<anonymous>)<br>    at ImportDataConverter.convertUsers (app/importer/server/classes/ImportDataConverter.ts:293:9)<br>    at app/importer/server/classes/ImporterBase.js:198:20<br>    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)<br>    at packages/meteor.js:550:25<br>    at runWithEnvironment (packages/meteor.js:1286:24)"},"msg":"Meteor.userId can only be invoked in method calls or publications."} 
{"level":50,"time":"2021-10-13T17:13:18.179Z","pid":10,"hostname":"598ca1b62990","name":"Slack Importer","err":{"type":"Error","message":"Meteor.userId can only be invoked in method calls or publications.","stack":"Error: Meteor.userId can only be invoked in method calls or publications.<br>    at AccountsServer.userId (packages/accounts-base/accounts_server.js:117:13)<br>    at Object.Meteor.userId (packages/accounts-base/accounts_common.js:343:32)<br>    at 0 (app/lib/server/functions/setRealName.js:44:23)<br>    at packages/rate-limit/rate-limit.js:49:19<br>    at Array.every (<anonymous>)<br>    at Rule.match (packages/rate-limit/rate-limit.js:44:8)<br>    at packages/rate-limit/rate-limit.js:249:58<br>    at Array.filter (<anonymous>)<br>    at RateLimiter._findAllMatchingRules (packages/rate-limit/rate-limit.js:249:38)<br>    at RateLimiter.increment (packages/rate-limit/rate-limit.js:228:31)<br>    at app/lib/server/lib/RateLimiter.js:18:16<br>    at saveUserIdentity (app/lib/server/functions/saveUserIdentity.js:39:8)<br>    at ImportDataConverter.updateUser (app/importer/server/classes/ImportDataConverter.ts:245:4)<br>    at app/importer/server/classes/ImportDataConverter.ts:318:11<br>    at Array.forEach (<anonymous>)<br>    at ImportDataConverter.convertUsers (app/importer/server/classes/ImportDataConverter.ts:293:9)<br>    at app/importer/server/classes/ImporterBase.js:198:20<br>    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)<br>    at packages/meteor.js:550:25<br>    at runWithEnvironment (packages/meteor.js:1286:24)"},"msg":"Meteor.userId can only be invoked in method calls or publications."} 
{"level":50,"time":"2021-10-13T17:13:18.181Z","pid":10,"hostname":"598ca1b62990","name":"Slack Importer","err":{"type":"Error","message":"object [\"\"] is not a valid ObjectId","stack":"Error: object [\"\"] is not a valid ObjectId<br>    at serializeObjectId (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:287:11)<br>    at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:941:17)<br>    at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)<br>    at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:947:17)<br>    at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)<br>    at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:729:17)<br>    at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)<br>    at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:947:17)<br>    at BSON.serialize (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/bson.js:64:28)<br>    at Msg.serializeBson (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:127:22)<br>    at Msg.makeDocumentSegment (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:119:33)<br>    at Msg.toBin (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:105:25)<br>    at MessageStream.writeCommand (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:55:28)<br>    at Connection.write (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:368:26)<br>    at _command (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/command.js:120:10)<br>    at command (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/command.js:28:5)<br>    at writeCommand (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/write_command.js:56:3)<br>    at Object.update (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/index.js:9:5)<br>    at Connection.update (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:191:8)<br>    at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/server.js:483:13<br>    at Object.callback (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection_pool.js:345:7)<br>    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"} 
{"level":30,"time":"2021-10-13T17:13:18.191Z","pid":10,"hostname":"HOST","name":"Slack Importer","msg":"Import took 31 milliseconds."} 

hi @TobiasDax

Wild guess here… looks like some name has some unwanted characters.

I say that based on those hints:

  1. app/lib/server/functions/setRealName.js:44:23
  2. “object [”"] is not a valid ObjectId"

Can you check the data and look for “weird” names? Probably some ", or \

I never did this kind of import, but If we can isolate that, we can could a simple environment and feed that to our dev team.

Thanks!

1 Like

so, after a very long day i found out the following:

  1. importing the same files on a SAAS version of rocket.chat works fine.
  2. using the official docker-compose.yaml does not work out of the box
  3. using the official coder-compose.yaml and changing the image version to 3.18.2 works. This is the same version that the SAAS Server runs on.

so my guess is that somewhere between 3.18.2 and 4 the import broke.

Not sure who to call about that.

2 Likes