Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack import problem #23923

Open
Snyaify opened this issue Dec 10, 2021 · 9 comments
Open

Slack import problem #23923

Snyaify opened this issue Dec 10, 2021 · 9 comments

Comments

@Snyaify
Copy link

Snyaify commented Dec 10, 2021

Good day.
i'm trying to import slack history into my rocketchat instance and can't get it work

Here is log in private pastebin:
log
my compose:
docker-compose

rocketchat instance:

|                                                   |
|  Rocket.Chat Version: 4.2.0                       |
|       NodeJS Version: 12.22.1 - x64               |
|      MongoDB Version: 5.0.5                       |
|       MongoDB Engine: wiredTiger                  |
|             Platform: linux                       |
|         Process Port: 3000                        |
|     ReplicaSet OpLog: Enabled                     |
|          Commit Hash: a4ad199f13                  |

@oleksdovz
Copy link

oleksdovz commented Dec 11, 2021

docker image 4.0.0 - import failed
With docker images

  • '3.18.2'
  • 3.17.3
    after import, I lost admin rights :(

Found solution how to fix, got to mongo and update user
https://docs.rocket.chat/guides/administration/misc.-admin-guides/restoring-an-admin

@debdutdeb
Copy link
Member

Hi, I'm just copying the log here since on pastebin it will expire after 4 days.
{"level":50,"time":"2021-12-10T13:12:24.212Z","pid":9,"hostname":"rocketchat","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:258:4)<br>    at app/importer/server/classes/ImportDataConverter.ts:331:11<br>    at Array.forEach (<anonymous>)<br>    at ImportDataConverter.convertUsers (app/importer/server/classes/ImportDataConverter.ts:306: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-12-10T13:12:24.215Z","pid":9,"hostname":"rocketchat","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:258:4)<br>    at app/importer/server/classes/ImportDataConverter.ts:331:11<br>    at Array.forEach (<anonymous>)<br>    at ImportDataConverter.convertUsers (app/importer/server/classes/ImportDataConverter.ts:306: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-12-10T13:12:24.217Z","pid":9,"hostname":"rocketchat","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:373:26)<br>    at _command (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/command.js:125: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:195:8)<br>    at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/server.js:490: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"} 

@debdutdeb
Copy link
Member

I'm not fully aware of the hows of slack imports. I'll get back as soon as I can.

@oleksdovz
Copy link

You can use docker/k8s for deployment
Slack import can be finished with docker label 3.8
and after use latest docker tag for usual run

@Snyaify
Copy link
Author

Snyaify commented Dec 13, 2021

docker tag 4.2.1
Same error

CLICK ME {"level":50,"time":"2021-12-13T08:01:45.422Z","pid":8,"hostname":"rocketchat","name":"Slack Importer","err":{"type":"Error","message":"object [\"\"] is not a valid ObjectId","stack":"Error: object [\"\"] is not a valid ObjectId
at serializeObjectId (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:287:11)
at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:941:17)
at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:947:17)
at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:729:17)
at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:947:17)
at BSON.serialize (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/bson.js:64:28)
at Msg.serializeBson (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:127:22)
at Msg.makeDocumentSegment (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:119:33)
at Msg.toBin (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:105:25)
at MessageStream.writeCommand (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:55:28)
at Connection.write (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:373:26)
at _command (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/command.js:125:10)
at command (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/command.js:28:5)
at writeCommand (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/write_command.js:56:3)
at Object.update (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/index.js:9:5)
at Connection.update (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:195:8)
at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/server.js:490:13
at Object.callback (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection_pool.js:345:7)
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":50,"time":"2021-12-13T08:01:45.423Z","pid":8,"hostname":"rocketchat","name":"Slack Importer","err":{"type":"Error","message":"object [\"\"] is not a valid ObjectId","stack":"Error: object [\"\"] is not a valid ObjectId
at serializeObjectId (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:287:11)
at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:941:17)
at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:947:17)
at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:729:17)
at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:947:17)
at BSON.serialize (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/bson.js:64:28)
at Msg.serializeBson (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:127:22)
at Msg.makeDocumentSegment (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:119:33)
at Msg.toBin (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:105:25)
at MessageStream.writeCommand (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:55:28)
at Connection.write (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:373:26)
at _command (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/command.js:125:10)
at command (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/command.js:28:5)
at writeCommand (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/write_command.js:56:3)
at Object.update (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/index.js:9:5)
at Connection.update (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:195:8)
at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/server.js:490:13
at Object.callback (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection_pool.js:345:7)
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":50,"time":"2021-12-13T08:01:45.424Z","pid":8,"hostname":"rocketchat","name":"Slack Importer","err":{"type":"Error","message":"object [\"\"] is not a valid ObjectId","stack":"Error: object [\"\"] is not a valid ObjectId
at serializeObjectId (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:287:11)
at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:941:17)
at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:947:17)
at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:729:17)
at serializeObject (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:347:18)
at serializeInto (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/parser/serializer.js:947:17)
at BSON.serialize (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/bson/lib/bson/bson.js:64:28)
at Msg.serializeBson (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:127:22)
at Msg.makeDocumentSegment (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:119:33)
at Msg.toBin (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/msg.js:105:25)
at MessageStream.writeCommand (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:55:28)
at Connection.write (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:373:26)
at _command (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/command.js:125:10)
at command (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/command.js:28:5)
at writeCommand (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/write_command.js:56:3)
at Object.update (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/wireprotocol/index.js:9:5)
at Connection.update (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:195:8)
at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/server.js:490:13
at Object.callback (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection_pool.js:345:7)
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"} `

@oleksdovz
Copy link

@Snyaify Snyaify, can you check with 3.18.2 ? But be ready recover admins rights in mongo https://docs.rocket.chat/guides/administration/misc.-admin-guides/restoring-an-admin?

@Snyaify
Copy link
Author

Snyaify commented Dec 13, 2021

@Snyaify Snyaify, can you check with 3.18.2 ? But be ready recover admins rights in mongo https://docs.rocket.chat/guides/administration/misc.-admin-guides/restoring-an-admin?

I'll try, but it's very strange that in the older version it works and in the new one it doesn't

@caseysoftware
Copy link

Seeing the same issue on this side, first on 4.1 and then post-upgrade on 4.2.2

@dudanogueira
Copy link
Contributor

PR #24585 should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants