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

Errors with Hubot 2.19 #28

Open
bryanrossUK opened this issue Sep 4, 2017 · 7 comments
Open

Errors with Hubot 2.19 #28

bryanrossUK opened this issue Sep 4, 2017 · 7 comments

Comments

@bryanrossUK
Copy link

Hi,

With hubot-2.19 with redis-brain-v0.0.4 and I get the following errors when I try to use hubot-eavesdrop-2.2.1. Any ideas on how to fix this?

hubot_1  | [Mon Sep 04 2017 18:00:41 GMT+0000 (UTC)] ERROR TypeError: Cannot read property 'sort' of null
hubot_1  |   at TextListener.callback (/opt/hubot/node_modules/hubot-eavesdrop/src/eavesdrop.coffee:95:17, <js>:116:12)
hubot_1  |   at executeListener (/opt/hubot/node_modules/hubot/src/listener.coffee:65:11, <js>:53:19)
hubot_1  |   at allDone (/opt/hubot/node_modules/hubot/src/middleware.coffee:44:37, <js>:34:16)
hubot_1  |   at /opt/hubot/node_modules/async/lib/async.js:274:13
hubot_1  |   at Object.async.eachSeries (/opt/hubot/node_modules/async/lib/async.js:142:20)
hubot_1  |   at Object.async.reduce (/opt/hubot/node_modules/async/lib/async.js:268:15)
hubot_1  |   at /opt/hubot/node_modules/hubot/src/middleware.coffee:49:7, <js>:37:22
hubot_1  |   at nextTickCallbackWith0Args (node.js:489:9)
hubot_1  |   at process._tickCallback (node.js:418:13)
hubot_1  |
hubot_1  | [Mon Sep 04 2017 18:00:51 GMT+0000 (UTC)] ERROR TypeError: Cannot read property 'push' of null
hubot_1  |   at EavesDropping.add (/opt/hubot/node_modules/hubot-eavesdrop/src/eavesdrop.coffee:30:20, <js>:22:33)
hubot_1  |   at TextListener.callback (/opt/hubot/node_modules/hubot-eavesdrop/src/eavesdrop.coffee:57:21, <js>:66:24)
hubot_1  |   at executeListener (/opt/hubot/node_modules/hubot/src/listener.coffee:65:11, <js>:53:19)
hubot_1  |   at allDone (/opt/hubot/node_modules/hubot/src/middleware.coffee:44:37, <js>:34:16)
hubot_1  |   at /opt/hubot/node_modules/async/lib/async.js:274:13
hubot_1  |   at Object.async.eachSeries (/opt/hubot/node_modules/async/lib/async.js:142:20)
hubot_1  |   at Object.async.reduce (/opt/hubot/node_modules/async/lib/async.js:268:15)
hubot_1  |   at /opt/hubot/node_modules/hubot/src/middleware.coffee:49:7, <js>:37:22
hubot_1  |   at nextTickCallbackWith0Args (node.js:489:9)
hubot_1  |   at process._tickCallback (node.js:418:13)
@acrewdson
Copy link
Contributor

I ran into the same thing. I'll make a PR that might be able to help.

@bryanrossUK
Copy link
Author

👍

@acrewdson
Copy link
Contributor

Strangely, I'm no longer seeing this -- I wonder if some other dep got updated that might have fixed the underlying issue? @liquidstate can you still reproduce the problem?

@bryanrossUK
Copy link
Author

bryanrossUK commented Jan 10, 2018

Apologies for taking so long to test this, but I'm still getting the same problem.

Each incoming message on the channel generates the following error:

