Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
4.14k stars 554 forks source link

I believe version 5.82 bricked the whole server #1594

Closed GRIFFCOMMca closed 4 years ago

GRIFFCOMMca commented 4 years ago

-------- 7/10/2020, 2:00:24 AM ---- 0.5.82 --------

C:\Program Files\Open Source\MeshCentral\node_modules\express-ws\node_modules\ws\lib\websocket-server.js:311 for (const event of Object.keys(map)) server.on(event, map[event]); ^

TypeError: server.on is not a function at addListeners (C:\Program Files\Open Source\MeshCentral\node_modules\express-ws\node_modules\ws\lib\websocket-server.js:311:48) at new WebSocketServer (C:\Program Files\Open Source\MeshCentral\node_modules\express-ws\node_modules\ws\lib\websocket-server.js:74:31) at expressWs (C:\Program Files\Open Source\MeshCentral\node_modules\express-ws\lib\index.js:64:18) at serverStart (C:\Program Files\Open Source\MeshCentral\node_modules\meshcentral\webserver.js:4306:50) at C:\Program Files\Open Source\MeshCentral\node_modules\meshcentral\webserver.js:271:17 at C:\Program Files\Open Source\MeshCentral\node_modules\meshcentral\db.js:1141:107 at newArguments.(anonymous function) (C:\Program Files\Open Source\MeshCentral\node_modules\nedb\lib\executor.js:29:17) at Cursor.execFn (C:\Program Files\Open Source\MeshCentral\node_modules\nedb\lib\datastore.js:484:12) at callback (C:\Program Files\Open Source\MeshCentral\node_modules\nedb\lib\cursor.js:126:19) at C:\Program Files\Open Source\MeshCentral\node_modules\nedb\lib\cursor.js:193:12

Ylianst commented 4 years ago

What version of NodeJS are you using?

GRIFFCOMMca commented 4 years ago

How do i check? AND how would i upgrade it (it was installed as part of the Windows installer MeshCentral did)

Ylianst commented 4 years ago

Never mind, I am getting the same problem the TLSOffload is enabled, working on a fix now!! Should take a few minutes to figure out and test.

GRIFFCOMMca commented 4 years ago

version 11.10.1 (run the command "node -v" in the CMD in windows....

Good you found it... however as MeshCentral is not running, how would i upgrade from this damaged version? (i assume a command line)

Ylianst commented 4 years ago

As a temporary fix, edit the following file:

node_modules/meshcentral/webserver.js

Find this line:

obj.expressWs = require('express-ws')(obj.app, { wsOptions: { perMessageDeflate: (args.wscompression === true) } });

Change to this:

obj.expressWs = require('express-ws')(obj.app);

Your server should start again. You can then update to the next version when you want.

Ylianst commented 4 years ago

MeshCentral v0.5.83 is out with the fix for this! Thanks for the report.

GRIFFCOMMca commented 4 years ago

Changed the entry, server running, now updated to v0.5.83

Ylianst commented 4 years ago

It should be in:

C:\Program Files\Open Source\MeshCentral\node_modules\meshcentral\webserver.js

Ylianst commented 4 years ago

Another option is to download the updated file here:

https://raw.githubusercontent.com/Ylianst/MeshCentral/master/webserver.js

And overwrite your version of this file:

C:\Program Files\Open Source\MeshCentral\node_modules\meshcentral\webserver.js

You can also make the change above, result will be the same.

Ylianst commented 4 years ago

Ok, closing this as I think it's fixed. However, please re-open if needed.