matrix-hacks / matrix-puppet-slack

puppet style slack bridge for matrix
48 stars 17 forks source link

"Argument error" when receiving messages #31

Closed zielmicha closed 6 years ago

zielmicha commented 6 years ago

When receiving one-to-one messages on Slack, the message is not delivered to Matrix, an error is raised instead. Channels and multiuser conversations work.

Node version: v8.10.0 Synapse version: 0.26.0-1

Log:

Error in handleThirdPartyRoomMessage { Error: Argument error, options.body.
    at setContentLength (/matrix/apps/zielmicha-slack/node_modules/request/request.js:438:28)
    at Request.init (/matrix/apps/zielmicha-slack/node_modules/request/request.js:443:5)
    at new Request (/matrix/apps/zielmicha-slack/node_modules/request/request.js:128:8)
    at request (/matrix/apps/zielmicha-slack/node_modules/request/index.js:54:10)
    at /matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/lib/components/client-factory.js:54:9
    at Object.request (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/matrix.js:102:16)
    at MatrixHttpApi._request (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/http-api.js:649:29)
    at MatrixHttpApi.requestOtherUrl (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/http-api.js:558:21)
    at MatrixHttpApi.request (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/http-api.js:443:21)
    at MatrixHttpApi.authedRequest (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/http-api.js:392:36)
    at MatrixHttpApi.uploadContent (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/http-api.js:276:28)
    at MatrixClient.MatrixBaseApis.uploadContent (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/base-apis.js:639:23)
    at download.getBufferAndType.then (/matrix/apps/zielmicha-slack/node_modules/matrix-puppet-bridge/src/base.js:860:25)
    at tryCatcher (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:794:20)
  [stack]: 'Error: Argument error, options.body.\n    at setContentLength (/matrix/apps/zielmicha-slack/node_modules/request/request.js:438:28)\n    at Request.init (/matrix/apps/zielmicha-slack/node_modules/request/request.js:443:5)\n    at new Request (/matrix/apps/zielmicha-slack/node_modules/request/request.js:128:8)\n    at request (/matrix/apps/zielmicha-slack/node_modules/request/index.js:54:10)\n    at /matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/lib/components/client-factory.js:54:9\n    at Object.request (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/matrix.js:102:16)\n    at MatrixHttpApi._request (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/http-api.js:649:29)\n    at MatrixHttpApi.requestOtherUrl (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/http-api.js:558:21)\n    at MatrixHttpApi.request (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/http-api.js:443:21)\n    at MatrixHttpApi.authedRequest (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/http-api.js:392:36)\n    at MatrixHttpApi.uploadContent (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/http-api.js:276:28)\n    at MatrixClient.MatrixBaseApis.uploadContent (/matrix/apps/zielmicha-slack/node_modules/matrix-appservice-bridge/node_modules/matrix-js-sdk/lib/base-apis.js:639:23)\n    at download.getBufferAndType.then (/matrix/apps/zielmicha-slack/node_modules/matrix-puppet-bridge/src/base.js:860:25)\n    at tryCatcher (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/util.js:16:23)\n    at Promise._settlePromiseFromHandler (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/promise.js:512:31)\n    at Promise._settlePromise (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/promise.js:569:18)\n    at Promise._settlePromise0 (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/promise.js:614:10)\n    at Promise._settlePromises (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/promise.js:693:18)\n    at Async._drainQueue (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/async.js:133:16)\n    at Async._drainQueues (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/async.js:143:10)\n    at Immediate.Async.drainQueues (/matrix/apps/zielmicha-slack/node_modules/bluebird/js/release/async.js:17:14)\n    at runCallback (timers.js:794:20)',
  [message]: 'Argument error, options.body.' } { roomId: 'XXXX',
  senderId: 'XXXX',
  senderName: 'XXXX',
  avatarUrl: 'XXX',
  text: 'XXX
  html: 'XXXX' } 
thomas-profitt commented 6 years ago

This is very likely the issue seen when users who don't have avatars send messages.

See https://github.com/matrix-hacks/matrix-puppet-slack/issues/23 for a solution to that problem.

thomas-profitt commented 6 years ago

Do you still have this problem if you run https://github.com/matrix-hacks/matrix-puppet-slack/commit/1aa002c2f3817de0cf5ef942a5adc890722a27ee?

zielmicha commented 6 years ago

It seems using 1aa002c (and npm installing) helped.

zielmicha commented 6 years ago

However, this update seems to break sending messages to everyone. Unfortunately there is nothing in the log when I attempt to send message after the update.

thomas-profitt commented 6 years ago

Because that's a different error with different symptoms, please open another issue.

I've done some testing with this and I'll respond with it in the new issue.