Fairly new to Meteor, however I am having some issues stopping my meteor application and restarting it.
The error I am running into is this:
/root/.meteor/packages/meteor-tool/.1.1.10.ki0ccv++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:245
throw(ex);
^
Error: Can't kill running mongo (pid 172).
at /tools/runners/run-mongo.js:310:11
at Array.forEach (native)
at Function._.each._.forEach (/root/.meteor/packages/meteor-tool/.1.1.10.ki0ccv++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
at findMongoAndKillItDead (/tools/runners/run-mongo.js:283:5)
at launchOneMongoAndWaitForReadyForInitiate (/tools/runners/run-mongo.js:400:7)
at launchMongo (/tools/runners/run-mongo.js:656:7)
at [object Object]._.extend._startOrRestart (/tools/runners/run-mongo.js:756:19)
at [object Object]._.extend.start (/tools/runners/run-mongo.js:714:10)
I tried to do kill -9 on the PID but that does not work, meteor reset did not solve the solution as well. I even went as far as to remove the /root/.meteor directory and the [appname] as well and started over again but the lock is still there.
Is there way around this? I was surprise as there was not really a meteor command to just stop meteor running and gracefully shut down.
Thanks
A ctrl+C from the shell where meteor is running is enough for close, it seems strange that kill -9 doesn't work with meteor.
However if this is your production application consider to use mup package from Aronuda to deploy your app it offers commands to deploy, start/stop/restart application and show logs.
Related
I am using Meteor 1.4.3.2 on a windows7 dev environment.
A Meteor application I have developed has been great for 6+ months but I have caused a problem by removing modules and apparently something I should not have.
Something outside the application folders (sym-link pointing into \AppData\Local.meteor.. somewhere) is missing/wrong, I think.
All other projects are fine, except this one.
All of my backup copies for this project are failing now too, including fresh clone from repo.
No 'meteor' commands will in this project, or it's backup copies, so 'meteor reset' is not an option.
The error is:
C:\Users\muser\iNotice>meteor
C:\Users\muser\AppData\Local\.meteor\packages\meteor-tool\1.4.3_2\mt-os.windows.
x86_32\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:190
throw error;
^
Error: EPERM: operation not permitted, unlink 'C:\Users\muser\iNotice\.meteor\lo
cal\dev_bundle'
at Error (native)
at Object.fs.unlinkSync (fs.js:932:18)
at exports.makeLink (C:\tools\cli\dev-bundle-links.js:20:8)
at [object Object]._.extend.ensureDevBundleLink (C:\tools\project-context.js
:1476:7)
at [object Object]._.extend._readFile (C:\tools\project-context.js:1410:10)
at new exports.ReleaseFile (C:\tools\project-context.js:1360:8)
at C:\tools\cli\main.js:898:22
Any suggestions on best approach to fix the application?
Thanks very much for your time and expertise.
Pick one of the following:
You can delete the content of your .meteor/local folder (repopulated next time you run > meteor)
Or call meteor as an admin
Or remove the read-only access on the dev_bundle folder (but Windows sets it back to read-only from time to time)
Thanks #n3squik!
Here are the actions I took which fixed my problem.
Remove folders:
C:\Users\muser\testApp\.meteor\local\dev_bundle*\*
C:\Users\muser\AppData\Local\.meteor\packages\meteor-tool\1.4.0-1\*
Ran:
C:\Users\muser\testApp> meteor run
The application started up and all seems good.
Thanks again Stack.
I get this Error when trying to start my application on my server with the command:
meteor
error:
Error: EISDIR: illegal operation on a directory, unlink '/home/.../.../myapp/.meteor /local/dev_bundle'
at Error (native)
at Object.fs.unlinkSync (fs.js:932:18)
at exports.makeLink (/tools/cli/dev-bundle-links.js:20:8)
at [object Object].ensureDevBundleLink (/tools/project-context.js:1416:7)
at [object Object]._readFile (/tools/project-context.js:1350:10)
at new exports.ReleaseFile (/tools/project-context.js:1300:8)
at /tools/cli/main.js:825:22
My app is running fine on my dev. win. machine.
I have no idea what is causing the error, please help.
I got it working by manually removing all directories and links where the name started with "dev_bundle" inside the "/.meteor/local" directory.
Hope this helps!
Also update meteor to the latest version using meteor update and then follow #henk's solution.
This worked for me.
Made complete clean install of Centos OpenVZ server running 7 minimal 64bit, 2 'slices' of VPS with 2Gb ram, 2 cpus, 2gb swap etc,
Installed virtualmin/webmin that is all, only configuration undertaken in iptables firewall,
No other apps or software installed, only yum update ran,
Then downloaded meteor using curl link,
followed instructions to letter and in /root/ ran meteor create command,
this created myapp then cd myapp into /myapp directory, ran meteor,
repeatedly crashes with this error message, Why??
Have searched web for answers and no one seems to know, this is a recurrent problem with meteor since 2013 and even before if you research web so why hasn't it been fixed? And why is it so difficult to get the software to run 'out of the box' its whole premise is its user friendliness and ability to save time, I would love to be able to use it and have signed up to some basic training so really need to get this working! It should not be this difficult! Especially when just running the tutorial app...
Thanks for any help and advice you can give,
[root#server myapp]# ls
myapp.css myapp.html myapp.js
[root#server myapp]# meteor
[[[[[ ~/myapp ]]]]]
=> Started proxy.
=> Started MongoDB.
/root/.meteor/packages/meteor-tool/.1.1.10.ki0ccv++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:245
throw(ex);
^
Error: spawn ENOMEM
at errnoException (child_process.js:1011:11)
at ChildProcess.spawn (child_process.js:958:11)
at Object.exports.spawn (child_process.js:746:9)
at [object Object]._.extend._spawn (/tools/runners/run-app.js:255:31)
at [object Object]._.extend.start (/tools/runners/run-app.js:85:22)
at [object Object]._.extend._runOnce (/tools/runners/run-app.js:716:16)
at [object Object]._.extend._fiber (/tools/runners/run-app.js:858:28)
at /tools/runners/run-app.js:396:12
[root#server myapp]#
top image not using any ram or resources
Stack Enomem is due to interaction between node.js and OpenVZ, I would highly recommend using KVM instead with CENTOS7 upgraded (at cost of only 2 dollars) and this memory problem went away,
For rest of problems with accessing web dev server see advice given to me on meteor forum,
https://forums.meteor.com/t/first-attempt-at-tutorial-app-crashes-on-execution/13920?u=tombranley
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
I decided to try out Meteor and found myself a tutorial to follow.
So as one does I googled "Meteor tutorials" and this one is at the top of the results list:
http://www.smashingmagazine.com/2013/06/13/build-app-45-minutes-meteor/
Hey all!
So - I start following the tutorial but as soon as I get to step 2 meteor isn't able to run my application anymore.
The log is as follows:
Your app is crashing. Here's the latest log.
W2047-00:56:09.699(0)? (STDERR) /home/vidirr/.meteor/packages/mongo- livedata/45bb567dec/npm/node_modules/mongodb/lib/mongodb/mongo_client.js:359
W2047-00:56:09.700(0)? (STDERR) throw err
W2047-00:56:09.700(0)? (STDERR) ^
W2047-00:56:09.702(0)? (STDERR) Error: failed to connect to [127.0.0.1:3002]
W2047-00:56:09.704(0)? (STDERR) at null.<anonymous> (/home/vidirr/.meteor/packages/mongo-livedata/45bb567dec/npm/node_modules/mongodb/lib/mongodb/connection/server.js:540:74)
W2047-00:56:09.704(0)? (STDERR) at EventEmitter.emit (events.js:106:17)
W2047-00:56:09.704(0)? (STDERR) at null.<anonymous> (/home/vidirr/.meteor/packages/mongo-livedata/45bb567dec/npm/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15)
W2047-00:56:09.705(0)? (STDERR) at EventEmitter.emit (events.js:98:17)
W2047-00:56:09.705(0)? (STDERR) at Socket.<anonymous> (/home/vidirr/.meteor/packages/mongo-livedata/45bb567dec/npm/node_modules/mongodb/lib/mongodb/connection/connection.js:478:10)
W2047-00:56:09.705(0)? (STDERR) at Socket.EventEmitter.emit (events.js:95:17)
W2047-00:56:09.705(0)? (STDERR) at net.js:441:14
W2047-00:56:09.706(0)? (STDERR) at process._tickCallback (node.js:415:13)
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.
I checked in the the IRC room but they hadn't heard of the problem before.
TL;DR:
I create a new app:
meteor create newApp
I change into the new directory and run the app:
cd newApp
meteor
Everything works fine.
I kill the app, and add two smart-packages to my app:
meteor add accounts-ui
meteor add accounts-twitter
-(also tried accounts-facebook, same results).
I start the app - and it crashes.
Info:
Running a 32-bit distribution of Arch.
HDD space is fine.
RAM usage is about 1GB of 3GB before starting app - don't see any spikes.
Nothing seems to be bound to port 3002, checked using netstat.
Tried manually running mongod before starting app - no change.
Tried creating multiple projects - no change.
Removed ~/.meteor, reinstalled meteor, started a new project - no change.
Basically - I'm stumped. Seeing that I haven't actually written any code at all, I'm kinda blaming this on something else.
And since the guys in the IRC channel didn't see anything wrong with those steps, I'm also blaming it on something else then the tutorial.
Any ideas?
Best regards,
Víðir
For formalities, I'll place it here then.
Try restarting the PC
There is something using port 3002 and is not releasing it or Meteor just can't use port 3002 for some reason. If you can't manage to get hold of what's holding port 3002, then restarting the PC should do.
I had the similar problem with the latest Meteor 1.0 installation on my OS X 10.9: any application crashed after adding ui-accounts. In my case some other libs were involved and simple restart had no effect. What I had to do is completely remove Meteor and then install it again.
rm -rf ~/.meteor
rm -rf /usr/local/bin/
curl https://install.meteor.com/ | sh