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

SlackBridge: TypeError: this._encodeParams is not a function #17815

Closed
JesseVS opened this issue Jun 3, 2020 · 19 comments · Fixed by #18320
Closed

SlackBridge: TypeError: this._encodeParams is not a function #17815

JesseVS opened this issue Jun 3, 2020 · 19 comments · Fixed by #18320
Assignees

Comments

@JesseVS
Copy link

JesseVS commented Jun 3, 2020

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

@tcpsyn
Copy link

tcpsyn commented Jun 16, 2020

I'm seeing the same on Ubuntu 18.04

@Vinutha-Garimella
Copy link

Vinutha-Garimella commented Jun 18, 2020

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)

@sveatlo
Copy link

sveatlo commented Jun 18, 2020

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

@paralllax
Copy link

paralllax commented Jun 21, 2020

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

@JesseVS
Copy link
Author

JesseVS commented Jun 23, 2020

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

@sampaiodiego
Copy link
Member

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

@redzonej
Copy link

@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

@JesseVS
Copy link
Author

JesseVS commented Jul 2, 2020

@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

@juzser
Copy link
Contributor

juzser commented Jul 6, 2020

Same in 3.4.1

@Vinutha-Garimella
Copy link

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

@paralllax
Copy link

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

@redzonej
Copy link

redzonej commented Jul 8, 2020

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

@pierre-lehnen-rc
Copy link
Contributor

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: meteor/meteor#11092

@Vinutha-Garimella
Copy link

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

@Vinutha-Garimella
Copy link

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)

@pwit
Copy link

pwit commented Jul 20, 2020

Do you have some workaround to this maybe?

@Vinutha-Garimella
Copy link

@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

@sampaiodiego
Copy link
Member

@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

@Vinutha-Garimella
Copy link

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

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

Successfully merging a pull request may close this issue.

10 participants