NodeBB-Community / nodebb-plugin-shoutbox

NodeBB Shoutbox plugin
MIT License
31 stars 34 forks source link

Upgrade from 0.2.x to 0.3.0 is not possible #84

Closed Benderwan closed 8 years ago

Benderwan commented 8 years ago

It seems like updating from 0.2 to 0.3 is not compatible, the shoutbox does no longer work after updating the plugin. I thought first that it had to do with my github remote repository which would keep two instances of the plugin, but after I properly removed the previous version, only keeping the new one, reactivating it in NodeBB, when launching the home page, the widget is loaded :smile: but the chat does not load, and let's say ~= 1 second after the widget appeared, the NodeBB "forum is offline" spinning wheel appears, and the chat never loads. Messages are sent successfully, but never displayed (In facts, I downgraded to 0.2 and I saw my "test messages").

I can do whatever manipulation you want to help you debug this :smile:

Schamper commented 8 years ago

Any logs would help :)

Benderwan commented 8 years ago

For sure, let me check that

(It is an openshift log, is it Ok ?)

Benderwan commented 8 years ago
DEBUG: Starting child process with 'node app.js'*************************
/var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/app.js:32
    Welcome to Oconfig['socket.io'].address = 'ws://unisyl.tk:8000';
                                            ^
TypeError: Cannot set property 'address' of undefinedapplications.
    at /var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/app.js:
