Rocket.chat: SlackBridge: TypeError: this._encodeParams is not a function

Created on 3 Jun 2020  Â·  19Comments  Â·  Source: RocketChat/Rocket.Chat

Description:

I wanted to setup the SlackBridge, but after I entered the settings and restarted rocket-chat container, I received a error in the 'View Logs' page.

Steps to reproduce:

  1. Go to SlackBridge settings
  2. Click on 'Enabled' to enable
  3. Insert API token: xoxb-xxxxxxxxxxxxxxxxxxxxxx
  4. Click on 'Save changes'
  5. Restart rocketchat
  6. View Logs

Expected behavior:

Rocketchat would connect to slack to synchronise messages

Actual behavior:

Throws the error defined below.

Server Setup Information:

  • Version of Rocket.Chat Server: 3.3.0
  • Operating System: Debian 10 / Docker
  • Deployment Method: docker / docker-compose
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 12.16.1 - x64
  • MongoDB Version: 4.0.18

Relevant logs:

I20200603-06:23:41.786(0) server.js:204 SlackBridge âž” Slack.error Error attempting to connect to Slack TypeError: this._encodeParams is not a function at _encodeParams (packages/url.js:69:23) at Object.exports.buildUrl (packages/url.js:91:16) at Function.exports._constructUrl (packages/url.js:119:17) at Object._call (packages/http.js:76:20) at Object.call (packages/meteor.js:306:21) at Object.HTTP.get (packages/http.js:217:20) at SlackAPI.getChannels (app/slackbridge/server/SlackAPI.js:11:25) at SlackAdapter.populateMembershipChannelMapByChannels (app/slackbridge/server/SlackAdapter.js:533:34) at SlackAdapter.populateMembershipChannelMap (app/slackbridge/server/SlackAdapter.js:562:8) at app/slackbridge/server/SlackAdapter.js:57:10 at Function.time (/app/bundle/programs/server/profile.js:273:30) at /app/bundle/programs/server/boot.js:415:15 at /app/bundle/programs/server/boot.js:465:7 at Function.run (/app/bundle/programs/server/profile.js:280:14) at /app/bundle/programs/server/boot.js:463:13

slackbridge

Most helpful comment

Slackbridge is working with rocketchat:3.5.0-rc.0 image, thanks for the update @sampaiodiego

All 19 comments

I'm seeing the same on Ubuntu 18.04

Hi, I am facing the same issue with rocketchat version latest docker image 3.3

Steps to reproduce:

  1. Go to SlackBridge settings
  2. Click on 'Enabled' to enable
  3. Insert API token: xoxb-xxxxxxxxxxxxxxxxxxxxxx
  4. Click on 'Save changes'
  5. Restart rocketchat
  6. add /slackbridge-import in a channel that you want to sync from slack
Error in rocketchat app 
@user has started a SlackBridge import at #systemalerts. We'll let you know when it's finished.
SlackBridge got an error while importing your messages at systemalerts: this._encodeParams is not a function

Server Setup Information:
Version of Rocket.Chat Server: 3.3
Operating System: Ubuntu/Docker
Deployment Method: docker container
Number of Running Instances: 2
DB Replicaset Oplog: Enabled

server.js:204 SlackBridge âž” Slack.error Error attempting to connect to Slack TypeError: this._encodeParams is not a function
    at _encodeParams (packages/url.js:69:23)
    at Object.exports.buildUrl (packages/url.js:91:16)
    at Function.exports._constructUrl (packages/url.js:119:17)
    at Object._call (packages/http.js:76:20)
    at Object.call (packages/meteor.js:306:21)
    at Object.HTTP.get (packages/http.js:217:20)
    at SlackAPI.getChannels (app/slackbridge/server/SlackAPI.js:11:25)
    at SlackAdapter.populateMembershipChannelMapByChannels (app/slackbridge/server/SlackAdapter.js:533:34)
    at SlackAdapter.populateMembershipChannelMap (app/slackbridge/server/SlackAdapter.js:562:8)
    at app/slackbridge/server/SlackAdapter.js:57:10
    at Object.startup (packages/meteor.js:992:5)
    at SlackAdapter.connect (app/slackbridge/server/SlackAdapter.js:55:10)
    at app/slackbridge/server/slackbridge.js:39:11
    at Array.forEach (<anonymous>)
    at SlackBridgeClass.connect (app/slackbridge/server/slackbridge.js:33:14)

