Local MongoDB Connection issue using Meteor - meteor

I need to connect a Local MongoDB to Meteor. I did a "LeaderBoard" example in which I tried to connect to Local DB by using the below procedure:
meteor mongo lboard.meteor.com //Deploy project name is lboard.meteor.com
MongoDB shell version: 2.4.8
connecting to: production-db-b3.meteor.io:27017/lboard_meteor_com
then i try to switch DB using the below procedure:
> use lboard_meteor_com
//This time i got the below error
switched to db lboard_meteor_com
Thu Jan 23 15:09:42.125 trying reconnect to production-db-b3.meteor.io:27017
Thu Jan 23 15:09:48.127 reconnect production-db-b3.meteor.io:27017 failed couldn
't connect to server production-db-b3.meteor.io:27017
Also, I get an error in the server console as shown below and I am new to meteor so please have a look at the below and above error and tell me what to do.
Server Console Error Log & What i am did in server is:
C:\Users\***>e:
E:\>cd ***/meteor/db
E:\***\Meteor\DB>set MONGO_URL=mongodb://localhost:27017/ddhcare_meteor_co
m
E:\**\Meteor\DB>meteor
[[[[[ E:\***\Meteor\DB ]]]]]
=> Meteor server running on: http://localhost:3000/
W20140124-13:32:29.831(5.5)? (STDERR) C:\Users\***\AppData\Local\.meteor\packag
es\mongo-livedata\31700cb194\npm\node_modules\mongodb\lib\mongodb\mongo_client.j
s:359
W20140124-13:32:29.922(5.5)? (STDERR) throw err
W20140124-13:32:29.922(5.5)? (STDERR) ^
W20140124-13:32:29.924(5.5)? (STDERR) Error: failed to connect to [localhost:270
17]
W20140124-13:32:29.925(5.5)? (STDERR) at null.<anonymous> (C:\Users\Hari\App
Data\Local\.meteor\packages\mongo-livedata\31700cb194\npm\node_modules\mongodb\l
ib\mongodb\connection\server.js:540:74)
W20140124-13:32:29.925(5.5)? (STDERR) at EventEmitter.emit (events.js:106:17
)
W20140124-13:32:29.926(5.5)? (STDERR) at null.<anonymous> (C:\Users\Hari\App
Data\Local\.meteor\packages\mongo-livedata\31700cb194\npm\node_modules\mongodb\l
ib\mongodb\connection\connection_pool.js:140:15)
W20140124-13:32:29.926(5.5)? (STDERR) at EventEmitter.emit (events.js:98:17)
W20140124-13:32:29.927(5.5)? (STDERR) at Socket.<anonymous> (C:\Users\Hari\A
ppData\Local\.meteor\packages\mongo-livedata\31700cb194\npm\node_modules\mongodb
\lib\mongodb\connection\connection.js:478:10)
W20140124-13:32:29.927(5.5)? (STDERR) at Socket.EventEmitter.emit (events.js
:95:17)
W20140124-13:32:29.928(5.5)? (STDERR) at net.js:441:14
W20140124-13:32:29.928(5.5)? (STDERR) at process._tickCallback (node.js:415:
13)
=> Exited with code: 8
=> Meteor server restarted
W20140124-13:32:32.697(5.5)? (STDERR) C:\Users\Hari\AppData\Local\.meteor\packag
es\mongo-livedata\31700cb194\npm\node_modules\mongodb\lib\mongodb\mongo_client.j
s:359
W20140124-13:32:32.698(5.5)? (STDERR) throw err
W20140124-13:32:32.699(5.5)? (STDERR) ^
W20140124-13:32:32.700(5.5)? (STDERR) Error: failed to connect to [localhost:270
17]
W20140124-13:32:32.701(5.5)? (STDERR) at null.<anonymous> (C:\Users\Hari\App
Data\Local\.meteor\packages\mongo-livedata\31700cb194\npm\node_modules\mongodb\l
ib\mongodb\connection\server.js:540:74)
W20140124-13:32:32.701(5.5)? (STDERR) at EventEmitter.emit (events.js:106:17
)
W20140124-13:32:32.702(5.5)? (STDERR) at null.<anonymous> (C:\Users\Hari\App
Data\Local\.meteor\packages\mongo-livedata\31700cb194\npm\node_modules\mongodb\l
ib\mongodb\connection\connection_pool.js:140:15)
W20140124-13:32:32.703(5.5)? (STDERR) at EventEmitter.emit (events.js:98:17)
W20140124-13:32:32.703(5.5)? (STDERR) at Socket.<anonymous> (C:\Users\Hari\A
ppData\Local\.meteor\packages\mongo-livedata\31700cb194\npm\node_modules\mongodb
\lib\mongodb\connection\connection.js:478:10)
W20140124-13:32:32.704(5.5)? (STDERR) at Socket.EventEmitter.emit (events.js
:95:17)
W20140124-13:32:32.705(5.5)? (STDERR) at net.js:441:14
W20140124-13:32:32.706(5.5)? (STDERR) at process._tickCallback (node.js:415:
13)
=> Exited with code: 8
=> Meteor server restarted
W20140124-13:32:35.495(5.5)? (STDERR) C:\Users\Hari\AppData\Local\.meteor\packag
es\mongo-livedata\31700cb194\npm\node_modules\mongodb\lib\mongodb\mongo_client.j
s:359
W20140124-13:32:35.497(5.5)? (STDERR) throw err
W20140124-13:32:35.498(5.5)? (STDERR) ^
W20140124-13:32:35.501(5.5)? (STDERR) Error: failed to connect to [localhost:270
17]
W20140124-13:32:35.505(5.5)? (STDERR) at null.<anonymous> (C:\Users\Hari\App
Data\Local\.meteor\packages\mongo-livedata\31700cb194\npm\node_modules\mongodb\l
ib\mongodb\connection\server.js:540:74)
W20140124-13:32:35.509(5.5)? (STDERR) at EventEmitter.emit (events.js:106:17
)
W20140124-13:32:35.513(5.5)? (STDERR) at null.<anonymous> (C:\Users\Hari\App
Data\Local\.meteor\packages\mongo-livedata\31700cb194\npm\node_modules\mongodb\l
ib\mongodb\connection\connection_pool.js:140:15)
W20140124-13:32:35.517(5.5)? (STDERR) at EventEmitter.emit (events.js:98:17)
W20140124-13:32:35.521(5.5)? (STDERR) at Socket.<anonymous> (C:\Users\Hari\A
ppData\Local\.meteor\packages\mongo-livedata\31700cb194\npm\node_modules\mongodb
\lib\mongodb\connection\connection.js:478:10)
W20140124-13:32:35.526(5.5)? (STDERR) at Socket.EventEmitter.emit (events.js
:95:17)
W20140124-13:32:35.529(5.5)? (STDERR) at net.js:441:14
W20140124-13:32:35.532(5.5)? (STDERR) at process._tickCallback (node.js:415:
13)
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.

