colloqi / pisignage-server

Local Server to manage piSignage players based on node.js
http://www.pisignage.com
MIT License
372 stars 153 forks source link

Cannot start server because of db.connection.on error #61

Closed jphoubion closed 4 years ago

jphoubion commented 6 years ago

Hi! I would like to try pisignage server, but when I start it with "node server.js", I've got the following error msg. pisignage

Could you tell me what happend?

Thanks for your help

colloqi commented 6 years ago

Make sure mongod is running and url is correct in config/env/development.js

jphoubion commented 6 years ago

Hi, Here is the result of **sudo service mongod status**

_jp@jp-vbox:~/pisignage-server$ sudo service mongod status ● mongod.service - MongoDB Database Server Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled) Active: active (running) since Mon 2018-11-05 12:57:08 CET; 7min ago Docs: https://docs.mongodb.org/manual Main PID: 5257 (mongod) CGroup: /system.slice/mongod.service └─5257 /usr/bin/mongod --config /etc/mongod.conf

nov 05 12:57:08 jp-vbox systemd[1]: Started MongoDB Database Server. nov 05 12:57:08 jp-vbox mongod[5257]: 2018-11-05T12:57:08.535+0100 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'_

And here is the content of the development.js file

_'use strict';

module.exports = { env: 'development', https: false, port: process.env.PORT || 3000, mongo: { uri: 'mongodb://localhost/pisignage-server-dev' } };_

I don't know what is wrong :-/

Thanks for your help

shihabulmilah commented 5 years ago

Hi jphoubion,

Have you solve this issue? I got the same problem

Thanks

jphoubion commented 5 years ago

Hi shihabulmilah , Unfortunatly no, so i gave up for the moment. I was waiting for an answer from the developer.

shihabulmilah commented 5 years ago

I'm waiting too :D

colloqi commented 5 years ago

Hello,

The error is because mongodb connection is not going through and db variable is not valid. in server.js can you change the line

mongoose.connect(config.mongo.uri, config.mongo.options);

to have an error callback as shown and see what error is thrown?

mongoose.connect(config.mongo.uri, config.mongo.options, function(err) { if (err) console.log(err); });

shihabulmilah commented 5 years ago

Hi colloqi,

I have tried but still not working, got same error

Thanks

colloqi commented 5 years ago

Can you share what error you are getting in step mongoose.connect ?

shihabulmilah commented 5 years ago

Hi Colloqi,

Here is the error image

and this is the configuration server.js image

Thanks

colloqi commented 5 years ago

Best way is one of us have a look at your server, if that is possible, please get in touch at support@pisignage.com

shihabulmilah commented 5 years ago

Okay, that possible remote and check my server, send email to support@pisignage.com?

colloqi commented 5 years ago

Yes

colloqi commented 5 years ago

in config/env/ directory, can you replace "localhost" with 127.0.0.1:27017 in files development.js, production.js and try? The error could be due to DNS failure

Rathius commented 5 years ago

Might want to take a look at this https://github.com/Automattic/mongoose/issues/5399

colloqi commented 5 years ago

More specifically https://github.com/Automattic/mongoose/issues/5399#issuecomment-322041860