Same error here with rocketchat version 3.3.3

Server Setup Information:

Version of Rocket.Chat Server: 3.3.3.
Operating System: debian 10
Deployment Method: tar
Number of Running Instances: 1
DB Replicaset Oplog: Enabled

logs

Jun 18 19:49:30 chat rocketchat[1149064]: server.js:204 SlackBridge âž” Slack.error Error attempting to connect to Slack TypeError: this._encodeParams is not a function
Jun 18 19:49:30 chat rocketchat[1149064]:     at _encodeParams (packages/url.js:69:23)
Jun 18 19:49:30 chat rocketchat[1149064]:     at Object.exports.buildUrl (packages/url.js:91:16)
Jun 18 19:49:30 chat rocketchat[1149064]:     at Function.exports._constructUrl (packages/url.js:119:17)
Jun 18 19:49:30 chat rocketchat[1149064]:     at Object._call (packages/http.js:76:20)
Jun 18 19:49:30 chat rocketchat[1149064]:     at Object.call (packages/meteor.js:306:21)
Jun 18 19:49:30 chat rocketchat[1149064]:     at Object.HTTP.get (packages/http.js:217:20)
Jun 18 19:49:30 chat rocketchat[1149064]:     at SlackAPI.getChannels (app/slackbridge/server/SlackAPI.js:11:25)
Jun 18 19:49:30 chat rocketchat[1149064]:     at SlackAdapter.populateMembershipChannelMapByChannels (app/slackbridge/server/SlackAdapter.js:533:34)
Jun 18 19:49:30 chat rocketchat[1149064]:     at SlackAdapter.populateMembershipChannelMap (app/slackbridge/server/SlackAdapter.js:562:8)
Jun 18 19:49:30 chat rocketchat[1149064]:     at app/slackbridge/server/SlackAdapter.js:57:10
Jun 18 19:49:30 chat rocketchat[1149064]:     at Function.time (/opt/Rocket.Chat/programs/server/profile.js:273:30)
Jun 18 19:49:30 chat rocketchat[1149064]:     at /opt/Rocket.Chat/programs/server/boot.js:415:15
Jun 18 19:49:30 chat rocketchat[1149064]:     at /opt/Rocket.Chat/programs/server/boot.js:465:7
Jun 18 19:49:30 chat rocketchat[1149064]:     at Function.run (/opt/Rocket.Chat/programs/server/profile.js:280:14)
Jun 18 19:49:30 chat rocketchat[1149064]:     at /opt/Rocket.Chat/programs/server/boot.js:463:13

I am also seeing the same

Server Setup Information:

Version of Rocket.Chat Server: 3.3.3.
Operating System: CentOS 7
Deployment Method: tar
Number of Running Instances: 1
DB Replicaset Oplog: Enabled

Log error:

I20200621-17:10:36.900(-5) server.js:204 SlackBridge âž” Slack.error Error attempting to connect to Slack TypeError: this._encodeParams is not a function
     at _encodeParams (packages/url.js:69:23)
     at Object.exports.buildUrl (packages/url.js:91:16)
     at Function.exports._constructUrl (packages/url.js:119:17)
     at Object._call (packages/http.js:76:20)
     at Object.call (packages/meteor.js:306:21)
     at Object.HTTP.get (packages/http.js:217:20)
     at SlackAPI.getChannels (app/slackbridge/server/SlackAPI.js:11:25)
     at SlackAdapter.populateMembershipChannelMapByChannels (app/slackbridge/server/SlackAdapter.js:533:34)
     at SlackAdapter.populateMembershipChannelMap (app/slackbridge/server/SlackAdapter.js:562:8)
     at app/slackbridge/server/SlackAdapter.js:57:10
     at Function.time (/opt/Rocket.Chat/programs/server/profile.js:273:30)
     at /opt/Rocket.Chat/programs/server/boot.js:415:15
     at /opt/Rocket.Chat/programs/server/boot.js:465:7
     at Function.run (/opt/Rocket.Chat/programs/server/profile.js:280:14)
     at /opt/Rocket.Chat/programs/server/boot.js:463:1

