llaske / sugarizer-server

Sugarizer Server allow deployment of Sugarizer on a local server, for example on a school server.
Apache License 2.0
42 stars 92 forks source link

Setup Issue(branch - master) #81

Closed AvinashAgarwal14 closed 5 years ago

AvinashAgarwal14 commented 5 years ago

After building the application through docker, whenever I try to open neighbourhood view, the server throws an error and restarts. The details of the error are mentioned below, any help would be much appreciated.

Node: 10.4.1 Mongo: 4.0.6

/sugarizer-server/node_modules/websocket/lib/WebSocketConnection.js:730 server_1 | data = bufferFromString(data.toString(), 'utf8'); server_1 | ^ server_1 | server_1 | TypeError: utf8 is not a function server_1 | at Function.from (native) server_1 | at from (native) server_1 | at WebSocketConnection.sendUTF (/sugarizer-server/node_modules/websocket/lib/WebSocketConnection.js:730:12) server_1 | at WebSocketConnection. (/sugarizer-server/api/middleware/presence.js:108:20) server_1 | at emitOne (events.js:77:13) server_1 | at WebSocketConnection.emit (events.js:169:7) server_1 | at WebSocketConnection.processFrame (/sugarizer-server/node_modules/websocket/lib/WebSocketConnection.js:554:26) server_1 | at /sugarizer-server/node_modules/websocket/lib/WebSocketConnection.js:323:40 server_1 | at nextTickCallbackWith0Args (node.js:419:9) server_1 | at process._tickCallback (node.js:348:13) mongodb_1 | 2019-03-10T13:39:18.007+0000 [conn15] end connection 172.19.0.3:48286 (3 connections now open) mongodb_1 | 2019-03-10T13:39:18.016+0000 [conn13] end connection 172.19.0.3:47572 (2 connections now open) mongodb_1 | 2019-03-10T13:39:18.017+0000 [conn14] end connection 172.19.0.3:47574 (1 connection now open) mongodb_1 | 2019-03-10T13:39:18.016+0000 [conn12] end connection 172.19.0.3:47570 (2 connections now open) sugarizer-server_server_1 exited with code 1

NikhilM98 commented 5 years ago

@AvinashAgarwal14 maybe it's due to the deprecated dependencies on the master. You can refer to issue #18. Those dependencies were updated on dev. You can try switching to dev. The updates will be released in version 1.1

AvinashAgarwal14 commented 5 years ago

@NikhilM98 Thankyou for the response, but when I am using dev I am not even able to build the application. The error message is attached below.

mongodb_1 | 2019-03-10T14:06:30.919+0000 [conn1] end connection 172.19.0.3:59996 (0 connections now open) server_1 | FATAL ERROR, uncaught exception 'Unexpected token {' server_1 | SyntaxError: Unexpected token { server_1 | at exports.runInThisContext (vm.js:53:16) server_1 | at Module._compile (module.js:374:25) server_1 | at Object.Module._extensions..js (module.js:417:10) server_1 | at Module.load (module.js:344:32) server_1 | at Function.Module._load (module.js:301:12) server_1 | at Module.require (module.js:354:17) server_1 | at require (internal/module.js:12:17) server_1 | at Object. (/sugarizer-server/node_modules/express-validator/index.js:1:80) server_1 | at Module._compile (module.js:410:26) server_1 | at Object.Module._extensions..js (module.js:417:10) server_1 | npm WARN optional Skipping failed optional dependency /chokidar/fsevents: server_1 | npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.7 mongodb_1 | 2019-03-10T14:06:43.107+0000 [initandlisten] connection accepted from 172.19.0.3:60008 #2 (1 connection now open) mongodb_1 | 2019-03-10T14:06:43.122+0000 [conn2] end connection 172.19.0.3:60008 (0 connections now open) server_1 | FATAL ERROR, uncaught exception 'Unexpected token {' server_1 | SyntaxError: Unexpected token { server_1 | at exports.runInThisContext (vm.js:53:16) server_1 | at Module._compile (module.js:374:25) server_1 | at Object.Module._extensions..js (module.js:417:10) server_1 | at Module.load (module.js:344:32) server_1 | at Function.Module._load (module.js:301:12) server_1 | at Module.require (module.js:354:17) server_1 | at require (internal/module.js:12:17) server_1 | at Object. (/sugarizer-server/node_modules/express-validator/index.js:1:80) server_1 | at Module._compile (module.js:410:26) server_1 | at Object.Module._extensions..js (module.js:417:10) sugarizer-server_server_1 exited with code 255

llaske commented 5 years ago

Could you provide a detailed log of your complete installation process.

somtochiama commented 5 years ago

I get the same error too when I switch to the dev branch and run docker compose up. The master branch builds correctly. The only issue( on the master branch ) is when I switch to the neighborhood view. I see "Unable to connect to server". Inspecting the console in chrome dev tools shows this error: ""Web Socket Connection to 'ws://127:0.0.1:8039/' failed, Error in connection establishment: net: :ERR_CONNECTION_REFUSED"

AvinashAgarwal14 commented 5 years ago

@llaske I am attaching below a complete log of my installation. Please let me know how can I solve it, that would be very helpful.

Node: 10.4.1 Npm: 6.1.0 Docker: 18.06.1-ce, build e68fc7a

Log: log.txt

llaske commented 5 years ago

Sorry can't reproduce your issue, neither on branch master, neither on branch dev. Are you sure you've done following instructions:

git clone https://github.com/llaske/sugarizer
git clone https://github.com/llaske/sugarizer-server
cd sugarizer-server
sh generate-docker-compose.sh
docker-compose up -d
AvinashAgarwal14 commented 5 years ago

@llaske Thanks, re-installing docker and docker-compose seemed to have solved the problem. @SomtochiAma Try re-installing docker and docker-compose once.