Giter Site home page Giter Site logo

meteor-up-legacy's Introduction

Meteor Up

This version is no longer maintaining.
Mupx is the stable version.
New development is moved to here: https://github.com/kadirahq/meteor-up.

Production Quality Meteor Deployments

Meteor Up (mup for short) is a command line tool that allows you to deploy any Meteor app to your own server. It supports only Debian/Ubuntu flavours and Open Solaris at the moments. (PRs are welcome)

You can use install and use Meteor Up from Linux, Mac and Windows.

Screencast: How to deploy a Meteor app with Meteor Up (by Sacha Greif)

Table of Contents

Features

  • Single command server setup
  • Single command deployment
  • Multi server deployment
  • Environmental Variables management
  • Support for settings.json
  • Password or Private Key(pem) based server authentication
  • Access, logs from the terminal (supports log tailing)
  • Support for multiple meteor deployments (experimental)

Server Configuration

  • Auto-Restart if the app crashed (using forever)
  • Auto-Start after the server reboot (using upstart)
  • Stepdown User Privileges
  • Revert to the previous version, if the deployment failed
  • Secured MongoDB Installation (Optional)
  • Pre-Installed PhantomJS (Optional)

Installation

npm install -g mup

Creating a Meteor Up Project

mkdir ~/my-meteor-deployment
cd ~/my-meteor-deployment
mup init

This will create two files in your Meteor Up project directory:

  • mup.json - Meteor Up configuration file
  • settings.json - Settings for Meteor's settings API

mup.json is commented and easy to follow (it supports JavaScript comments).

Example File

{
  // Server authentication info
  "servers": [
    {
      "host": "hostname",
      "username": "root",
      "password": "password",
      // or pem file (ssh based authentication)
      //"pem": "~/.ssh/id_rsa",
      // Also, for non-standard ssh port use this
      //"sshOptions": { "port" : 49154 },
      // server specific environment variables
      "env": {}
    }
  ],

  // Install MongoDB on the server. Does not destroy the local MongoDB on future setups
  "setupMongo": true,

  // WARNING: Node.js is required! Only skip if you already have Node.js installed on server.
  "setupNode": true,

  // WARNING: nodeVersion defaults to 0.10.36 if omitted. Do not use v, just the version number.
  "nodeVersion": "0.10.36",

  // Install PhantomJS on the server
  "setupPhantom": true,

  // Show a progress bar during the upload of the bundle to the server.
  // Might cause an error in some rare cases if set to true, for instance in Shippable CI
  "enableUploadProgressBar": true,

  // Application name (no spaces).
  "appName": "meteor",

  // Location of app (local directory). This can reference '~' as the users home directory.
  // i.e., "app": "~/Meteor/my-app",
  // This is the same as the line below.
  "app": "/Users/arunoda/Meteor/my-app",

  // Configure environment
  // ROOT_URL must be set to https://YOURDOMAIN.com when using the spiderable package & force SSL
  // your NGINX proxy or Cloudflare. When using just Meteor on SSL without spiderable this is not necessary
  "env": {
    "PORT": 80,
    "ROOT_URL": "http://myapp.com",
    "MONGO_URL": "mongodb://arunoda:[email protected]:10023/MyApp",
    "MAIL_URL": "smtp://postmaster%40myapp.mailgun.org:[email protected]:587/"
  },

  // Meteor Up checks if the app comes online just after the deployment.
  // Before mup checks that, it will wait for the number of seconds configured below.
  "deployCheckWaitTime": 15
}

Setting Up a Server

mup setup

This will setup the server for the mup deployments. It will take around 2-5 minutes depending on the server's performance and network availability.

Deploying an App

mup deploy

This will bundle the Meteor project and deploy it to the server.

Additional Setup/Deploy Information

Deploy Wait Time

Meteor Up checks if the deployment is successful or not just after the deployment. By default, it will wait 10 seconds before the check. You can configure the wait time with the deployCheckWaitTime option in the mup.json

SSH keys with passphrase (or ssh-agent support)

This only tested with Mac/Linux

With the help of ssh-agent, mup can use SSH keys encrypted with a passphrase.

Here's the process:

  • First remove your pem field from the mup.json. So, your mup.json only has the username and host only.
  • Then start a ssh agent with eval $(ssh-agent)
  • Then add your ssh key with ssh-add <path-to-key>
  • Then you'll asked to enter the passphrase to the key
  • After that simply invoke mup commands and they'll just work
  • Once you've deployed your app kill the ssh agent with ssh-agent -k

Ssh based authentication with sudo

If your username is root, you don't need to follow these steps

Please ensure your key file (pem) is not protected by a passphrase. Also the setup process will require NOPASSWD access to sudo. (Since Meteor needs port 80, sudo access is required.)