@sampaiodiego is this on your radar?
We are looking forward to use rocket.chat but need to migrate from slack.

it was not =) @pierre-lehnen-rc can you take a look on this please? thx

@sampaiodiego @pierre-lehnen-rc Thanks for looking into this. Same issue here on brand new server deployed yesterday with latest docker container on AWS.

Ubuntu 18.04

Completely fresh install using standard AWS instructions.

I20200626-12:09:40.146(0) server.js:204 SlackBridge âž” Slack.error Error attempting to connect to Slack TypeError: this._encodeParams is not a function at _encodeParams (packages/url.js:69:23) at Object.exports.buildUrl (packages/url.js:91:16) at Function.exports._constructUrl (packages/url.js:119:17) at Object._call (packages/http.js:76:20) at Object.call (packages/meteor.js:306:21) at Object.HTTP.get (packages/http.js:217:20) at SlackAPI.getChannels (app/slackbridge/server/SlackAPI.js:11:25) at SlackAdapter.populateMembershipChannelMapByChannels (app/slackbridge/server/SlackAdapter.js:533:34) at SlackAdapter.populateMembershipChannelMap (app/slackbridge/server/SlackAdapter.js:562:8) at app/slackbridge/server/SlackAdapter.js:57:10 at Function.time (/app/bundle/programs/server/profile.js:273:30) at /app/bundle/programs/server/boot.js:415:15 at /app/bundle/programs/server/boot.js:465:7 at Function.run (/app/bundle/programs/server/profile.js:280:14) at /app/bundle/programs/server/boot.js:463:13
I20200626-12:09:40.148(0) server.js:204 SlackBridge âž” Slack.error Error attempting to connect to Slack TypeError: this._encodeParams is not a function at _encodeParams (packages/url.js:69:23) at Object.exports.buildUrl (packages/url.js:91:16) at Function.exports._constructUrl (packages/url.js:119:17) at Object._call (packages/http.js:76:20) at Object.call (packages/meteor.js:306:21) at Object.HTTP.get (packages/http.js:217:20) at SlackAPI.getChannels (app/slackbridge/server/SlackAPI.js:11:25) at SlackAdapter.populateMembershipChannelMapByChannels (app/slackbridge/server/SlackAdapter.js:533:34) at SlackAdapter.populateMembershipChannelMap (app/slackbridge/server/SlackAdapter.js:562:8) at app/slackbridge/server/SlackAdapter.js:57:10 at Function.time (/app/bundle/programs/server/profile.js:273:30) at /app/bundle/programs/server/boot.js:415:15 at /app/bundle/programs/server/boot.js:465:7 at Function.run (/app/bundle/programs/server/profile.js:280:14) at /app/bundle/programs/server/boot.js:463:13

@pierre-lehnen-rc The problem still exists in version 3.4.0:
rocketchat_1 | server.js:204 SlackBridge âž” Slack.error Error attempting to connect to Slack TypeError: this._encodeParams is not a function
rocketchat_1 | at _encodeParams (packages/url.js:69:23)
rocketchat_1 | at Object.exports.buildUrl (packages/url.js:91:16)
rocketchat_1 | at Function.exports._constructUrl (packages/url.js:119:17)
rocketchat_1 | at Object._call (packages/http.js:76:20)
rocketchat_1 | at Object.call (packages/meteor.js:306:21)
rocketchat_1 | at Object.HTTP.get (packages/http.js:217:20)
rocketchat_1 | at SlackAPI.getChannels (app/slackbridge/server/SlackAPI.js:11:25)
rocketchat_1 | at SlackAdapter.populateMembershipChannelMapByChannels (app/slackbridge/server/SlackAdapter.js:533:34)
rocketchat_1 | at SlackAdapter.populateMembershipChannelMap (app/slackbridge/server/SlackAdapter.js:562:8)
rocketchat_1 | at app/slackbridge/server/SlackAdapter.js:57:10
rocketchat_1 | at Function.time (/app/bundle/programs/server/profile.js:273:30)
rocketchat_1 | at /app/bundle/programs/server/boot.js:415:15
rocketchat_1 | at /app/bundle/programs/server/boot.js:465:7
rocketchat_1 | at Function.run (/app/bundle/programs/server/profile.js:280:14)
rocketchat_1 | at /app/bundle/programs/server/boot.js:463:13

