colloqi/pisignage-server

Cannot start server because of db.connection.on error

Closed this issue · 15 comments

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

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

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

Hi jphoubion,

Have you solve this issue? I got the same problem

Thanks

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

I'm waiting too :D

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);
});

Hi colloqi,

I have tried but still not working, got same error

Thanks

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

Hi Colloqi,

Here is the error
image

and this is the configuration server.js
image

Thanks

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

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

Yes

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

Might want to take a look at this Automattic/mongoose#5399