If you want to use a local MongoDB instance you should instead set the MONGO_URL environment variable before starting meteor:
export MONGO_URL=mongodb://localhost:27017/dbname
meteor
To connect to the local MongoDB instance, you should also use the mongo shell rather than meteor mongo:
$ mongo dbname
MongoDB shell version: 2.4.9
connecting to: test
>

Related

I am Getting error while building meteor App

Build environment
Windows 8: command Shell ( running in admin mode )
Meteor
meteor --version
Meteor 1.7.0.3
Node
node -v
v10.15.1
Npm
npm -v
5.3.0
Erorr while build:
W20190205-13:02:24.727(5.5)? (STDERR) D:\murali\new OHIF\Viewers-master\Viewers-
master\OHIFViewer\node_modules\fibers\fibers.js:90
W20190205-13:02:24.771(5.5)? (STDERR) return f
n.apply(this, arguments);
W20190205-13:02:24.771(5.5)? (STDERR)
^
W20190205-13:02:24.772(5.5)? (STDERR)
W20190205-13:02:24.772(5.5)? (STDERR) Error: Cannot find module "fibers/future"
W20190205-13:02:24.772(5.5)? (STDERR) at Object.require (D:\murali\new OHIF\
Viewers-master\Viewers-master\OHIFViewer\.meteor\local\build\programs\server\boo
t.js:295:24)
W20190205-13:02:24.772(5.5)? (STDERR) at packages\meteor.js:261:20
W20190205-13:02:24.773(5.5)? (STDERR) at packages\meteor.js:431:4
W20190205-13:02:24.773(5.5)? (STDERR) at packages\meteor.js:1578:3
W20190205-13:02:24.773(5.5)? (STDERR) at D:\murali\new OHIF\Viewers-master\V
iewers-master\OHIFViewer\.meteor\local\build\programs\server\boot.js:411:36
W20190205-13:02:24.773(5.5)? (STDERR) at Array.forEach (<anonymous>)
W20190205-13:02:24.774(5.5)? (STDERR) at D:\murali\new OHIF\Viewers-master\V
iewers-master\OHIFViewer\.meteor\local\build\programs\server\boot.js:220:19
W20190205-13:02:24.775(5.5)? (STDERR) at D:\murali\new OHIF\Viewers-master\V
iewers-master\OHIFViewer\.meteor\local\build\programs\server\boot.js:471:5
W20190205-13:02:24.775(5.5)? (STDERR) at Function.run (D:\murali\new OHIF\Vi
ewers-master\Viewers-master\OHIFViewer\.meteor\local\build\programs\server\profi
le.js:510:12)
W20190205-13:02:24.775(5.5)? (STDERR) at D:\murali\new OHIF\Viewers-master\V
iewers-master\OHIFViewer\.meteor\local\build\programs\server\boot.js:470:11
=> Exited with code: 1
W20190205-13:02:34.215(5.5)? (STDERR) D:\murali\new OHIF\Viewers-master\Viewers-
master\OHIFViewer\node_modules\fibers\fibers.js:90
W20190205-13:02:34.215(5.5)? (STDERR) return fn.apply(this, arguments);
------------------