Same in 3.4.1

I have updated the rocketchat to 3.4.1 but the slack bridge issue still exist, can anyone please look into this issue.

Also confirming the issue persists for me in 3.4.1 after upgrading from 3.3.3

By going back to a snap installation with current snap stable version 3.2.2 it works fine. It seems to be all versions after 3.3.0 including the most recent 3.4.1

This was introduced by a meteor bug, which is fixed by now. We'll need to update meteor to fix it on our side as well.

Related: https://github.com/meteor/meteor/issues/11092

Hi @pierre-lehnen-rc, Is rocketchat docker image has been updated with this fix.?

issue still exist in version 3.4.2

server.js:204 SlackBridge âž” Slack.error Error attempting to connect to Slack TypeError: this._encodeParams is not a function
    at _encodeParams (packages/url.js:69:23)
    at Object.exports.buildUrl (packages/url.js:91:16)
    at Function.exports._constructUrl (packages/url.js:119:17)
    at Object._call (packages/http.js:76:20)
    at Object.call (packages/meteor.js:306:21)
    at Object.HTTP.get (packages/http.js:217:20)
    at SlackAPI.getChannels (app/slackbridge/server/SlackAPI.js:11:25)
    at SlackAdapter.populateMembershipChannelMapByChannels (app/slackbridge/server/SlackAdapter.js:533:34)
    at SlackAdapter.populateMembershipChannelMap (app/slackbridge/server/SlackAdapter.js:562:8)
    at app/slackbridge/server/SlackAdapter.js:57:10
    at Object.startup (packages/meteor.js:992:5)
    at SlackAdapter.connect (app/slackbridge/server/SlackAdapter.js:55:10)
    at app/slackbridge/server/slackbridge.js:39:11
    at Array.forEach (<anonymous>)
    at SlackBridgeClass.connect (app/slackbridge/server/slackbridge.js:33:14)
    at app/slackbridge/server/slackbridge.js:98:10
    at app/settings/lib/settings.ts:81:37
    at Array.forEach (<anonymous>)
    at app/settings/lib/settings.ts:81:15
    at Array.forEach (<anonymous>)
    at Settings.load (app/settings/lib/settings.ts:78:14)
    at Object.changed (app/settings/server/functions/settings.ts:350:17)
    at _CachingChangeObserver.changed (packages/minimongo/local_collection.js:1317:28)
    at applyChange.changed (packages/minimongo/local_collection.js:729:27)
    at runWithEnvironment (packages/meteor.js:1286:24)

Do you have some workaround to this maybe?

@sampaiodiego this issue still exist in rocket.chat:3.4.2 docker image, can you please let me know which image tag should I use to get the slack bridge issue fixed

@Vinutha-Garimella the fix will be included in version 3.5.0 which is under release candidate now.. you can help test using image rocketchat/rocket.chat:3.5.0-rc.0

Slackbridge is working with rocketchat:3.5.0-rc.0 image, thanks for the update @sampaiodiego

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danpospisil picture danpospisil  Â·  3Comments

zeigerpuppy picture zeigerpuppy  Â·  3Comments

Kiran-Rao picture Kiran-Rao  Â·  3Comments

Buzzele picture Buzzele  Â·  3Comments

marceloschmidt picture marceloschmidt  Â·  3Comments