Make sure you also add your ssh key to the /YOUR_USERNAME/.ssh/authorized_keys list

You can add your user to the sudo group:

sudo adduser *username*  sudo

And you also need to add NOPASSWD to the sudoers file:

sudo visudo

# replace this line
%sudo  ALL=(ALL) ALL

# by this line
%sudo ALL=(ALL) NOPASSWD:ALL  

When this process is not working you might encounter the following error:

'sudo: no tty present and no askpass program specified'

Server Setup Details

This is how Meteor Up will configure the server for you based on the given appName or using "meteor" as default appName. This information will help you customize the server for your needs.

  • your app lives at /opt/<appName>/app
  • mup uses upstart with a config file at /etc/init/<appName>.conf
  • you can start and stop the app with upstart: start <appName> and stop <appName>
  • logs are located at: /var/log/upstart/<appName>.log
  • MongoDB installed and bound to the local interface (cannot access from the outside)
  • the database is named <appName>

For more information see lib/taskLists.js.

Multiple Deployment Targets

You can use an array to deploy to multiple servers at once.

To deploy to different environments (e.g. staging, production, etc.), use separate Meteor Up configurations in separate directories, with each directory containing separate mup.json and settings.json files, and the mup.json files' app field pointing back to your app's local directory.

Custom Meteor Binary

Sometimes, you might be using mrt, or Meteor from a git checkout. By default, Meteor Up uses meteor. You can ask Meteor Up to use the correct binary with the meteorBinary option.

{
  ...
  "meteorBinary": "~/bin/meteor/meteor"
  ...
}

Access Logs

mup logs -f

Mup can tail logs from the server and supports all the options of tail.

Reconfiguring & Restarting

After you've edit environmental variables or settings.json, you can reconfigure the app without deploying again. Use the following command to do update the settings and restart the app.

mup reconfig

If you want to stop, start or restart your app for any reason, you can use the following commands to manage it.

mup stop
mup start
mup restart

Accessing the Database

You can't access the MongoDB from the outside the server. To access the MongoDB shell you need to log into your server via SSH first and then run the following command:

mongo appName

Server Specific Environment Variables

It is possible to provide server specific environment variables. Add the env object along with the server details in the mup.json. Here's an example:

{
  "servers": [
    {
      "host": "hostname",
      "username": "root",
      "password": "password",
      "env": {
        "SOME_ENV": "the-value"
      }
    }

  ...
}

By default, Meteor UP adds CLUSTER_ENDPOINT_URL to make cluster deployment simple. But you can override it by defining it yourself.

Multiple Deployments

Meteor Up supports multiple deployments to a single server. Meteor Up only does the deployment; if you need to configure subdomains, you need to manually setup a reverse proxy yourself.

Let's assume, we need to deploy production and staging versions of the app to the same server. The production app runs on port 80 and the staging app runs on port 8000.

We need to have two separate Meteor Up projects. For that, create two directories and initialize Meteor Up and add the necessary configurations.

In the staging mup.json, add a field called appName with the value staging. You can add any name you prefer instead of staging. Since we are running our staging app on port 8000, add an environment variable called PORT with the value 8000.

Now setup both projects and deploy as you need.

SSL Support

Meteor Up has the built in SSL support. It uses stud SSL terminator for that. First you need to get a SSL certificate from some provider. This is how to do that:

  • First you need to generate a CSR file and the private key
  • Then purchase a SSL certificate.
  • Then generate a SSL certificate from your SSL providers UI.
  • Then that'll ask to provide the CSR file. Upload the CSR file we've generated.
  • When asked to select your SSL server type, select it as nginx.
  • Then you'll get a set of files (your domain certificate and CA files).

Now you need combine SSL certificate(s) with the private key and save it in the mup config directory as ssl.pem. Check this guide to do that.

Then add following configuration to your mup.json file.

{
  ...

  "ssl": {
    "pem": "./ssl.pem",
    //"backendPort": 80
  }

  ...
}

Now, simply do mup setup and now you've the SSL support.

  • By default, it'll think your Meteor app is running on port 80. If it's not, change it with the backendPort configuration field.
  • SSL terminator will run on the default SSL port 443
  • If you are using multiple servers, SSL terminators will run on the each server (This is made to work with cluster)
  • Right now, you can't have multiple SSL terminators running inside a single server

Updating

To update mup to the latest version, just type:

npm update mup -g

You should try and keep mup up to date in order to keep up with the latest Meteor changes. But note that if you need to update your Node version, you'll have to run mup setup again before deploying.

Troubleshooting

Check Access

Your issue might not always be related to Meteor Up. So make sure you can connect to your instance first, and that your credentials are working properly.

Check Logs

If you suddenly can't deploy your app anymore, first use the mup logs -f command to check the logs for error messages.

One of the most common problems is your Node version getting out of date. In that case, see “Updating” section above.

Verbose Output

If you need to see the output of meteor-up (to see more precisely where it's failing or hanging, for example), run it like so:

DEBUG=* mup <command>

where <command> is one of the mup commands such as setup, deploy, etc.

Binary Npm Module Support

Some of the Meteor core packages as well some of the community packages comes with npm modules which has been written in C or C++. These modules are platform dependent. So, we need to do special handling, before running the bundle generated from meteor bundle. (meteor up uses the meteor bundle)

Fortunately, Meteor Up will take care of that job for you and it will detect binary npm modules and re-build them before running your app on the given server.

  • Meteor 0.9 adds a similar feature where it allows package developers to publish their packages for different architecures, if their packages has binary npm modules.
  • As a side effect of that, if you are using a binary npm module inside your app via meteorhacks:npm package, you won't be able to deploy into *.meteor.com.
  • But, you'll be able to deploy with Meteor Up since we are re-building binary modules on the server.

Additional Resources

meteor-up-legacy's People

Contributors

alexhancock avatar arunoda avatar batistleman avatar dandv avatar digilord avatar ffxsam avatar fvilers avatar guilhermedecampo avatar javdl avatar liebeskind avatar lijunle avatar manuel-schoebel avatar meonkeys avatar mugli avatar paolo avatar rhyslbw avatar rick-golden-healthagen avatar rootedsoftware avatar sachag avatar sanjosolutions avatar skarborg avatar stephentcannon avatar thani-sh avatar timbrandin avatar wizonesolutions avatar x5engine avatar zurawiki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteor-up-legacy's Issues

Mongo reset during deploy

Had an issue with a failed deploy resetting our Mongo database and I'd like to understand what caused this.

  • We have a production and staging environment
  • We had been deploying to production and staging successfully using separate mup scripts for many weeks.
  • For 2 weeks, we deployed exclusively to staging, no problems.
  • A few days ago, person A who had never deployed to production from their dev machine, attempted a deploy to production (the first in 2 weeks).
  • That deploy failed due to a silly issue with localhost in /etc/hosts. "Latest deployment failed! Reverted back to the previous version."
  • The old version continued running in production due to the failed deploy, but mongo was reset to our fixture data.
  • Several failed deploy attempts while we tried to fix this issue did not reset mongo again.
  • Resolved the deployment issue, new version deployed, mongo was not reset.

I've determined via our backups that it was reset during the first failed deployment. I do not think this is a bug, but what might the person have done during that first failed deployment attempt that caused mongo to be reset? Any help would be appreciated.

Not running on redhat based systems

I was trying to upload it on a dedicated server running redhat, and it did not work. I think it only works with debian based systems. If so can you please mention that in the readme file. Thanks.

Deployment false failure alert if PORT isn't 80

Hi,
meteor-up deployment gives a false alert that app didn't pick up if I use a different port than 80 in env variable, like this:

   "env": {
          "PORT": 3000
   } 

I have found the source of the problem. It is coming from the last line of templates/deploy.sh:

  curl localhost || revert_app

Maybe you need to check if a different $PORT has been used there and call curl with that complete url. Assigning 80 if nothing is set on $PORT and calling curl localhost:$PORT || revert_app would be easier I think.

errors with npm modules containing binaries

How does meteor up handle npm modules? Does it automatically install them like meteor on its own does or upload the project with the .npm directory?

I ran into this

[app]     at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/opt/meteor/app/programs/server/npm/ursa/main/node_modules/ursa/lib/ursa.js:18:18)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

The npm module referenced is ursa from https://github.com/Obvious/ursa

If I run the app ordinarily it works. It could be because the file referenced on that line is a binary node file

I ran npm install ursa in /opt/meteor/app/programs/server/npm/ursa/main on the server then ran mup deploy on my local machine to fix it

I also had a new npm-debug.log file in the project which had this at the end:

38 info install [email protected] into /usr/local/lib
39 info installOne [email protected]
40 verbose from cache /Users/tarang/.npm/ursa/0.8.0/package/package.json
41 info /usr/local/lib/node_modules/ursa unbuild
42 verbose read json /usr/local/lib/node_modules/ursa/package.json
43 verbose tar unpack /Users/tarang/.npm/ursa/0.8.0/package.tgz
44 silly lockFile ac5c3594--usr-local-lib-node-modules-ursa tar:///usr/local/lib/node_modules/ursa
45 verbose lock tar:///usr/local/lib/node_modules/ursa /Users/tarang/.npm/ac5c3594--usr-local-lib-node-modules-ursa.lock
46 silly lockFile c54ede5e-arang-npm-ursa-0-8-0-package-tgz tar:///Users/tarang/.npm/ursa/0.8.0/package.tgz
47 verbose lock tar:///Users/tarang/.npm/ursa/0.8.0/package.tgz /Users/tarang/.npm/c54ede5e-arang-npm-ursa-0-8-0-package-tgz.lock
48 silly gunzTarPerm modes [ '755', '644' ]
49 error Error: EACCES, mkdir '/usr/local/lib/node_modules/ursa'
49 error  { [Error: EACCES, mkdir '/usr/local/lib/node_modules/ursa']
49 error   errno: 3,
49 error   code: 'EACCES',
49 error   path: '/usr/local/lib/node_modules/ursa',
49 error   fstream_type: 'Directory',
49 error   fstream_path: '/usr/local/lib/node_modules/ursa',
49 error   fstream_class: 'DirWriter',
49 error   fstream_stack:
49 error    [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
49 error      '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
49 error      'Object.oncomplete (fs.js:107:15)' ] }
50 error Please try running this command again as root/Administrator.
51 error System Darwin 13.0.0
52 error command "node" "/usr/local/bin/npm" "install" "-g" "ursa"
53 error cwd /Users/tarang/Desktop/Zebra/zebra-core
54 error node -v v0.10.11
55 error npm -v 1.2.30
56 error path /usr/local/lib/node_modules/ursa
57 error fstream_path /usr/local/lib/node_modules/ursa
58 error fstream_type Directory
59 error fstream_class DirWriter
60 error code EACCES
61 error errno 3
62 error stack Error: EACCES, mkdir '/usr/local/lib/node_modules/ursa'
63 error fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
63 error fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
63 error fstream_stack Object.oncomplete (fs.js:107:15)
64 verbose exit [ 3, true ]

Not too sure why it wanted to install it globally though.

Error with "DISABLE_WEBSOCKETS": true

$ mup reconfig

Meteor-UP : Production Quality Meteor Deployments
--------------------------------------------------


Started TaskList: Updating Configurations
[162.243.213.202] setting up env vars

/usr/local/lib/node_modules/mup/node_modules/nodemiral/lib/taskList.js:163
    throw new Error('can only evaluate arrays and objects');
          ^
Error: can only evaluate arrays and objects
    at TaskList._evaluateOptions (/usr/local/lib/node_modules/mup/node_modules/nodemiral/lib/taskList.js:163:11)
    at TaskList._evaluateOptions (/usr/local/lib/node_modules/mup/node_modules/nodemiral/lib/taskList.js:158:29)
    at TaskList._evaluateOptions (/usr/local/lib/node_modules/mup/node_modules/nodemiral/lib/taskList.js:158:29)
    at TaskList._evaluateOptions (/usr/local/lib/node_modules/mup/node_modules/nodemiral/lib/taskList.js:158:29)
    at runTask (/usr/local/lib/node_modules/mup/node_modules/nodemiral/lib/taskList.js:89:26)
    at TaskList._runTaskQueue (/usr/local/lib/node_modules/mup/node_modules/nodemiral/lib/taskList.js:82:3)
    at /usr/local/lib/node_modules/mup/node_modules/nodemiral/lib/taskList.js:48:10
    at Array.forEach (native)
    at TaskList.run (/usr/local/lib/node_modules/mup/node_modules/nodemiral/lib/taskList.js:47:27)
    at Actions.reconfig (/usr/local/lib/node_modules/mup/lib/actions.js:78:12)

Bundling Error: code=-1, error:spawn ENOENT

I get the following error message when running mup deploy:

⚡ mup deploy

Meteor Up: Production Quality Meteor Deployments

Bundling Started: Users/Elie/Documents/Meteor/draftapp
Bundling Error: code=-1, error:spawn ENOENT
-------------------STDOUT-------------------

-------------------STDERR-------------------
chdir(): No such file or directory

How do I fix this? One of the closed issues is the same as this, but I'm not sure how to fix my problem. I think all the details I entered were correct.

Deploy failure : fibers

Cannot deploy app to server:

Started TaskList: Deploying meteor App
[188.226.181.67] uploading bundle
[188.226.181.67] uploading bundle: SUCCESS
[188.226.181.67] setting up env vars
[188.226.181.67] setting up env vars: SUCCESS
[188.226.181.67] invoking deployment process
[188.226.181.67] invoking deployment process: FAILED

    -----------------------------------STDERR-----------------------------------
    Warning: Permanently added '188.226.181.67' (ECDSA) to the list of known hosts.
    npm http GET https://registry.npmjs.org/fibers
    npm http 304 https://registry.npmjs.org/fibers
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) couldn't connect to host
    Latest deployment failed! Reverted back to the previous version.
    -----------------------------------STDOUT-----------------------------------

    > [email protected] install /opt/meteor/tmp/bundle/programs/server/node_modules/fibers
    > node ./build.js

    `linux-x64-v8-3.14` exists; testing
    Binary is fine; exiting
    [email protected] node_modules/fibers
    meteor stop/waiting
    meteor start/running, process 29147
    Waiting for MongoDB to initialize. (5 minutes)
    connected
    Waiting for 15 seconds while app is booting up
    Checking is app booted or not?
    meteor stop/waiting
    meteor start/running, process 29207
    ----------------------------------------------------------------------------