Using Meteor Cluster for microservice

Based on the simple implementation of Meteor Cluster MicroServices the doc I have this implementation for 2 services to communicate.
AppUI
export default CLUSTER_DISCOVERY_URL="mongodb://localhost:3000/meteor";
Cluster.connect(CLUSTER_DISCOVERY_URL);
Cluster.register('appui_service');
loggerService = Cluster.discoverConnection('logger_service');
LoggerService
export default CLUSTER_DISCOVERY_URL="mongodb://localhost:3300/meteor";
Cluster.connect(CLUSTER_DISCOVERY_URL);
Cluster.register('logger_service');
loggerService = Cluster.discoverConnection('appui_service');
As it is, AppiUI runs on port 3000, while LoggerService is on port 3300. When I tried, started the servers, I kept on getting this error log.
I20180719-10:17:27.259(1)? Cluster: connecting to 'mongodb' discovery backend
I20180719-10:17:27.260(1)? Cluster: with options: undefined
W20180719-10:17:27.274(1)? (STDERR) /Users/kehindeadeoya/.meteor/packages/meteor-tool/.1.7.0_3.w8zcf.uowlh++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:313
W20180719-10:17:27.274(1)? (STDERR) throw(ex);
W20180719-10:17:27.274(1)? (STDERR) ^
W20180719-10:17:27.275(1)? (STDERR)
W20180719-10:17:27.275(1)? (STDERR) Error: failed to connect to [localhost:27017]
W20180719-10:17:27.275(1)? (STDERR) at exports.ConnectionPool.<anonymous> (/Users/kehindeadeoya/.meteor/packages/meteorhacks_cluster/.1.6.9.y65r.xg1qe3++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/server.js:555:25)
W20180719-10:17:27.275(1)? (STDERR) at emitThree (events.js:136:13)
W20180719-10:17:27.275(1)? (STDERR) at exports.ConnectionPool.emit (events.js:217:7)
W20180719-10:17:27.275(1)? (STDERR) at exports.Connection.<anonymous> (/Users/kehindeadeoya/.meteor/packages/meteorhacks_cluster/.1.6.9.y65r.xg1qe3++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:156:15)
W20180719-10:17:27.276(1)? (STDERR) at emitTwo (events.js:126:13)
W20180719-10:17:27.276(1)? (STDERR) at exports.Connection.emit (events.js:214:7)
W20180719-10:17:27.276(1)? (STDERR) at Socket.<anonymous> (/Users/kehindeadeoya/.meteor/packages/meteorhacks_cluster/.1.6.9.y65r.xg1qe3++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/connection.js:534:10)
W20180719-10:17:27.276(1)? (STDERR) at emitOne (events.js:116:13)
W20180719-10:17:27.276(1)? (STDERR) at Socket.emit (events.js:211:7)
W20180719-10:17:27.277(1)? (STDERR) at emitErrorNT (internal/streams/destroy.js:64:8)
W20180719-10:17:27.277(1)? (STDERR) at _combinedTickCallback (internal/process/next_tick.js:138:11)
W20180719-10:17:27.277(1)? (STDERR) at process._tickDomainCallback (internal/process/next_tick.js:218:9)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.
I don't understand what the discovery backend means. Secondly, I want to use Meteor's default bundled Mongo for this test, not a stand-alone Mongo, what can I do to get pass this error?