32:31!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!
    at Object.<anonymous> (/var/lib/openshift/56192cf589f5cf74d5000166/app-root/
runtime/repo/app.js:74:3)our application.  Proceed with care!
    at Module._compile (module.js:456:26) application with "rhc app delete"
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)MPORTANT !!!
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:929:3
DEBUG: Program node app.js exited with code 85000166]\> cd app-root/logs
DEBUG: Starting child process with 'node app.js'
/var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/app.js:32
[nodebb-titouan.config['socket.io'].address = 'ws://unisyl.tk:8000';
♀                                           ^
TypeError: Cannot set property 'address' of undefined
    at /var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/app.js:
32:31
    at Object.<anonymous> (/var/lib/openshift/56192cf589f5cf74d5000166/app-root/
runtime/repo/app.js:74:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:929:3
DEBUG: Program node app.js exited with code 8
DEBUG: Starting child process with 'node app.js'
/var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/app.js:32

Just one thing, the Socket.Io is something which was already happening before but there is a small workaround in my code and it worked great before. Might it be the cause of the issue ?

This is the end of my Openshift log file, as you can see it restarts causing the spinning loader

DEBUG: Program node app.js exited with code 8
DEBUG: Starting child process with 'node app.js'

Some more precisions : when disabling the widget, I am not having the issue (spinning wheel ~= 1s after page load) so I think it is related to this.

Here is my app.js file https://gist.github.com/Benderwan/cb1a61f6c694b07b9978

Schamper commented 8 years ago

I need the actual NodeBB log, this is pretty useless.

Benderwan commented 8 years ago

Hi ! Sorry for this quite late answer, but I had some troubles getting the log :smile:

Here is the Nodebb log, I emptied it and ran only once the page so it would be quite shorter while having the informations.

90.44.252.120 - - [26/Nov/2015:19:06:23 +0000] "GET /language/fr/global.json?v=f0a443e0-7455-4287-aa4b-9174c057af03 HTTP/1.1" 200 - "http://unisyl.tk/admin/advanced/logs" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
90.44.252.120 - - [26/Nov/2015:19:06:26 +0000] "GET / HTTP/1.1" 200 - "http://unisyl.tk/admin/extend/widgets" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
io: 1 emit [ 'disconnect',
  { reason: 'transport close',
    rooms: [ 'dpbfumY4eSqUPd6JAAAB', 'uid_1', 'online_users' ] } ]
90.44.252.120 - - [26/Nov/2015:19:06:26 +0000] "GET /stylesheet.css?f0a443e0-7455-4287-aa4b-9174c057af03 HTTP/1.1" 200 - "http://unisyl.tk/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
90.44.252.120 - - [26/Nov/2015:19:06:26 +0000] "GET /uploads/system/site-logo.png HTTP/1.1" 304 - "http://unisyl.tk/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
90.44.252.120 - - [26/Nov/2015:19:06:26 +0000] "GET /nodebb.min.js?f0a443e0-7455-4287-aa4b-9174c057af03 HTTP/1.1" 200 - "http://unisyl.tk/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
io: 1 emit [ 'event:connect' ]
io: 1 emit [ 'event:user_status_change', { uid: 1, status: 'online' } ]
90.44.252.120 - - [26/Nov/2015:19:06:27 +0000] "GET /vendor/fontawesome/fonts/fontawesome-webfont.woff2?v=4.3.0 HTTP/1.1" 304 - "http://unisyl.tk/stylesheet.css?f0a443e0-7455-4287-aa4b-9174c057af03" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
90.44.252.120 - - [26/Nov/2015:19:06:27 +0000] "GET /markdown/config HTTP/1.1" 304 - "http://unisyl.tk/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
90.44.252.120 - - [26/Nov/2015:19:06:27 +0000] "GET /api/widgets/render?v=f0a443e0-7455-4287-aa4b-9174c057af03&locations%5B%5D=sidebar&locations%5B%5D=footer&locations%5B%5D=header&template=categories.tpl&url= HTTP/1.1" 200 - "http://unisyl.tk/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
90.44.252.120 - - [26/Nov/2015:19:06:28 +0000] "GET /vendor/jquery/timeago/locales/jquery.timeago.fr.js?_=1448564774343 HTTP/1.1" 200 451 "http://unisyl.tk/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
90.44.252.120 - - [26/Nov/2015:19:06:28 +0000] "GET /language/fr/language.json?v=f0a443e0-7455-4287-aa4b-9174c057af03 HTTP/1.1" 200 60 "http://unisyl.tk/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
90.44.252.120 - - [26/Nov/2015:19:06:28 +0000] "GET /src/client/categories.js?f0a443e0-7455-4287-aa4b-9174c057af03 HTTP/1.1" 200 - "http://unisyl.tk/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
90.44.252.120 - - [26/Nov/2015:19:06:28 +0000] "GET /templates/shoutbox/features/gist.tpl?v=f0a443e0-7455-4287-aa4b-9174c057af03 HTTP/1.1" 200 894 "http://unisyl.tk/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
90.44.252.120 - - [26/Nov/2015:19:06:28 +0000] "GET /vendor/jquery/timeago/locales/jquery.timeago.fr-short.js?_=1448564774344 HTTP/1.1" 200 359 "http://unisyl.tk/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
90.44.252.120 - - [26/Nov/2015:19:06:28 +0000] "GET /language/fr/markdown.json?v=f0a443e0-7455-4287-aa4b-9174c057af03 HTTP/1.1" 304 - "http://unisyl.tk/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
io: 1 emit [ 'query:chats.sync', {}, [Function] ]
26/11 14:06 [197922] - error: TypeError: Object #<Object> has no method 'getUsersFields'
    at /var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/node_modules/nodebb-plugin-shoutbox/lib/shouts.js:68:15
    at /var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/node_modules/redis/index.js:1138:13
    at try_callback (/var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/node_modules/redis/index.js:573:9)
    at RedisClient.return_reply (/var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/node_modules/redis/index.js:661:13)
    at ReplyParser.<anonymous> (/var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/node_modules/redis/index.js:309:14)
    at ReplyParser.emit (events.js:95:17)
    at ReplyParser.send_reply (/var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/node_modules/redis/lib/parser/javascript.js:300:10)
    at ReplyParser.execute (/var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/node_modules/redis/lib/parser/javascript.js:211:22)
    at RedisClient.on_data (/var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/node_modules/redis/index.js:534:27)
    at Socket.<anonymous> (/var/lib/openshift/56192cf589f5cf74d5000166/app-root/runtime/repo/node_modules/redis/index.js:91:14)
[cluster] Child Process (197922) has exited (code: 1, signal: null)
[cluster] Spinning up another process...
26/11 14:06 [201004] - info: Time: Thu Nov 26 2015 14:06:28 GMT-0500 (EST)
26/11 14:06 [201004] - info: Initializing NodeBB v0.8.2

26/11 14:06 [201004] - warn: [plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run `./nodebb reset -p PLUGINNAME` to disable it.
  * nodebb-plugin-shoutbox

26/11 14:06 [201004] - info: [plugins/spam-be-gone] Settings loaded
26/11 14:06 [201004] - info: NodeBB Ready
26/11 14:06 [201004] - info: Enabling 'trust proxy'
26/11 14:06 [201004] - info: NodeBB is now listening on: 127.12.71.129:8080
io: 1 emit [ 'event:connect' ]
io: 1 emit [ 'event:user_status_change', { uid: 1, status: 'online' } ]
io: 1 emit [ 'event:connect' ]
io: 1 emit [ 'event:user_status_change', { uid: 1, status: 'online' } ]
Schamper commented 8 years ago

The problem is that you're running NodeBB version 0.8.2. Currently the shoutbox is only compatible with version 0.9.x.

Benderwan commented 8 years ago

Ok ! Thank you for that quick reply ! Might be great if you specified the minimum version of NodeBB for 0.3 though :wink:

Anyway thank you very much for your help !

Schamper commented 8 years ago

The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset -p PLUGINNAME to disable it.

  • nodebb-plugin-shoutbox

It should also tell you in the NodeBB admin panel that it's not compatible.

Benderwan commented 8 years ago

Well it did not show up at all, but this might be related to a core NodeBB module bug :)