Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongo errors when starting (node server.js) #145

Open
geokscott opened this issue Mar 4, 2022 · 3 comments
Open

mongo errors when starting (node server.js) #145

geokscott opened this issue Mar 4, 2022 · 3 comments

Comments

@geokscott
Copy link

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
@geokscott
Copy link
Author

geokscott commented Mar 5, 2022

I found the fix, commented out this line in config/env/development.js (this is deprecated in Mongo ver 5)

options: {useMongoClient: true}

@zerenxyz
Copy link

zerenxyz commented Apr 5, 2022

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?

@colloqi
Copy link
Owner

colloqi commented Jul 16, 2022

We did a update of code recently, can you check now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants