mongo errors when starting (node server.js)
Opened this issue · 3 comments
Fresh install of Debian 11, fresh install of pisignage per instruction here. All prerequisites installed with latest versions. All went well, error free. MongoDB has vulnerabilities so ran FIX.
server.js stopping at this line with the following errors:
"mongoose.connect(config.mongo.uri, config.mongo.options,function(error)"
MongoParseError: option usemongoclient is not supported
at parseOptions (/home/scottg/pisignage-server/node_modules/mongodb/lib/connection_string.js:289:15)
at new MongoClient (/home/scottg/pisignage-server/node_modules/mongodb/lib/mongo_client.js:62:63)
at /home/scottg/pisignage-server/node_modules/mongoose/lib/connection.js:784:16
at new Promise (<anonymous>)
at NativeConnection.Connection.openUri (/home/scottg/pisignage-server/node_modules/mongoose/lib/connection.js:781:19)
at /home/scottg/pisignage-server/node_modules/mongoose/lib/index.js:340:10
at promiseOrCallback (/home/scottg/pisignage-server/node_modules/mongoose/lib/helpers/promiseOrCallback.js:10:12)
at Mongoose._promiseOrCallback (/home/scottg/pisignage-server/node_modules/mongoose/lib/index.js:1140:10)
at Mongoose.connect (/home/scottg/pisignage-server/node_modules/mongoose/lib/index.js:339:20)
at Object.<anonymous> (/home/scottg/pisignage-server/server.js:21:10)
config/env/development.js
'use strict';
module.exports = {
env: 'development',
https: false,
port: process.env.PORT || 3000,
mongo: {
uri: 'mongodb://localhost:27017/pisignage-server-dev' ,
options: {useMongoClient: true}
}
};
/etc/mongod.conf
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
# engine:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1
# how the process runs
processManagement:
timeZoneInfo: /usr/share/zoneinfo
I found the fix, commented out this line in config/env/development.js (this is deprecated in Mongo ver 5)
options: {useMongoClient: true}
I found the fix, commented out this line in config/env/development.js (this is deprecated in Mongo ver 5)
options: {useMongoClient: true}
Heya, I tried this and it worked for me perfectly, no more error. However now that the pisignage is running it shows a "Please wait while the app loads" only and nothing happens, no logs in the console either, do you have any idea why?
We did a update of code recently, can you check now?