hubot_1  | [Wed Jan 10 2018 21:38:24 GMT+0000 (UTC)] ERROR TypeError: Cannot read property 'sort' of null
hubot_1  |   at TextListener.callback (/opt/hubot/node_modules/hubot-eavesdrop/src/eavesdrop.coffee:95:17, <js>:116:12)
hubot_1  |   at executeListener (/opt/hubot/node_modules/hubot/src/listener.coffee:65:11, <js>:53:19)
hubot_1  |   at allDone (/opt/hubot/node_modules/hubot/src/middleware.coffee:44:37, <js>:34:16)
hubot_1  |   at /opt/hubot/node_modules/async/lib/async.js:274:13
hubot_1  |   at Object.async.eachSeries (/opt/hubot/node_modules/async/lib/async.js:142:20)
hubot_1  |   at Object.async.reduce (/opt/hubot/node_modules/async/lib/async.js:268:15)
hubot_1  |   at /opt/hubot/node_modules/hubot/src/middleware.coffee:49:7, <js>:37:22
hubot_1  |   at nextTickCallbackWith0Args (node.js:489:9)
hubot_1  |   at process._tickCallback (node.js:418:13)

Trying to use hubot when you hear cat respond with woof generates the following error:

hubot_1  | [Wed Jan 10 2018 21:38:46 GMT+0000 (UTC)] ERROR TypeError: Cannot read property 'push' of null
hubot_1  |   at EavesDropping.add (/opt/hubot/node_modules/hubot-eavesdrop/src/eavesdrop.coffee:30:20, <js>:22:33)
hubot_1  |   at TextListener.callback (/opt/hubot/node_modules/hubot-eavesdrop/src/eavesdrop.coffee:57:21, <js>:66:24)
hubot_1  |   at executeListener (/opt/hubot/node_modules/hubot/src/listener.coffee:65:11, <js>:53:19)
hubot_1  |   at allDone (/opt/hubot/node_modules/hubot/src/middleware.coffee:44:37, <js>:34:16)
hubot_1  |   at /opt/hubot/node_modules/async/lib/async.js:274:13
hubot_1  |   at Object.async.eachSeries (/opt/hubot/node_modules/async/lib/async.js:142:20)
hubot_1  |   at Object.async.reduce (/opt/hubot/node_modules/async/lib/async.js:268:15)
hubot_1  |   at /opt/hubot/node_modules/hubot/src/middleware.coffee:49:7, <js>:37:22
hubot_1  |   at nextTickCallbackWith0Args (node.js:489:9)
hubot_1  |   at process._tickCallback (node.js:418:13)

Here's the dependency tree (I've removed all non-essential modules for testing purposes):

npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated [email protected]: connect 2.x series is deprecated
npm WARN deprecated [email protected]: Use uuid module instead
[email protected] /tmp
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | `-- [email protected]
| | +-- [email protected]
| | | `-- [email protected]  deduped
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]
| | | | `-- [email protected]
| | | `-- [email protected]
| | |   `-- [email protected]  deduped
| | +-- [email protected]
| | | `-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| |   +-- [email protected]
| |   `-- [email protected]
| |     `-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | | `-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | | +-- [email protected]
| | | | | +-- [email protected]
| | | | | `-- [email protected]  deduped
| | | | `-- [email protected]
| | | |   +-- [email protected]  deduped
| | | |   `-- [email protected]
| | | |     `-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]
| | | | | +-- [email protected]
| | | | | | `-- [email protected]
| | | | | `-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]
| | | | | `-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | `-- [email protected]  deduped
| | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | `-- [email protected]  deduped
| | | +-- [email protected]  deduped
| | | +-- [email protected]  deduped
| | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | `-- [email protected]  deduped
| | | +-- [email protected]  deduped
| | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]
| | | | | +-- [email protected]
| | | | | +-- [email protected]
| | | | | `-- [email protected]
| | | | |   `-- [email protected]
| | | | `-- [email protected]  deduped
| | | +-- [email protected]  deduped
| | | +-- [email protected]  deduped
| | | +-- [email protected]
| | | | +-- [email protected]
| | | | | +-- [email protected]
| | | | | | `-- [email protected]
| | | | | `-- [email protected]
| | | | `-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]
| | | | | `-- [email protected]
| | | | `-- [email protected]  deduped
| | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]
| | | | | `-- [email protected]
| | | | `-- [email protected]
| | | +-- [email protected]  deduped
| | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | `-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]
| | | | | `-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | `-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]
| | | | | `-- [email protected]
| | | | `-- [email protected]  deduped
| | | +-- [email protected]  deduped
| | | +-- [email protected]
| | | +-- [email protected]  deduped
| | | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]
| | | | `-- [email protected]  deduped
| | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]
| | | | `-- [email protected]  deduped
| | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | +-- [email protected]
| | | | | `-- [email protected]
| | | | `-- [email protected]  deduped
| | | +-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | `-- [email protected]
| | | |   +-- [email protected]  deduped
| | | |   +-- [email protected]
| | | |   +-- [email protected]
| | | |   +-- [email protected]  deduped
| | | |   +-- [email protected]  deduped
| | | |   +-- [email protected]  deduped
| | | |   +-- [email protected]  deduped
| | | |   +-- [email protected]  deduped
| | | |   +-- [email protected]  deduped
| | | |   +-- [email protected]
| | | |   | `-- [email protected]
| | | |   +-- [email protected]  deduped
| | | |   `-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]  deduped
| | | | `-- [email protected]
| | | |   `-- [email protected]
| | | +-- [email protected]  deduped
| | | `-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | `-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | `-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | `-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]  deduped
| | | +-- [email protected]  deduped
| | | +-- [email protected]
| | | +-- [email protected]  deduped
| | | +-- [email protected]  deduped
| | | +-- [email protected]  deduped
| | | +-- [email protected]  deduped
| | | +-- [email protected]
| | | +-- [email protected]  deduped
| | | +-- [email protected]
| | | | `-- [email protected]
| | | +-- [email protected]  deduped
| | | `-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| `-- [email protected]
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]  deduped
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]  deduped
| +-- [email protected]
| | +-- [email protected]  deduped
| | +-- [email protected]  deduped
| | `-- [email protected]  deduped
| +-- [email protected]
| | +-- [email protected]  deduped
| | +-- [email protected]  deduped
| | `-- [email protected]  deduped
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]  deduped
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]  deduped
| | `-- [email protected]  deduped
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]  deduped
| +-- [email protected]
| | `-- [email protected]  deduped
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]  deduped
| | +-- [email protected]  deduped
| | +-- [email protected]  deduped
| | +-- [email protected]  deduped
| | +-- [email protected]  deduped
| | +-- [email protected]  deduped
| | +-- [email protected]
| | `-- [email protected]  deduped
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]  deduped
| | +-- [email protected]  deduped
| | +-- [email protected]  deduped
| | `-- [email protected]  deduped
| +-- [email protected]
| `-- [email protected]
|   `-- [email protected]
+-- [email protected]
| `-- [email protected]
|   +-- [email protected]
|   +-- [email protected]
|   `-- [email protected]
`-- [email protected]
  +-- @slack/[email protected]
  | +-- [email protected]
  | +-- [email protected]
  | +-- [email protected]
  | +-- [email protected]
  | | +-- [email protected]
  | | | +-- [email protected]  deduped
  | | | `-- [email protected]
  | | +-- [email protected]  deduped
  | | `-- [email protected]
  | +-- [email protected]
  | +-- [email protected]
  | +-- [email protected]
  | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | | `-- [email protected]
  | | +-- [email protected]  deduped
  | | +-- [email protected]
  | | +-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]  deduped
  | | | `-- [email protected]
  | | |   `-- [email protected]
  | | +-- [email protected]
  | | | +-- [email protected]  deduped
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | | +-- [email protected]
  | | | | +-- [email protected]
  | | | | | `-- [email protected]
  | | | | +-- [email protected]
  | | | | `-- [email protected]
  | | | `-- [email protected]
  | | |   `-- [email protected]
  | | +-- [email protected]
  | | | +-- [email protected]
  | | | | `-- [email protected]  deduped
  | | | +-- [email protected]
  | | | | `-- [email protected]  deduped
  | | | +-- [email protected]
  | | | `-- [email protected]
  | | |   `-- [email protected]  deduped
  | | +-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | | +-- [email protected]
  | | | | +-- [email protected]
  | | | | +-- [email protected]
  | | | | `-- [email protected]
  | | | |   +-- [email protected]
  | | | |   +-- [email protected]  deduped
  | | | |   `-- [email protected]  deduped
  | | | `-- [email protected]
  | | |   +-- [email protected]
  | | |   +-- [email protected]
  | | |   +-- [email protected]
  | | |   | `-- [email protected]  deduped
  | | |   +-- [email protected]
  | | |   | `-- [email protected]
  | | |   +-- [email protected]
  | | |   | `-- [email protected]  deduped
  | | |   +-- [email protected]
  | | |   | `-- [email protected]
  | | |   +-- [email protected]
  | | |   `-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | | `-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | | `-- [email protected]
  | | `-- [email protected]
  | +-- [email protected]
  | +-- [email protected]
  | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]  deduped
  | | `-- [email protected]
  | `-- [email protected]
  |   +-- [email protected]
  |   `-- [email protected]
  `-- [email protected]

@acrewdson
Copy link
Contributor

@liquidstate to clarify, you reproduced the problem using my fork (commit be3673a)?

@bryanrossUK
Copy link
Author

Sorry @acrewdson - didn't spot the fork. Many thanks for your help, much appreciated!

With the fork, i'm happy to report that it works! Not 100% bug free though I'm afraid!

With a fresh install and an empty brain with your fork I get the following error on all incoming messages:

hubot_1  | [Thu Jan 11 2018 22:59:29 GMT+0000 (UTC)] ERROR TypeError: Cannot read property 'sort' of null
hubot_1  |   at TextListener.callback (/opt/hubot/node_modules/hubot-eavesdrop/src/eavesdrop.coffee:95:17, <js>:116:12)
hubot_1  |   at executeListener (/opt/hubot/node_modules/hubot/src/listener.coffee:65:11, <js>:53:19)
hubot_1  |   at allDone (/opt/hubot/node_modules/hubot/src/middleware.coffee:44:37, <js>:34:16)
hubot_1  |   at /opt/hubot/node_modules/async/lib/async.js:274:13
hubot_1  |   at Object.async.eachSeries (/opt/hubot/node_modules/async/lib/async.js:142:20)
hubot_1  |   at Object.async.reduce (/opt/hubot/node_modules/async/lib/async.js:268:15)
hubot_1  |   at /opt/hubot/node_modules/hubot/src/middleware.coffee:49:7, <js>:37:22
hubot_1  |   at nextTickCallbackWith0Args (node.js:489:9)
hubot_1  |   at process._tickCallback (node.js:418:13)

However, once I create an action, such as when you hear dog respond with woof I get two notifications in the channel from the bot. Eg:

bryan:  testbot when you hear dog respond with woof
testbot: I am now listening for dog.
testbot: I am now listening for dog.

And, when I trigger that action, I get four responses from the bot. Eg:

bryan: nice dog
testbot: woof
testbot: woof
testbot: woof
testbot: woof

If I create further actions, then I get the same two confirmations and four responses when the action is triggered.

After creating an action, I no longer receive the same error as before on every message to the channel though. My guess is that this block of code doesn't deal well with an empty array?

    tasks = eavesDropper.all()
    tasks.sort (a,b) ->
      return if a.order >= b.order then 1 else -1

@acrewdson
Copy link
Contributor

@liquidstate thanks for testing. I'll take another look. All signs point to some tricky race conditions that are not going to be easily fixed, since I didn't see any of what you describe last time I tested this -- but I also saw other weirdnesses that pointed to non-deterministic stuff going on. So I can't say I'm too surprised you found weird behavior, too. Will get back to you.

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

2 participants