Meteor Velocity testing with mocha fails after securing mongo with authorisation

After securing mongo with the --auth parameter, I get the following error message:
MongoError: not authorized on mocha to execute command { listIndexes: "users", cursor: {} }
mongo is on my local machine on the default port localhost:27017.
A google and stackexchange search reveals nothing similar, so any help with this would be appreciated.
Presumably all I need to do is give authorisation to whoever the user is on the 'mocha' db.
Who is the user?
The full stack trace:
W20150822-22:58:09.173(1)? (STDERR)
/Users/malcolm/.meteor/packages/velocity_meteor-tool/.1.1.3_2.1uk1vnq++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:278
W20150822-22:58:09.173(1)? (STDERR) throw(ex);
W20150822-22:58:09.173(1)? (STDERR) ^
W20150822-22:58:09.214(1)? (STDERR) MongoError: not authorized on mocha to execute command { listIndexes: "users", cursor: {} }
W20150822-22:58:09.214(1)? (STDERR) at Object.Future.wait (/Users/malcolm/.meteor/packages/velocity_meteor-tool/.1.1.3_2.1uk1vnq++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:398:15)
W20150822-22:58:09.214(1)? (STDERR) at [object Object].MongoConnection._ensureIndex (packages/mongo/mongo_driver.js:733:1)
W20150822-22:58:09.214(1)? (STDERR) at [object Object].Mongo.Collection._ensureIndex (packages/mongo/collection.js:620:1)
W20150822-22:58:09.215(1)? (STDERR) at Accounts.urls (packages/accounts-base/accounts_server.js:1309:1)
W20150822-22:58:09.215(1)? (STDERR) at /private/var/folders/3n/2yry_ys510q6dx0frpznpc4c0000z_/T/meteor-test-run15cht13/.meteor/local/build/programs/server/packages/accounts-base.js:1616:4
W20150822-22:58:09.215(1)? (STDERR) at /private/var/folders/3n/2yry_ys510q6dx0frpznpc4c0000z_/T/meteor-test-run15cht13/.meteor/local/build/programs/server/packages/accounts-base.js:1659:3
W20150822-22:58:09.215(1)? (STDERR) at /private/var/folders/3n/2yry_ys510q6dx0frpznpc4c0000z_/T/meteor-test-run15cht13/.meteor/local/build/programs/server/boot.js:222:10
W20150822-22:58:09.215(1)? (STDERR) at Array.forEach (native)
W20150822-22:58:09.215(1)? (STDERR) at Function._.each._.forEach (/Users/malcolm/.meteor/packages/velocity_meteor-tool/.1.1.3_2.1uk1vnq++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150822-22:58:09.215(1)? (STDERR) at /private/var/folders/3n/2yry_ys510q6dx0frpznpc4c0000z_/T/meteor-test-run15cht13/.meteor/local/build/programs/server/boot.js:117:5
W20150822-22:58:09.215(1)? (STDERR) - - - - -
W20150822-22:58:09.216(1)? (STDERR) at Object.toError (/Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/utils.js:114:11)
W20150822-22:58:09.216(1)? (STDERR) at /Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/db.js:1194:31
W20150822-22:58:09.216(1)? (STDERR) at /Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/db.js:1903:9
W20150822-22:58:09.216(1)? (STDERR) at Server.Base._callHandler (/Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/base.js:453:41)
W20150822-22:58:09.216(1)? (STDERR) at /Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/server.js:487:18
W20150822-22:58:09.216(1)? (STDERR) at [object Object].MongoReply.parseBody (/Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
W20150822-22:58:09.216(1)? (STDERR) at [object Object].<anonymous> (/Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/server.js:445:20)
W20150822-22:58:09.216(1)? (STDERR) at [object Object].emit (events.js:95:17)
W20150822-22:58:09.216(1)? (STDERR) at [object Object].<anonymous> (/Users/malcolm/.meteor/packages/mongo/.1.1.0.1ruc6ua++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13)
W20150822-22:58:09.217(1)? (STDERR) at [object Object].emit (events.js:98:17)
The answer seems obvious now that I've worked it out.
The user who cannot read the mocha db is the user in the MONGO_URL, which in this example is myUser
export MONGO_URL="mongodb://myUser:password#localhost/mydb/?authSource=admin"
You have to give myUser a readWrite role for both your production db (mydb in this example) and to the mocha db.

Meteor - errors after upgrading

Hi received the following error after upgrading to latest version:
W20150112-12:30:33.785(-5)? (STDERR)
W20150112-12:30:33.788(-5)? (STDERR) /Users/chazmee/.meteor/packages/meteor-tool/.1.0.37.1c4ifox++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:173
W20150112-12:30:33.788(-5)? (STDERR) throw(ex);
W20150112-12:30:33.788(-5)? (STDERR) ^
W20150112-12:30:33.789(-5)? (STDERR) ReferenceError: Router is not defined
W20150112-12:30:33.789(-5)? (STDERR) at app/lib/router.js:1:36
W20150112-12:30:33.789(-5)? (STDERR) at app/lib/router.js:69:3
W20150112-12:30:33.789(-5)? (STDERR) at /Users/chazmee/placelist/.meteor/local/build/programs/server/boot.js:175:10
W20150112-12:30:33.789(-5)? (STDERR) at Array.forEach (native)
W20150112-12:30:33.790(-5)? (STDERR) at Function..each..forEach (/Users/chazmee/.meteor/packages/meteor-tool/.1.0.37.1c4ifox++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150112-12:30:33.790(-5)? (STDERR) at /Users/chazmee/placelist/.meteor/local/build/programs/server/boot.js:86:5
=> Exited with code: 8
Based on the error, it looks like you have a Router declaration, but it isn't defined. I would recommend installing iron router:
meteor add iron:router
Then reload your app.

Trying to run Meteor after updating to 0.9.4 on ubuntu getting errors like TypeError: Cannot call method 'add' of undefined

I am new-bee to meteor, i am struggling to run this.
kanna#kanna-VPCEB3QFX:~/Desktop/testhtml5/testhtml5/testHTML$ sudo meteor
[sudo] password for kanna:`enter code here`
[[[[[ ~/Desktop/testrschtml5/rschtml5/testHTML ]]]]]
=> Started proxy.
=> Started MongoDB.
W20141017-13:19:19.659(5.5)? (STDERR)
W20141017-13:19:19.737(5.5)? (STDERR) /home/kanna/.meteor/packages/meteor-tool/.1.0.34.1atmdl8++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
W20141017-13:19:19.738(5.5)? (STDERR) throw(ex);
W20141017-13:19:19.739(5.5)? (STDERR) ^
W20141017-13:19:19.739(5.5)? (STDERR) TypeError: Cannot call method 'add' of undefined
W20141017-13:19:19.739(5.5)? (STDERR) at app/server/route.js:8:15
W20141017-13:19:19.740(5.5)? (STDERR) at app/server/route.js:930:3
W20141017-13:19:19.740(5.5)? (STDERR) at /home/kanna/Desktop/testhtml5/testhtml5/testHTML/.meteor/local/build/programs/server/boot.js:168:10
W20141017-13:19:19.740(5.5)? (STDERR) at Array.forEach (native)
W20141017-13:19:19.741(5.5)? (STDERR) at Function..each..forEach (/home/kanna/.meteor/packages/meteor-tool/.1.0.34.1atmdl8++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
W20141017-13:19:19.741(5.5)? (STDERR) at /home/kanna/Desktop/rschtml5/rschtml5/testhtml5/.meteor/local/build/programs/server/boot.js:82:5
=> Exited with code: 8
The code for route.js is
Meteor.Router.add({
'/output/login': function () {
/some thing here
}

Resources