Cannot start up existing Meteor application - meteor

I have an existing Meteor app that appears to have crashed today. I re-ran meteor in terminal and it proceeds to run meteor but it’s not picking up correct db we are using in mongodb. When I run
MONGO_URL=mongodb://dbuser:dbpass#127.0.0.1/db meteor run it proceeds to build the application but then exits with a code:8. Then it just loops back to creating the application again and selecting package versions. Then when I visit our URL in the browser for the site, I’m getting the following error:
“It looks like you are trying to access MongoDB over HTTP on the native driver port.”
Not sure how to get this app back up and running so any help/suggestions would be appreciated. So short story is we had this running yesterday but then it crashed and now I can’t get the app running again. The db is intact and the collection we use is present in the db. The app code for meteor is all in place. I’m just having problems starting up the app again. The app is hosted in AWS CentOS server running Apache.
Detailed error that I'm seeing when trying to run the app:
/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20171114-03:34:08.618(0)? (STDERR) throw(ex);
W20171114-03:34:08.618(0)? (STDERR) ^
W20171114-03:34:08.618(0)? (STDERR) TypeError: Object #<Object> has no method 'describe'
W20171114-03:34:08.618(0)? (STDERR) at app/server/packages/npm-container/package.js:4:9
W20171114-03:34:08.619(0)? (STDERR) at app/server/packages/npm-container/package.js:25:3
W20171114-03:34:08.619(0)? (STDERR) at /var/www/mongo-parcc-user/parcc-meteor/.meteor/local/build/programs/server/boot.js:222:10
W20171114-03:34:08.619(0)? (STDERR) at Array.forEach (native)
W20171114-03:34:08.619(0)? (STDERR) at Function._.each._.forEach (/root/.meteor/packages/meteor-tool/.1.1.3.115udz9++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20171114-03:34:08.619(0)? (STDERR) at /var/www/mongo-parcc-user/parcc-meteor/.meteor/local/build/programs/server/boot.js:117:5
=> Exited with code: 8

Related

Meteor tutorials giving 'sanitizeForInObject' error

I have been using Meteor for years and have version 1.1 on my Mac. I have created a new directory, typed meteor update and checked that meteor --version gives Meteor 1.5.
Following the tutorial, I typed meteor create simple-todos, cd into it, and typed meteor.
But meteor crashes - see the error below. How can I get the tutorial running? I'd still like to be able to run my older Meteor 1.1 app too.
=> Started proxy.
=> Started MongoDB.
W20170605-21:34:04.700(10)? (STDERR) /Users/.../.meteor/packages/meteor-tool/.1.5.0.3kmr7i++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20170605-21:34:04.801(10)? (STDERR) throw(ex);
W20170605-21:34:04.801(10)? (STDERR) ^
W20170605-21:34:04.803(10)? (STDERR)
W20170605-21:34:04.803(10)? (STDERR) TypeError: Cannot read property 'sanitizeForInObject' of undefined
W20170605-21:34:04.804(10)? (STDERR) at [object Object].LocalCollection.insert (packages/minimongo/minimongo.js:569:3)
W20170605-21:34:04.805(10)? (STDERR) at [object Object].insert (packages/mongo/collection.js:524:37)
W20170605-21:34:04.805(10)? (STDERR) at updateVersions (packages/autoupdate.js:133:20)
W20170605-21:34:04.806(10)? (STDERR) at packages/autoupdate.js:197:3
W20170605-21:34:04.806(10)? (STDERR) at Function.time (/Users/.../Javascript/meteor/simple-todos/.meteor/local/build/programs/server/profile.js:309:28)
W20170605-21:34:04.807(10)? (STDERR) at /Users/.../Javascript/meteor/simple-todos/.meteor/local/build/programs/server/boot.js:347:13
W20170605-21:34:04.807(10)? (STDERR) at /Users/.../Javascript/meteor/simple-todos/.meteor/local/build/programs/server/boot.js:388:5
W20170605-21:34:04.808(10)? (STDERR) at Function.run (/Users/.../Javascript/meteor/simple-todos/.meteor/local/build/programs/server/profile.js:510:12)
W20170605-21:34:04.809(10)? (STDERR) at /Users/.../Javascript/meteor/simple-todos/.meteor/local/build/programs/server/boot.js:386:11
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.
I just had to re-install Meteor as described on https://www.meteor.com/install, and then it all worked fine. I could even run Meteor version 1.1 in one directory and version 1.6 in another.

Exited with code 8 # node_modules/fibers/futures.js

Adams-MacBook-Pro:faze1app adamhanna$ meteor
[[[[[ ~/Desktop/apps/temp/faze1App ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Meteor 1.3.5.1 is available. Update this project with 'meteor update'.
W20160722-07:52:52.466(-7)? (STDERR)
W20160722-07:52:52.468(-7)? (STDERR) /Users/adamhanna/.meteor/packages/meteor-tool/.1.3.2_4.1qxzz7q++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:300
W20160722-07:52:52.469(-7)? (STDERR) throw(ex);
W20160722-07:52:52.469(-7)? (STDERR) ^
W20160722-07:52:52.469(-7)? (STDERR) [object Object]
=> Exited with code: 8
The error doesn't tell me much, so it's hard to debug. It's only happening in this one project, so I'm sure it's project specific.
I've tried:
Uninstalling / reinstalling meteor
Updating meteor to the latest version
Meteor reset
This solution
This other solution
Is there anyway to get more info out of the error rather than [object Object]?
SOLVED
Ok, so this is my fault, but it would be nice if the error was more descriptive.
Essentially, I need to connect my app to multiple mongoDB's, so I have the following in my server code:
var myOtherDatabase = new MongoInternals.RemoteCollectionDriver("mongodb://myOtherMongoURI");
myOtherCollection = new Mongo.Collection('stuff', { _driver: myOtherDatabase });
I have ufw set up on that other mongoDB and forgot to allow access from my new ip. My app wasn't able to connect and was throwing an err.

TypeError: Object #<Object> has no method 'describe in Meteor

I have created a meteor app and cloned houston. I run meteor from the path app/houston, the following error appears.
TypeError: Object #<Object> has no method 'describe'
W20150316-16:02:33.273(5.5)? (STDERR) at app/houston/package.js:3:9
W20150316-16:02:33.273(5.5)? (STDERR) at app/houston/package.js:76:3
W20150316-16:02:33.273(5.5)? (STDERR) at /home/garima.wadhera/houston_app/.meteor/local/build/programs/server/boot.js:205:10
W20150316-16:02:33.273(5.5)? (STDERR) at Array.forEach (native)
W20150316-16:02:33.274(5.5)? (STDERR) at Function._.each._.forEach (/home/admin/.meteor/packages/meteor-tool/.1.0.41.yumiah++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150316-16:02:33.274(5.5)? (STDERR) at /home/garima.wadhera/houston_app/.meteor/local/build/programs/server/boot.js:116:5
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.
Where Am I making a mistake? Please guide.
For reference: houston code
The houston package at https://github.com/gterrono/houston is a meteor package not a meteor project. It runs if you add it as a package in an existing meteor project.
You have to add the package to another meteor project.
meteor create project
cd project
meteor add houston:admin
Then you can load it up at /admin on your web browser.
If you want to edit the code create a directory called packages clone the package into that and meteor remove houston:admin (if you added it above) and add it back with meteor add houston:admin (will add the local one)

Meteor with cloud9

When trying to run meteor in cloud9 I encounter one of the following errors:
Running the older modified version from cloud9 I get the error:
No dependency info in bundle. Filesystem monitoring disabled.
=> Errors prevented startup:
Exception while bundling application:
Error: Package not found: standard-app-packages
at self.api.use (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/tools/bundler.js:113:17)
at Array.forEach (native)
at Function._.each._.forEach (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
at Object.self.api.use (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/tools/bundler.js:110:9)
When I try running the lastest version, I get an error from cloud9:
Cloud9 Error: you may be using the wrong PORT & HOST for your server app
Node: use 'process.env.PORT' as the port and 'process.env.IP' as the host in your scripts. See also https://c9.io/site/blog/2013/05/can-i-use-cloud9-to-do-x/
In both cases, I clone the corresponding GitHub repository and run export BIND_IP=$IP as well as export PORT=20000 (as it is described in on several posts). I also gave up the hope using the default MongoDB server and am instead exporting MONGO_URL to a free database hosted on https://www.mongohq.com/.
I've also tried to merge the pull request from cloud9's meteor version to the master, but those files don't even exist anymore. Everything else I could find was about Meteor version 0.6.5 and 0.5
Trying to modify the latest Meteor-version I looked for the httpServer.listen call, but I found only one in meteor/packages/webapp/webapp_server.js, and it seems that the cloud9 error is thrown before that part of code is reached (if it is ever reached). So that there must be a another piece of code which is bound to the wrong address or port.
The plugins I use are:
standard-app-packages
insecure
preserve-inputs
underscore
backbone
jquery
accounts-ui
accounts-base
accounts-password
accounts-facebook
accounts-google
coffeescript
Update:
After some more hours looking for a solution, I got much further. The problem was in meteor/tools/run-proxy.js:
In line 94 you can see: self.server.listen(self.listenPort, function () { here is the corresponding IP-address missing to which the server should bind itself. Now meteor used to use an environmental variable BIND_IP which we could introduce here again, but this would have unnecessary additional changes on cloud9, since they export the current IP address to which a service should bind itself in the IP variable. So I changed the line in question to: self.server.listen(self.listenPort, process.env.IP, function () {
I've also additionally modified meteor/tools/run-all.js, since I wasn't sure if the correct port parameter is used. On line 24 I exchanged var listenPort = options.port; with var listenPort = process.env.PORT;
While I can now finally start the application, it is still not running and I'm getting the following output:
=> Running Meteor from a checkout -- overrides project version (0.7.2)
[[[[[ ~/<PROJECT_ID>/<PROJECT_NAME> ]]]]]
=> Started proxy.
W20140321-22:31:42.591(-4)? (STDERR)
W20140321-22:31:43.036(-4)? (STDERR) events.js:72
W20140321-22:31:43.037(-4)? (STDERR) throw er; // Unhandled 'error' event
W20140321-22:31:43.037(-4)? (STDERR) ^
Cloud9 Error: you may be using the wrong PORT & HOST for your server app
Node: use 'process.env.PORT' as the port and 'process.env.IP' as the host in your scripts. See also https://c9.io/site/blog/2013/05/can-i-use-cloud9-to-do-x/
W20140321-22:31:43.108(-4)? (STDERR) Error: listen EACCES
W20140321-22:31:43.109(-4)? (STDERR) at errnoException (net.js:901:11)
W20140321-22:31:43.109(-4)? (STDERR) at Server._listen2 (net.js:1020:19)
W20140321-22:31:43.111(-4)? (STDERR) at listen (net.js:1061:10)
W20140321-22:31:43.111(-4)? (STDERR) at net.js:1143:9
W20140321-22:31:43.112(-4)? (STDERR) at dns.js:72:18
W20140321-22:31:43.112(-4)? (STDERR) at process._tickCallback (node.js:415:13)
=> Exited with code: 8
However meteor doesn't crash and the exceptions keep coming in one after another. That's why I first thought, the exception is due to an authentication error on MongoDB, since also Error-Code 8 for MongoDB is authentication error, but this is what I get when I use an invalid username + password on my MongoHQ-hosted database:
[...]
=> Started proxy.
W20140321-22:54:17.282(-4)? (STDERR)
W20140321-22:54:18.700(-4)? (STDERR) /var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/mongo_client.js:400
W20140321-22:54:18.777(-4)? (STDERR) throw err
W20140321-22:54:18.778(-4)? (STDERR) ^
W20140321-22:54:18.778(-4)? (STDERR) MongoError: auth fails
W20140321-22:54:18.778(-4)? (STDERR) at Object.toError (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/utils.js:110:11)
W20140321-22:54:18.779(-4)? (STDERR) at /var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/auth/mongodb_cr.js:34:33
W20140321-22:54:18.779(-4)? (STDERR) at /var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/db.js:1670:9
W20140321-22:54:18.779(-4)? (STDERR) at Server.Base._callHandler (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/connection/base.js:382:41)
W20140321-22:54:18.780(-4)? (STDERR) at /var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/connection/server.js:472:18
W20140321-22:54:18.780(-4)? (STDERR) at MongoReply.parseBody (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
W20140321-22:54:18.780(-4)? (STDERR) at null.<anonymous> (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/connection/server.js:430:20)
W20140321-22:54:18.781(-4)? (STDERR) at EventEmitter.emit (events.js:95:17)
W20140321-22:54:18.781(-4)? (STDERR) at null.<anonymous> (/var/lib/stickshift/532a1c97500446885f0002a8/app-root/data/meteor/packages/mongo-livedata/.build/npm/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:191:13)
W20140321-22:54:18.782(-4)? (STDERR) at EventEmitter.emit (events.js:98:17)
=> Exited with code: 8
This error is thrown in meteor/packages/mongo-livedata/mongo_driver.js at line 149:
147: MongoDB.connect(url, mongoOptions, function(err, db) {
148: if (err)
149: throw err;
150: self.db = db;
This is also OK, however I couldn't find where the other error comes from, which occurs, when my credentials are correct.
I just ran into similar issues initially, but the latest version of Meteor (0.9.0) makes this easy at least.
meteor run --port=$IP:$PORT
Seems to do the trick (at least so far)
This is doc'd in
meteor help run
hth
Andy
Ok, so actually the first part of the question is the correct answer, if I hadn't done it the other way around:
BIND_IP is used within meteor/packages/webapp/webapp_server.js, but not in meteor/tools/run-proxy.js. However both need to bind to cloud9's 'IP'-variable.
So to solve this issue, simply update the proxy, similar as I did it, to use the correct IP-address: self.server.listen(self.listenPort, process.env.IP, function () {
and just write in your .bashrc export BIND_IP=$IP
now everything works smoothly (provided, that you use a mongodb outside of cloud9)
I've summarised the necessary steps in my blog: http://peter.grman.at/how-to-run-meteor-in-cloud9/
meteor works very nice in c9.io, i am working in c9.io with metor. just following the steps.
select workshop as nodejs.
in terminal write the command "curl https://install.meteor.com/ | sh"
in terminal write $ meteor create newapp(your main application folder name)
in terminal write cd newapp
in terminal write $ meteor -p 8080 (note -p or --port, if you using port as 300 that not working properly in c9.io . so you should using port as 8080 or 8081 or 8082)
after few seconds you get a link app running at: localhost:8080
click the link and open it.
Meteor 1.4:
At first, I tried a lot of different variations, with and without the --port flag mentioned in Andrew's answer.
If I only ran the meteor command without any flag, the app would successfully start on port 3000, but apparently that port can't be used in Cloud9 (https://docs.c9.io/docs/multiple-ports)
If I used the --port flag, meteor would just hang on "Starting your app"
Most likely something got stuck along the way (with all the retries), because what probably finally fixed it was to run a meteor reset before starting the app (Meteor application - Stuck at "Starting your app" when trying to run):
...$ sudo meteor reset
...$ sudo meteor --port=$IP:$PORT
If that doesn't help, I had also added some detailed logging on the attempt that finally worked (see this meteor forum post: Meteor stuck at starting your app). Try this if you're still stuck:
...$ sudo meteor reset
...$ METEOR_PROFILE=1
...$ METEOR_LOG=debug
...$ sudo meteor --port=$IP:$PORT --verbose
After it worked the first time, I can now start the app with only one command:
...$ sudo meteor --port=$IP:$PORT

Box2d-Web with Meteor

I want to use Box2D-Web with Meteorjs on both client and server side. I used this in nodejs. There was a small configuration that exports Box2D variable, and it was working with nodejs. The additional configuration was
exports.Box2D = Box2D;
at the bottom of the libary.
But I couldn't load it in meteor. I put the Box2D-web under lib directory in my project. But it gives an error and I still don't see what the problem is.
Here is what meteor saying;
W20140106-00:15:03.627(2)? (STDERR) /Users/ahmetdal/workspace/realhaxtmp/.meteor/local/build/programs/server/boot.js:186
W20140106-00:15:03.692(2)? (STDERR) }).run();
W20140106-00:15:03.692(2)? (STDERR) ^
W20140106-00:15:03.692(2)? (STDERR) TypeError: Cannot call method 'write' of undefined
W20140106-00:15:03.693(2)? (STDERR) at Console.log (console.js:53:16)
W20140106-00:15:03.694(2)? (STDERR) at Object.Meteor._debug (packages/meteor/debug.js:41)
W20140106-00:15:03.694(2)? (STDERR) at _.extend.publish (packages/livedata/livedata_server.js:1166)
W20140106-00:15:03.694(2)? (STDERR) at app/server/publications.js:7:12
W20140106-00:15:03.694(2)? (STDERR) at /Users/ahmetdal/workspace/realhaxtmp/.meteor/local/build/programs/server/boot.js:159:61
W20140106-00:15:03.694(2)? (STDERR) at Array.forEach (native)
W20140106-00:15:03.694(2)? (STDERR) at Function._.each._.forEach (/Users/ahmetdal/.meteor/tools/09b63f1ed5/lib/node_modules/underscore/underscore.js:79:11)
W20140106-00:15:03.695(2)? (STDERR) at /Users/ahmetdal/workspace/realhaxtmp/.meteor/local/build/programs/server/boot.js:159:5
There is not error about the Box2D-Web library. I tried to find any alternative meaning for the error but, I could not find anything either.
This error is being occurred when I put the library under lib folder under project root.
I did not put all code of library here. Because it really consists of too many lines of codes.
What additional configration in library can I do to apply it to Meteorjs?
Thank you!
Placing Javascript files like the Box2D-Web library in the lib folder in the root of your project will cause the code to be run on both the client and the server. The error occurs when the library gets run on the server.
To fix this, just place the library file into /client/lib/.

Resources