Meteor error - Storing tasks in a collection [ SOLVED ]


#1

I am following the meteor site tutorial.

But when you add the line:

export const Tasks = new Mongo.Collection('tasks');

I get the following error:

/Users/user/.meteor/packages/meteor-tool/.1.4.1_2.fpzmec++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:313
						throw(ex);
						^
MongoError: failed to connect to server [localhost:27017] on first connect
    at Object.Future.wait (/Users/user/.meteor/packages/meteor-tool/.1.4.1_2.fpzmec++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:449:15)
    at new MongoConnection (packages/mongo/mongo_driver.js:216:27)
    at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:16)
    at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:10)
    at Object.defaultRemoteCollectionDriver (packages/underscore/underscore.js:750:1)
    at new Mongo.Collection (packages/mongo/collection.js:103:40)
    at meteorInstall.imports.api.tasks.js (imports/api/tasks.js:4:14)
    at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
    at Module.require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
    at Module.Mp.import (/Users/user/.meteor/packages/modules/.0.7.6_1.j54juu++os+web.browser+web.cordova/npm/node_modules/reify/lib/runtime.js:70:16)
    - - - - -
    at [object Object].<anonymous> (/Users/user/.meteor/packages/npm-mongo/.1.5.50.1g0yl8n++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/topologies/server.js:313:35)
    at emitOne (events.js:77:13)
    at [object Object].emit (events.js:169:7)
    at [object Object].<anonymous> (/Users/user/.meteor/packages/npm-mongo/.1.5.50.1g0yl8n++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/connection/pool.js:260:12)
    at [object Object].g (events.js:260:16)
    at emitTwo (events.js:87:13)
    at [object Object].emit (events.js:172:7)
    at Socket.<anonymous> (/Users/user/.meteor/packages/npm-mongo/.1.5.50.1g0yl8n++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/connection/connection.js:162:49)
    at Socket.g (events.js:260:16)
    at emitOne (events.js:77:13)
Exited with code: 1
Your application is crashing. Waiting for file change.

#2

Are do you start the app? Do you have a MONGO_URL environment variable defined?


#3

I have a variable configured environment. How do I set one? on mac?

But I tried to start an application using:

MONGO_URL = mongodb: //127.0.0.1: 27017 / tasks meteor run

But of all the same error. :frowning:


#4

How about you just meteor run in the directory of your Meteor application. When you set MONGO_URL environment variable, it means a mongo instance must be already running and the meteor command will not start one for you.


#5

Thank jamgold,

for some reason some db files were with .lock

to solve, I deleted the folder / data / db / and recreated again. He returned to work everything.

Thank you for attention.