[nodebb-plugin-ns-twitch-monitor] NS Twitch Monitor
-
So, I have had this nodebb-plugin-ns-twitch-monitor plugin installed for about a week. During that time my NodeBB forum has crashed twice. Prior to installing this plugin I do not recall my forum ever crashing! It runs weeks at a time between reloads or restarts.
I am currently running
v1.0.2
. Fortunately today I was able to capture that last bit that was displayed on the screen. This is what was displayed:25/5 00:49 [659] - error: TypeError: Cannot call method 'forEach' of undefined events.js:72 throw er; // Unhandled 'error' event ^ Error: write after end at writeAfterEnd (_stream_writable.js:133:12) at LogStream.Writable.write (_stream_writable.js:181:5) at write (_stream_readable.js:602:24) at flow (_stream_readable.js:611:7) at Socket.pipeOnReadable (_stream_readable.js:643:5) at Socket.emit (events.js:92:17) at emitReadable_ (_stream_readable.js:427:10) at emitReadable (_stream_readable.js:423:5) at readableAddChunk (_stream_readable.js:166:9) at Socket.Readable.push (_stream_readable.js:128:10)
I am not 100% sure this is the twitch plugin crashing but have a feeling it is. I have since disabled the plugin. Do you have any thoughts on this?
Thank you.
-
Give a try
3.0.1
-
Is this plugin supposed to show twitch channels on the widget even if they aren't live? It doesn't do that for me, and I would like to see that so it doesn't look out of place... Is it supposed to show those channels? (The nodebb version is 0.8.2).
-
@undeadguppy It only shows live streams. I understand that you don't want an empty widget to look out of place, neither did I. I titled my widget "Streaming Now" and it doesn't seem to odd without any activity
-
Does last version solve an issue with a crash of the forum?
-
@Nicolas Moments ago my NodeBB forum went "offline." I captured this error message. As before I am not sure this is from the Twitch plugin. Possibly you will know:
6/7 11:18 [10085] - error: TypeError: Cannot call method 'forEach' of undefined events.js:72 throw er; // Unhandled 'error' event ^ Error: write after end at writeAfterEnd (_stream_writable.js:133:12) at LogStream.Writable.write (_stream_writable.js:181:5) at write (_stream_readable.js:602:24) at flow (_stream_readable.js:611:7) at Socket.pipeOnReadable (_stream_readable.js:643:5) at Socket.emit (events.js:92:17) at emitReadable_ (_stream_readable.js:427:10) at emitReadable (_stream_readable.js:423:5) at readableAddChunk (_stream_readable.js:166:9) at Socket.Readable.push (_stream_readable.js:128:10)
Thank you.
-
@Nicolas Seeing some crashing as well in my logs:
6/7 15:53 [8090] - error: TypeError: Cannot read property 'streams' of undefined at /var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:74:28 at transform (/var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:89:25) at /var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:72:35 at fn (/var/www/nodebb/forums/node_modules/async/lib/async.js:746:34) at /var/www/nodebb/forums/node_modules/async/lib/async.js:1213:16 at /var/www/nodebb/forums/node_modules/async/lib/async.js:166:37 at /var/www/nodebb/forums/node_modules/async/lib/async.js:706:43 at /var/www/nodebb/forums/node_modules/async/lib/async.js:167:37 at /var/www/nodebb/forums/node_modules/async/lib/async.js:1209:30 at /var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:48:13 at /var/www/nodebb/forums/node_modules/async/lib/async.js:52:16 at /var/www/nodebb/forums/node_modules/async/lib/async.js:1209:30 at Request._callback (/var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:41:21) at Request.self.callback (/var/www/nodebb/forums/node_modules/request/request.js:200:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) TypeError: Cannot read property 'streams' of undefined at /var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:74:28 at transform (/var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:89:25) at /var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:72:35 at fn (/var/www/nodebb/forums/node_modules/async/lib/async.js:746:34) at /var/www/nodebb/forums/node_modules/async/lib/async.js:1213:16 at /var/www/nodebb/forums/node_modules/async/lib/async.js:166:37 at /var/www/nodebb/forums/node_modules/async/lib/async.js:706:43 at /var/www/nodebb/forums/node_modules/async/lib/async.js:167:37 at /var/www/nodebb/forums/node_modules/async/lib/async.js:1209:30 at /var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:48:13 at /var/www/nodebb/forums/node_modules/async/lib/async.js:52:16 at /var/www/nodebb/forums/node_modules/async/lib/async.js:1209:30 at Request._callback (/var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:41:21) at Request.self.callback (/var/www/nodebb/forums/node_modules/request/request.js:200:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7)
-
Is it related to Twitch API?
I mean, they now require correct API keys. Did you generate your API key? -
-
@Nicolas said in [nodebb-plugin-ns-twitch-monitor] NS Twitch Monitor:
Is it related to Twitch API?
I mean, they now require correct API keys. Did you generate your API key?I've got my API key setup as well. It was properly displaying the stream, but the forums were crashing periodically with the stack I quoted above.
-
@teh_g said in [nodebb-plugin-ns-twitch-monitor] NS Twitch Monitor:
@Nicolas Seeing some crashing as well in my logs:
6/7 15:53 [8090] - error: TypeError: Cannot read property 'streams' of undefined at /var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:74:28 at transform (/var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:89:25) at /var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:72:35 at fn (/var/www/nodebb/forums/node_modules/async/lib/async.js:746:34) at /var/www/nodebb/forums/node_modules/async/lib/async.js:1213:16 at /var/www/nodebb/forums/node_modules/async/lib/async.js:166:37 at /var/www/nodebb/forums/node_modules/async/lib/async.js:706:43 at /var/www/nodebb/forums/node_modules/async/lib/async.js:167:37 at /var/www/nodebb/forums/node_modules/async/lib/async.js:1209:30 at /var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:48:13 at /var/www/nodebb/forums/node_modules/async/lib/async.js:52:16 at /var/www/nodebb/forums/node_modules/async/lib/async.js:1209:30 at Request._callback (/var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:41:21) at Request.self.callback (/var/www/nodebb/forums/node_modules/request/request.js:200:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) TypeError: Cannot read property 'streams' of undefined at /var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:74:28 at transform (/var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:89:25) at /var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:72:35 at fn (/var/www/nodebb/forums/node_modules/async/lib/async.js:746:34) at /var/www/nodebb/forums/node_modules/async/lib/async.js:1213:16 at /var/www/nodebb/forums/node_modules/async/lib/async.js:166:37 at /var/www/nodebb/forums/node_modules/async/lib/async.js:706:43 at /var/www/nodebb/forums/node_modules/async/lib/async.js:167:37 at /var/www/nodebb/forums/node_modules/async/lib/async.js:1209:30 at /var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:48:13 at /var/www/nodebb/forums/node_modules/async/lib/async.js:52:16 at /var/www/nodebb/forums/node_modules/async/lib/async.js:1209:30 at Request._callback (/var/www/nodebb/forums/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:41:21) at Request.self.callback (/var/www/nodebb/forums/node_modules/request/request.js:200:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7)
Any chance to look at this yet? I haven't tried re-enabling the plugin since it was causing major issues in NodeBB.
-
I think issue was resolved, but in order to have a benefit of latest changes you have to remove Twitch Plugin data also from the database.
Clearing for all documents with a
twitch
should be enough:db.getCollection('objects').find({_key:/twitch/})
Why it could be a deal? Because at some point, there was not sanitization of the response from Twitch, and they changed their response a bit.
-
@teh_g For redis I did it this way:
First I uninstalled the ns-twitch-monitor plugin from the ACP. I then deleted the database entries, as follows.
$ redis-cli -n 0
(Change the-n 0
to whichever database your forum is using. Most likely zero)I ran the following command to locate the twitch keys
> KEYS *twitch*
which created output like
1) "ns:twitch_monitor:channel:11" 2) "ns:twitch_monitor:channel:8" 3) "settings:ns:twitch_monitor" 4) "tag:twitch:topics"
I then deleted every entry that had twitch in it with:
> DEL ns:twitch_monitor:channel:11
I then installed the ns-twitch-monitor plugin and re-configured it. I suggest saving your Twich API key and the channels you were subscribed to somewhere to make it handy to re-populate after the installation.
-
@Nicolas I took your advice and un-installed your plugin. Deleted the twitch database entries and then installed and configured the plugin again. Alas, just as before I had a "crash" and re-start (3 times). This is the output of the initial crash that began the cycle (after removing the plugin, database entries delete, etc.):
30/8 16:42 [29744] - info: [plugins/twitch-monitor] Start monitoring of channels, delay is 30000 ms 30/8 17:46 [29744] - error: TypeError: Cannot call method 'forEach' of undefined at /usr/share/nodebb/PROD/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:74:37 at transform (/usr/share/nodebb/PROD/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:89:25) at /usr/share/nodebb/PROD/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:72:35 at fn (/usr/share/nodebb/PROD/node_modules/async/lib/async.js:746:34) at /usr/share/nodebb/PROD/node_modules/async/lib/async.js:1213:16 at /usr/share/nodebb/PROD/node_modules/async/lib/async.js:166:37 at /usr/share/nodebb/PROD/node_modules/async/lib/async.js:706:43 at /usr/share/nodebb/PROD/node_modules/async/lib/async.js:167:37 at /usr/share/nodebb/PROD/node_modules/async/lib/async.js:1209:30 at /usr/share/nodebb/PROD/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:48:13 TypeError: Cannot call method 'forEach' of undefined at /usr/share/nodebb/PROD/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:74:37 at transform (/usr/share/nodebb/PROD/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:89:25) at /usr/share/nodebb/PROD/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:72:35 at fn (/usr/share/nodebb/PROD/node_modules/async/lib/async.js:746:34) at /usr/share/nodebb/PROD/node_modules/async/lib/async.js:1213:16 at /usr/share/nodebb/PROD/node_modules/async/lib/async.js:166:37 at /usr/share/nodebb/PROD/node_modules/async/lib/async.js:706:43 at /usr/share/nodebb/PROD/node_modules/async/lib/async.js:167:37 at /usr/share/nodebb/PROD/node_modules/async/lib/async.js:1209:30 at /usr/share/nodebb/PROD/node_modules/nodebb-plugin-ns-twitch-monitor/plugin/twitch/api.js:48:13 30/8 17:46 [29744] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised. 30/8 17:46 [29744] - info: [app] Database connection closed. 30/8 17:46 [29744] - info: [app] Web server closed to connections. 30/8 17:46 [29744] - info: [app] Shutdown complete. [cluster] Child Process (29744) has exited (code: 1, signal: null) [cluster] Spinning up another process... 30/8 17:46 [30161] - info: Time: Tue Aug 30 2016 17:46:03 GMT-0600 (MDT)
If you would like additional information, such as my subscribed channels, etc., I will gladly provide it.
I do like this plugin and hope you will be able to find whatever it is that makes it unstable at times.
I am running NodeBB
v1.0.2
and nodebb-plugin-ns-twitch-monitor3.0.4
-
@rod said in [nodebb-plugin-ns-twitch-monitor] NS Twitch Monitor:
@Nicolas I took your advice and un-installed your plugin. Deleted the twitch database entries and then installed and configured the plugin again. Alas, just as before I had a "crash" and re-start (3 times). This is the output of the initial crash that began the cycle (after removing the plugin, database entries delete, etc.):
30/8 16:42 [29744] - info: [plugins/twitch-monitor] Start monitoring of channels, delay is 30000 ms 30/8 17:46 [29744] - error: TypeError: Cannot call method 'forEach' of undefined
I have the exact same problem, but it happens only sometimes.