I have added package npm ( mrt add npm ) and filled package.json with:

{
  "parseUri":"1.2.3-2"
}

[email protected]

Any idea what is going on ?

Deploy fails at curl

I always get curl: (7) Failed to connect to localhost port 8080: Connection refused and
Latest deployment failed! Reverted back to the previous version. when running mup deploy.

  1. This happens on a clean install of Ubuntu 14.04 and 12.04.4.
  2. I had to do sudo apt-get install curl since mup setup did not install it.
  3. The App starts fine when running node main.js and exporting env vars on the server directly.
  4. I changed deployedCheckWaitTime to several minutes and it still happens.
  5. I also tried setting setupMongo and setupNode to false and installing recent versions manually.
  6. This also happens with example meteor apps.

Passphrase & password issues

Passphrase for my key not accepted (it's def correct), and then I need to enter my password many many times to do anything.

Quite irritating but a very useful tool nonetheless...

nginx

What about nginx as part of the setup with accompanying nginx conf files?

Deploy error can't connect to mongo db

So I had to move from meteor.sh to mup as meteor.sh is no longer working for latest meteor version.

I have set up mup, everything goes fine on deployment but in the end it gives me the error that it can't connect to mongo. Any ideas about what might be going wrong here?

The Error:
[54.215.253.100] ✘ Invoking deployment process: FAILED

-----------------------------------STDERR-----------------------------------
Warning: Permanently added '54.215.253.100' (RSA) to the list of known hosts.
npm http GET https://registry.npmjs.org/fibers
npm http 200 https://registry.npmjs.org/fibers

/usr/lib/node_modules/wait-for-mongo/bin/wait-for-mongo:14
    throw err;
          ^
Error: TIMEOUTED_WAIT_FOR_MONGO
    at null._onTimeout (/usr/lib/node_modules/wait-for-mongo/lib/waitForMongo.js:20:14)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
-----------------------------------STDOUT-----------------------------------
st:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
wait-for-mongo: failed to connect to [localhost:27017]
----------------------------------------------------------------------------

This is what I am using for mongo_url:

    "env": {
        "ROOT_URL": "http://my_app.com",
        "MONGO_URL": "mongodb://localhost:27017/app_name"
    },

Failed to connect to localhost port 80: Connection refused

Hey @arunoda, I'm not really to sure what to make of this error and was hoping you could help me out. I'm trying to deploy to ec2 and I'm getting the following STDERR error after running mup deploy:

Failed to connect to localhost port 80: Connection refused

and when I run mup logs:

[184.72.179.106]     at new Server (packages/livedata/livedata_server.js:1068)
    at Package (packages/livedata/server_convenience.js:10)
    at packages/livedata.js:3971:4
    at packages/livedata.js:3982:3
    at /opt/meteor/app/programs/server/boot.js:155:10
    at Array.forEach (native)
    at Function._.each._.forEach (/opt/meteor/app/programs/server/node_modules/underscore/underscore.js:79:11)
    at /opt/meteor/app/programs/server/boot.js:82:5
error: Forever detected script exited with code: 8
error: Script restart attempt #111

I set up an ec2 instance with ubuntu 14.04 LTS and and added an incoming security group for for ssh on port 22. Other than that I haven't modified the server at all. Do you have any ideas as to what might be causing this?

Pushing updates to deployed site

mup deploy takes about 2 minutes to complete the deployment process. If I only have a small change to the code, do I still have to perform mup deploy? Or is there a quicker way to do a hot code reload?

Bundling Error: code=-1, error:spawn ENOENT

Hi Aronuda,

I'm getting this error on deploying. I've run mup init and mup setup with no errors. It seems to have a problem bundling, but I can call meteor bundle bundle.tgz and it seems to work fine.
I fired up node-inspector with export NODE_OPTIONS='--debug-brk'; node-inspector & and message that states that it's listen pops up, but when I run mup deploy the message following outputs without node-inspector breaking.
Is there a good way to debug this?
Any thoughts on the error?

Thanks Marc

Lava:app cram$ mup deploy

Meteor Up: Production Quality Meteor Deployments
------------------------------------------------

Bundling Started: /Users/marc/Projects/METEOR/Sqwrl/app
Bundling Error: code=-1, error:spawn ENOENT
-------------------STDOUT-------------------

-------------------STDERR-------------------

Data Syncing

Love meteor-up, but It would be great to have some sort of data synchronizing features. For example a 'mup sync_from_server' command to fetch the meteor DB from the remote server and load into my local, and 'mup sync_to_server' for the inverse. When I'm working on a site locally and want load the database onto a remote server, the solution (using mongodump) is pretty arduous.

dependency on sshpass is crashing computer on osx

Possibly related to issue in sshpass itself here: http://sourceforge.net/p/sshpass/bugs/9/

Googling around I've noticed other apps that use sshpass having the same issue like the following:

ansible/ansible#5007

-- System crash report (happens almost every time I use "mup logs")

panic(cpu 2 caller 0xffffff802f00c42f): "negative open count (c, 16, 1)"@/SourceCache/xnu/xnu-2422.1.72/bsd/miscfs/specfs/spec_vnops.c:2110
Backtrace (CPU 2), Frame : Return Address
0xffffff80af2abb40 : 0xffffff802ee22f69
0xffffff80af2abbc0 : 0xffffff802f00c42f
0xffffff80af2abc00 : 0xffffff802f011896
0xffffff80af2abc50 : 0xffffff802effd2ae
0xffffff80af2abcc0 : 0xffffff802efdb811
0xffffff80af2abd10 : 0xffffff802efdaf60
0xffffff80af2abd50 : 0xffffff802efdba9d
0xffffff80af2abd80 : 0xffffff802effd9d3
0xffffff80af2abdd0 : 0xffffff802f1cc676
0xffffff80af2abe50 : 0xffffff802ee45629
0xffffff80af2abe80 : 0xffffff802ee486d9
0xffffff80af2abeb0 : 0xffffff802ee4853e
0xffffff80af2abee0 : 0xffffff802ee20b53
0xffffff80af2abf10 : 0xffffff802eedc7d3
0xffffff80af2abf30 : 0xffffff802eef35d2

BSD process name corresponding to current thread: ssh

Mac OS version:
13A603

Kernel version:
Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64
Kernel UUID: -----
Kernel slide: -----
Kernel text base: -----
System model name: MacBookPro8,1

Feature request: ask for password

Currently, I need to either write down my server password in servers.password field, or enable ssh-based authentication. When both password and pem params are not set, the script fails.

For added security, I'd prefer if the script asked me for password each time I make a deploy.

Error when deploying to EC2

Not sure what I'm missing here but getting this error when running on our EC2 instance.

[54.255.153.149] invoking deployment process: FAILED

    -----------------------------------STDERR-----------------------------------
    Warning: Permanently added '54.255.153.149' (RSA) to the list of known hosts.
    npm http GET https://registry.npmjs.org/fibers
    npm http 304 https://registry.npmjs.org/fibers
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed connect to localhost:80; Connection refused
    reverted back to the previous version due to the latest version didn't pick up!
    -----------------------------------STDOUT-----------------------------------

    > [email protected] install /opt/meteor/tmp/bundle/programs/server/node_modules/fibers
    > node ./build.js

    `linux-x64-v8-3.14` exists; testing
    Binary is fine; exiting
    [email protected] node_modules/fibers
    meteor stop/waiting
    meteor start/running, process 13906
    wait for mongo(5 minutes) to initiaze
    connected
    waiting for 15 secs while app is booting up
    checking for app is booted or not?
    meteor stop/waiting
    meteor start/running, process 13939
    ----------------------------------------------------------------------------
Completed TaskList: Deploying App

Allow non-root account to setup and deploy

On my servers I prefer to disallow logging in as root and instead use the almighty sudo instead. I wonder if it would be possible to make the login part work with an ordinary account, and use sudo to ask for the root password in the terminal when appropriate?

Or maybe it's already working. I tried using my ordinary account first but I got the following error message:

sudo: no tty present and no askpass program specified

The server is running Debian 7, and I'm deploying from OS X 10.9.2.

non-default ssh port support

Hi arunoda, today when I tried meteor-up on a server with ssh service listening on non-default port (22), it seemed that meteor-up didn't support this scenario yet. I tried to append ":port" to the host field and tried to add a new field "port" in mup.json but both failed. I took a glance at your code then and found meteor-up didn't support port yet and it used your another package nodemiral to do scp operations and I didn't see nodemiral support specific port either.

According to scp help, -P parameter is for port. Could you please add this support to meteor-up and nodemiral? Thanks a lot.

usage: scp [-12346BCEpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2

Deploy to specific server

It looks like mup.json supports multiple servers, but is it possible to tell it only to deploy to, say, staging or production somehow? Or will it deploy to all the servers listed?

Windows 7: "spawn ENOENT"

Hi arunoda

I am using MUP from Windows 7 to deploy a meteor app. I have a dedicated server which I can access through SSH. I am have created a mup.json file. When I run the follwing command:

mup setup

I get the following error:

Meteor Up: Production Quality Meteor Deployments
Started TaskList: Setup
[IP] - Installing Node.js
[IP] ? Installing Node.js: FAILED
spawn ENOENT
Completed TaskList: Setup

Can you please tell me why is this happening and how can I fix it. Thanks.

mup reconfig doesn't work with custom appNames

When issuing mup reconfig for deployments with a custom appName, it still tries to use meteor as the appName, and it then fails, as far as I can tell.

$ mup reconfig

Meteor-UP : Production Quality Meteor Deployments
--------------------------------------------------


Started TaskList: Updating Configurations
[domain.com] setting up env vars
[domain.com] setting up env vars: SUCCESS
[domain.com] restarting the app
[domain.com] restarting the app: FAILED

        -----------------------------------STDERR-----------------------------------
        Warning: Permanently added 'domain.com,1.2.3.4' (ECDSA) to the list of known hosts.
        stop: Unknown job: meteor
        start: Unknown job: meteor
        -----------------------------------STDOUT-----------------------------------
        ----------------------------------------------------------------------------
Completed TaskList: Updating Configurations
$

Feature request: Making nodejs and phantomjs installation optional

Hi,
It would be great if you can make nodejs and phantomjs installation optional, like you already did with mongodb (I'm curious though, why installing phantomjs mandatory with mup setup?). Some might have node already installed on server or may prefer to use nvm to manage different node versions.

Thanks!

Old Mongo Version?

Hello,

It seems that meteor-up setup installs an old mongo version. The mongodb-10gen package only goes up to version 2.4.10, while mongodb-org has the current version 2.6.1.

Has meteor any problems with the newer version, or is there any other reason that I'm missing why the old version is installed?

sudo: no tty present and no askpass program specified

This error message appears when running "mup setup" on my Mac to setup my Ubuntu linux machine for mup deployment.
I'm using ssh based authentication (which works fine when I open a ssh terminal session from my Mac to the Ubuntu server)
After hours of googling and experimenting with no luck so far, I now must bow my head in shame and ask for some kind advice...

Getting error "no such package: "

Hi!

I have the same issue as described here.

Basically what happens is any mrt packages gets listed like this:

error: no such package: 'iron-router'

And it does not work by running mrt update as suggested on SO.

Here's my process exactly which reproduces the error:

mrt create test
cd test
meteor update
mrt add iron-router
mrt update
mup init
# Here I update mup.json with the corrent server info etc.
mup setup
# This works fine
mup deploy
# here I get the errors of course

I've also tried running mrt uninstall --system between tests.

mup deploy error

$ mup deploy

Meteor-UP : Production Quality Meteor Deployments
--------------------------------------------------

Bundling Started: /root/book
Bundling Error:  spawn ENOENT
-------------------STDOUT-------------------

-------------------STDERR-------------------

I don't know why my configuration is triggering so many errors! At least I'm stress-testing Meteor Up :)

Information on how to connect to db on server

I used meteor up to deploy my meteor app on a server, and it works flawlessly.
I would now like to connect to this database on the server, but for this I need to know the mongodb url. I can't figure out what port, username and password to use. Any ideas on how I could get those?

Use puppet to install server programs

Instead of using scripts in Meteor-Up that assumes all servers should have the same setup. Use a manifest kind of setup so that each project can have different types of setup. One example is the need for imagemagick on some projects but not all. I can see a future where projects differ by more than this. And puppet has already solved these types of things.

A comparison would be to inspect how vagrant uses puppet, that could maybe help create a solutions.

Cheers,
// T

Error with command sudo npm install -g mup

----------------------- 1: COMMAND -----------------------
When I run the command:

sudo npm install -g mup

----------------------- 2: ERROR MESSAGES -----------------------
I get the following error messages:

npm ERR! error installing [email protected]
npm ERR! error installing [email protected]
npm ERR! error installing [email protected]
npm ERR! error installing [email protected]

----------------------- 3: VERSIONS -----------------------
root@droplet1:~# npm --version
1.1.4

root@droplet1:~# node --version
v0.6.12

----------------------- 4: FULL OUTPUT -----------------------

Here is the full output I get when running the command:

npm http GET http://registry.npmjs.org/mup
npm http 304 http://registry.npmjs.org/mup
npm http GET http://registry.npmjs.org/cjson/0.2.1
npm http GET http://registry.npmjs.org/uuid
npm http GET http://registry.npmjs.org/colors
npm http GET http://registry.npmjs.org/nodemiral
npm http 304 http://registry.npmjs.org/colors
npm http 304 http://registry.npmjs.org/uuid
npm http 304 http://registry.npmjs.org/cjson/0.2.1
npm http 304 http://registry.npmjs.org/nodemiral
npm http GET http://registry.npmjs.org/ejs
npm http GET http://registry.npmjs.org/debug
npm http GET http://registry.npmjs.org/handlebars
npm http 304 http://registry.npmjs.org/handlebars
npm http 304 http://registry.npmjs.org/ejs
npm http 304 http://registry.npmjs.org/debug
npm http GET http://registry.npmjs.org/uglify-js
npm http GET http://registry.npmjs.org/optimist
npm http 304 http://registry.npmjs.org/uglify-js
npm http 304 http://registry.npmjs.org/optimist
npm http GET http://registry.npmjs.org/wordwrap
npm http GET http://registry.npmjs.org/async
npm http GET http://registry.npmjs.org/source-map
npm http 304 http://registry.npmjs.org/wordwrap
npm http 304 http://registry.npmjs.org/async
npm http 304 http://registry.npmjs.org/source-map
npm ERR! error installing [email protected]
npm ERR! error installing [email protected]
npm ERR! error installing [email protected]
npm ERR! error installing [email protected]

npm ERR! Error: No compatible version found: source-map@'>=0.1.7- <0.2.0-'
npm ERR! Valid install targets:
npm ERR! ["0.0.0","0.1.0","0.1.1","0.1.2","0.1.3"]
npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
npm ERR! at next_ (/usr/share/npm/lib/cache.js:438:17)
npm ERR! at next (/usr/share/npm/lib/cache.js:415:44)
npm ERR! at /usr/share/npm/lib/cache.js:408:5
npm ERR! at saved (/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR! at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR! http://bugs.debian.org/npm
npm ERR! or use
npm ERR! reportbug --attach /root/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.8.0-29-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "mup"
npm ERR! cwd /root
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: source-map@'>=0.1.7- <0.2.0-'
npm ERR! message Valid install targets:
npm ERR! message ["0.0.0","0.1.0","0.1.1","0.1.2","0.1.3"]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/npm-debug.log
npm not ok

Using existing MongoDB database

I currently deploy with Meteor.sh, so I already have a database I want to use. Do I simply configure the MONGO_URL environment variable?

Running meteor locally, loading settings from mup.json

I used mup for deploying a project, and it worked great!

We wanted to load the same "env" from mup.json when running meteor locally, since many of the env variables were the same (only changing a couple of them). I created a bash script that accomplishes this, parsing out the env variables from mup.json using the "cjson" node module, and export each var in bash before starting app with "mrt".

I was thinking about publishing the script in npm (to provide a simple way to use the env properties from mup.json) to run meteor locally. Do you have a plan to incorporate this sort of functionality in "meteor-up"? If so, would you prefer a pull request to have it included in "meteor-up"? Or should I keep it as a separate module and publish it separately?

Thank you,
Nick

mup setup error

Here's the error:

$ mup setup

Meteor-UP : Production Quality Meteor Deployments
--------------------------------------------------


Started TaskList: Setting Up
[162.243.213.202] installing node

buffer.js:552
  if (end > this.length) throw new Error('oob');
                               ^
Error: oob
    at Buffer.slice (buffer.js:552:32)
    at Object.exports.parse (/usr/local/lib/node_modules/mup/node_modules/nodemiral/node_modules/ejs/lib/ejs.js:124:13)
    at Object.exports.compile (/usr/local/lib/node_modules/mup/node_modules/nodemiral/node_modules/ejs/lib/ejs.js:224:15)
    at Session._applyTemplate (/usr/local/lib/node_modules/mup/node_modules/nodemiral/lib/session.js:229:27)
    at fs.readFile (fs.js:176:14)
    at Object.oncomplete (fs.js:297:15)

Any idea what it means?

Meteor requires Node v0.10.26 or later

I just setup a brand new Ubuntu 14.04 server, and am using Meteor 0.8.1.2 and tried to deploy by way of MUP, and the process fails, "invoking deployment process: FAILED" and when I went to the log file /var/log/upstart/appname.log I found that it was full of the message "Meteor requires Node v0.10.26 or later". I upgraded Node by way of "sudo npm install n -g" "sudo n stable" and rebooted the server and now MUP works. So I think you need to update to Node v0.10.26 or newer (I went with 0.10.28).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.