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

ERROR ReferenceError: room is not defined #10

Closed
hhyyrylainen opened this issue Jul 7, 2018 · 11 comments
Closed

ERROR ReferenceError: room is not defined #10

hhyyrylainen opened this issue Jul 7, 2018 · 11 comments

Comments

@hhyyrylainen
Copy link

I get this error when the bot tries to post rss entries:

ERROR ReferenceError: room is not defined                     
    at Timeout._onTimeout (/home/hubot/myhubot/node_modules/hubot-rss-rolf/scripts/hubot-rss-reader.coffe
e:71:51)                                                                                                 
    at ontimeout (timers.js:475:11)                                                                      
    at tryOnTimeout (timers.js:310:5)                                                                    
    at Timer.listOnTimeout (timers.js:270:5)

I found a fix for this. Change the setInterval part to look like this:

  setInterval ->
    return if typeof robot.send isnt 'function'
    return if send_queue.length < 1
    msg = send_queue.shift()
    msg.envelope.user = {}
    try
      robot.send msg.envelope, msg.body
    catch err
      logger.error "Error sending message in setInterval"
      logger.error err
  , 2000

Maybe this is caused by using a newer rocketchat connector.

@Flipez
Copy link
Owner

Flipez commented Jul 11, 2018

Hi,
does this happen always or only from time to time?

@hhyyrylainen
Copy link
Author

Before I made that change I didn't manage to get the bot to post any rss items at all and after that it just worked the next time I registered a new rss feed. So at least for me it happened 100% of the time.

@Flipez
Copy link
Owner

Flipez commented Jul 11, 2018

What version of RocketChat are you running?

At least for us the bot still works fine 🤔

@hhyyrylainen
Copy link
Author

I used the latest release and the latest hubot rocketchat connector (which might be what has this change)

@Flipez
Copy link
Owner

Flipez commented Jul 11, 2018

Unfortunately I am no longer maintaining our RocketChat, if you could paste me some version numbers I'll check back with our instance admin so we can figure out what might have introduced this.

@hhyyrylainen
Copy link
Author

My rocket chat version is 0.66.1 and my hubot package versions are (pretty confusingly): [email protected] and [email protected] but under hubot-rocketchat npm list also prints [email protected].

@Flipez
Copy link
Owner

Flipez commented Jul 12, 2018

As I already assumed we are running a older version of hubot. It seems that there were some bigger changes which require a lot more work that I thought.
According to this changes the bot should also be rewritten in js :/

https://www.npmjs.com/package/hubot-rocketchat#important

@Flipez
Copy link
Owner

Flipez commented Aug 30, 2018

I am going to rewrite the whole bot into ES6 and make in compatible with the new hubot-rocketchat v2 adapter and Hubot v3. I try to keep as much features as possible.

@Flipez
Copy link
Owner

Flipez commented Aug 31, 2018

@hhyyrylainen Can you please check if [email protected] does work somewhat for you?

I've got it running using the following dependencies:

  "dependencies": {
    "hubot": "3",
    "hubot-help": "^1.0.1",
    "hubot-http-status": "^0.2.2",
    "hubot-redis-brain": "^1.0.0",
    "hubot-rocketchat": "github:rocketchat/hubot-rocketchat",
    "hubot-rss-rolf": "2.0.0-beta1"

@hhyyrylainen
Copy link
Author

Unfortunately I decided that rocketchat didn't work well enough so I have already removed it so I can't easily test to see if the new version works.

@realrill
Copy link

realrill commented Jan 26, 2019

@Flipez I am able to regenerate the issue with 2.0.0-beta1

Could you please take a look on that?

droid_1_165c287c5d29 | [Sat Jan 26 2019 21:34:58 GMT+0000 (Coordinated Universal Time)] INFO Filters passed, will receive message
droid_1_165c287c5d29 | [Sat Jan 26 2019 21:34:58 GMT+0000 (Coordinated Universal Time)] INFO hubot-rss-reader: add http://feeds.skynews.com/feeds/rss/world.xml
droid_1_165c287c5d29 | [Sat Jan 26 2019 21:34:58 GMT+0000 (Coordinated Universal Time)] INFO hubot-rss-reader: checker start
droid_1_165c287c5d29 | [Sat Jan 26 2019 21:34:58 GMT+0000 (Coordinated Universal Time)] INFO [sendMessage] Calling (async): [{"msg":"registered http://feeds.skynews.com/feeds/rss/world.xml","bot":{"i":"js.SDK"},"rid":"qswndTHNDruLKmaiz"}]
droid_1_165c287c5d29 | [Sat Jan 26 2019 21:34:58 GMT+0000 (Coordinated Universal Time)] INFO [received] Message in room qswndTHNDruLKmaiz
droid_1_165c287c5d29 | [Sat Jan 26 2019 21:34:58 GMT+0000 (Coordinated Universal Time)] INFO [received] Message in room qswndTHNDruLKmaiz
droid_1_165c287c5d29 | [Sat Jan 26 2019 21:34:58 GMT+0000 (Coordinated Universal Time)] INFO [received] Message in room qswndTHNDruLKmaiz
droid_1_165c287c5d29 | [Sat Jan 26 2019 21:34:58 GMT+0000 (Coordinated Universal Time)] INFO hubot-rss-reader: wait 600 seconds
droid_1_165c287c5d29 | [Sat Jan 26 2019 21:34:59 GMT+0000 (Coordinated Universal Time)] ERROR ReferenceError: room is not defined
droid_1_165c287c5d29 |   at Timeout._onTimeout (/home/hubot/node_modules/hubot-rss-rolf/scripts/hubot-rss-reader.js:79:61)
droid_1_165c287c5d29 |   at ontimeout (timers.js:436:11)
droid_1_165c287c5d29 |   at tryOnTimeout (timers.js:300:5)
droid_1_165c287c5d29 |   at listOnTimeout (timers.js:263:5)
droid_1_165c287c5d29 |   at Timer.processTimers (timers.js:223:10)
droid_1_165c287c5d29 | 
  • RocketChat 0.73.1
  • hubot-rss-rolf 2.0.0-beta1

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