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

Cannot read property 'room_id' of undefined #317

Open
sargatana opened this issue Apr 18, 2019 · 2 comments
Open

Cannot read property 'room_id' of undefined #317

sargatana opened this issue Apr 18, 2019 · 2 comments

Comments

@sargatana
Copy link

When I run a command on RocketChat the bot execute the action but StatckStorm don't reply with the action result.

RocketChat Version - 0.72.3

image

Full Error :

Apr 18 17:15:10 RHTPFLOW003 hubot: [Thu Apr 18 2019 17:15:10 GMT+0100 (Western European Summer Time)] DEBUG Chatops message received: {"trace_context": null, "payload": {"whisper": false, "message": "\nAction core.local completed.\nstatus : succeeded\nexecution: 5cb89bd10648d3796fb93686\n\nweb_url: https://RHTPFLOW003.corporativo.pt/#/history/5cb89bd10648d3796fb93686/general\n\nTook 0.785319\u03BCs to complete.\n\nresult :\n--------\nstdout : \n apps\nbin\nboot\ncdrom\ndev\netc\nhome\nlib\nlib64\nmedia\nmnt\nopt\nproc\nroot\nrun\nsbin\nsrv\nsys\ntmp\nusr\nvar\n\n", "user": "XXXXXX", "channel": "general", "extra": {}}}
Apr 18 17:15:10 RHTPFLOW003 hubot: [Thu Apr 18 2019 17:15:10 GMT+0100 (Western European Summer Time)] ERROR TypeError: Cannot read property 'roomID' of undefined
Apr 18 17:15:10 RHTPFLOW003 hubot: at strings.map (/opt/stackstorm/chatops/node_modules/hubot-rocketchat/index.js:155:25)
Apr 18 17:15:10 RHTPFLOW003 hubot: at Array.map (:null:null)
Apr 18 17:15:10 RHTPFLOW003 hubot: at RocketChatBotAdapter.send (/opt/stackstorm/chatops/node_modules/hubot-rocketchat/index.js:154:20)
Apr 18 17:15:10 RHTPFLOW003 hubot: at Robot.messageRoom (/opt/stackstorm/chatops/node_modules/hubot/src/robot.js:608:23)
Apr 18 17:15:10 RHTPFLOW003 hubot: at sendChunk (/opt/stackstorm/chatops/node_modules/hubot-stackstorm/lib/post_data.js:386:25)
Apr 18 17:15:10 RHTPFLOW003 hubot: at RocketChatDataPostHandler.postData (/opt/stackstorm/chatops/node_modules/hubot-stackstorm/lib/post_data.js:391:5)
Apr 18 17:15:10 RHTPFLOW003 hubot: at EventSource. (/opt/stackstorm/chatops/node_modules/hubot-stackstorm/scripts/stackstorm.js:402:25)
Apr 18 17:15:10 RHTPFLOW003 hubot: at EventSource.emit (events.js:189:13)
Apr 18 17:15:10 RHTPFLOW003 hubot: at _emit (/opt/stackstorm/chatops/node_modules/eventsource/lib/eventsource.js:172:17)
Apr 18 17:15:10 RHTPFLOW003 hubot: at parseEventStreamLine (/opt/stackstorm/chatops/node_modules/eventsource/lib/eventsource.js:186:9)
Apr 18 17:15:10 RHTPFLOW003 hubot: at IncomingMessage. (/opt/stackstorm/chatops/node_modules/eventsource/lib/eventsource.js:150:11)
Apr 18 17:15:10 RHTPFLOW003 hubot: at IncomingMessage.emit (events.js:189:13)
Apr 18 17:15:10 RHTPFLOW003 hubot: at addChunk (_stream_readable.js:284:12)
Apr 18 17:15:10 RHTPFLOW003 hubot: at readableAddChunk (_stream_readable.js:265:11)
Apr 18 17:15:10 RHTPFLOW003 hubot: at IncomingMessage.Readable.push (_stream_readable.js:220:10)
Apr 18 17:15:10 RHTPFLOW003 hubot: at HTTPParser.parserOnBody (_http_common.js:122:22)
Apr 18 17:15:10 RHTPFLOW003 hubot: at TLSSocket.socketOnData (_http_client.js:442:20)
Apr 18 17:15:10 RHTPFLOW003 hubot: at TLSSocket.emit (events.js:189:13)
Apr 18 17:15:10 RHTPFLOW003 hubot: at addChunk (_stream_readable.js:284:12)
Apr 18 17:15:10 RHTPFLOW003 hubot: at readableAddChunk (_stream_readable.js:265:11)
Apr 18 17:15:10 RHTPFLOW003 hubot: at TLSSocket.Readable.push (_stream_readable.js:220:10)
Apr 18 17:15:10 RHTPFLOW003 hubot: at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

@steinerkelvin
Copy link

steinerkelvin commented Aug 30, 2019

I'm having a similar problem, but the property is called 'roomID'.

Rocketchat 1.5.2
Hubot 3.1.1
StackStorm 3.1

/opt/stackstorm/chatops/node_modules/hubot-rocketchat/index.js:155
      if (envelope.user.roomID) driver.sendToRoomId(text, envelope.user.roomID)
                        ^

TypeError: Cannot read property 'roomID' of undefined
    at strings.map (/opt/stackstorm/chatops/node_modules/hubot-rocketchat/index.js:155:25)
    at Array.map (<anonymous>:null:null)
    at RocketChatBotAdapter.send (/opt/stackstorm/chatops/node_modules/hubot-rocketchat/index.js:154:20)
    at Robot.messageRoom (/opt/stackstorm/chatops/node_modules/hubot/src/robot.js:608:23)
    at sendChunk (/opt/stackstorm/chatops/node_modules/hubot-stackstorm/lib/post_data.js:451:25)
    at RocketChatDataPostHandler.postData (/opt/stackstorm/chatops/node_modules/hubot-stackstorm/lib/post_data.js:456:5)
    at EventSource.<anonymous> (/opt/stackstorm/chatops/node_modules/hubot-stackstorm/scripts/stackstorm.js:416:25)
    at EventSource.emit (events.js:182:13)
    at _emit (/opt/stackstorm/chatops/node_modules/eventsource/lib/eventsource.js:172:17)
    at parseEventStreamLine (/opt/stackstorm/chatops/node_modules/eventsource/lib/eventsource.js:186:9)
    at IncomingMessage.<anonymous> (/opt/stackstorm/chatops/node_modules/eventsource/lib/eventsource.js:150:11)
    at IncomingMessage.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at IncomingMessage.Readable.push (_stream_readable.js:219:10)
    at HTTPParser.parserOnBody (_http_common.js:122:22)
    at TLSSocket.socketOnData (_http_client.js:441:20)
    at TLSSocket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at TLSSocket.Readable.push (_stream_readable.js:219:10)
    at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

@IsReal8a
Copy link

IsReal8a commented Mar 9, 2020

Follow the solution here while there is a proper one, it worked for me RocketChat/hubot-rocketchat-boilerplate#4
Specifically you need to change this line - https://github.com/RocketChat/hubot-rocketchat/blob/master/index.js#L146
Hope that helps.

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

No branches or pull requests

3 participants