Open micahstubbs opened 5 years ago
ah! I think this means that the server cannot connect to a running instance of MongoDb ð¡
// server.js
MongoClient.connect(
mongoUrl,
function(err, db) {
var users = db.collection('users')
let's try a
brew upgrade mongodb
hi former self ð
did you ever solve this one? ð
â blockbuilder git:(master) brew upgrade mongodb
Error: mongodb: unknown version :mountain_lion
https://superuser.com/questions/1478156/error-mongodb-unknown-version-mountain-lion
ah hah!
brew services stop mongodb
brew uninstall mongodb
brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb-community
upgrading our mongodb
nodejs dependency and fixing the errors as I go:
https://www.npmjs.com/package/mongodb https://github.com/mongodb/node-mongodb-native/blob/HEAD/CHANGES_3.0.0.md https://stackoverflow.com/questions/56625122/typeerror-connect-only-accepts-a-callback
here's what I see now:
â blockbuilder git:(micah/243/mongodb-error) â node server.js
error with https files Error: ENOENT: no such file or directory, open '/Users/m/workspace/blockbuilder/sslcert/privkey.pem'
at Object.openSync (fs.js:457:3)
at Object.readFileSync (fs.js:359:35)
at Object.<anonymous> (/Users/m/workspace/blockbuilder/server.js:25:19)
at Module._compile (internal/modules/cjs/loader.js:1144:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
at Module.load (internal/modules/cjs/loader.js:993:32)
at Function.Module._load (internal/modules/cjs/loader.js:892:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/Users/m/workspace/blockbuilder/sslcert/privkey.pem'
}
express-session deprecated undefined resave option; provide resave option server.js:108:3
express-session deprecated undefined saveUninitialized option; provide saveUninitialized option server.js:108:3
Elasticsearch INFO: 2020-03-02T08:45:02Z
Adding connection to http://35.226.78.72:9200/
(node:5938) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
/Users/m/workspace/blockbuilder/node_modules/mongodb/lib/utils.js:720
throw error;
^
TypeError: Cannot read property 'db' of undefined
at /Users/m/workspace/blockbuilder/server.js:136:21
at /Users/m/workspace/blockbuilder/node_modules/mongodb/lib/utils.js:717:9
at /Users/m/workspace/blockbuilder/node_modules/mongodb/lib/mongo_client.js:222:23
at connectCallback (/Users/m/workspace/blockbuilder/node_modules/mongodb/lib/operations/connect.js:350:5)
at /Users/m/workspace/blockbuilder/node_modules/mongodb/lib/operations/connect.js:417:14
at Server.<anonymous> (/Users/m/workspace/blockbuilder/node_modules/mongodb/lib/topologies/server.js:230:11)
at Object.onceWrapper (events.js:428:26)
at Server.emit (events.js:321:20)
at Pool.<anonymous> (/Users/m/workspace/blockbuilder/node_modules/mongodb/lib/core/topologies/server.js:436:21)
This issue can be fixed in this way,
if you have modified your MongoDB model you need to create a new collection. because in the previous collection there is not created any new field and you may be still referencing that one.
therefore this error TypeError: Cannot read property 'collection' of null
Hey, how to create a new collection.I mean it is creating new collection.
@muhrizmrz Are you trying to spin up an instance of Blockbuilder?
steps to reproduce