Unable to deploy meteor(Meteor version 2.1) app to DigitalOcean

vue-meteor web app form meteor-1.8.1 to 2.1
After an upgrade, I am not able to deploy it on DigitalOcean server.

Meteor 2.1 with node 12.14.0.

Not sure this because of node version or it’s a meteor bug.

I am using Mup to deploy in digitalocean

please help.

Check your mongo url

1 Like

It’s failing to connect to your mongo server on port 27017. Are you running a local mongo, or on another server?

I run it on server

module.exports = {
servers: {
one: {
host: ‘…’,
// pem: ‘~/.ssh/id_rsa’,
password: ‘root’,
},
},
app: {
name: ‘rest’,
path: ‘…/’,
volumes: {
‘/data/file_uploads’: ‘/data/file_uploads’,
},
servers: {
one: {},
},
env: {
ROOT_URL: ‘http://…:232’,
MONGO_URL: ‘mongodb://mongodb/rest’,
MONGO_OPLOG_URL: ‘mongodb://mongodb/local’,
PORT: 232,
},
docker: {
image: ‘abernix/meteord:node-12.14.0-base’,
},
deployCheckWaitTime: 300,
enableUploadProgressBar: true,
},
mongo: {
version: ‘4.0.5’,
servers: {
one: {},
},
},

before update meteor 1.8 I deploy with mup it work properly after update 2.1 error

The recommended approach when upgrading is to upgrade one version at a time and use the changelog as a guide to give you a clue on migration steps and breaking changes for each version.

From 1.8 to 2.x, I believe there has been updates to the mongo driver (although not sure if those are breaking changes).

Better to upgrade one version at a time

Mup has always been really janky but good thing is you dont need it, just run meteor build and build your app, scp the tarball to the server, extract it, then follow the readme file instructions (its just running npm install in the dir) then you need to set the port and mongo url in environmental variables via export, start her up in a screen or tmux and dettach the screen so it runs in background, then edit nginx config to use the localhost:port-you-set to be the upstream and voila you have done it without mup

I would check the Mongo version and Node version. Mup does allow you to shoot yourself in the foot with mismatching versions. The reason for the disconnect might be because your meteor version expects Mongo 4.2 or 4.4. Unfortunately once mup installs mongo, it is difficult the upgrade it. That is why it’s best not to use mup to install mongo, but to move it to another dedicated mongo server or use a cloud solution. However it can be done, there are instructions in the mup documentation.

https://jamesloper.com/mongodb-setup-guide-ubuntu-20
https://jamesloper.com/complete-users-setup-guide-meteor-mongodb
https://jamesloper.com/meteor-deployments-without-mup

I would agree with @james about running Mongo on a separate server - there are many benefits like automated backups, clustering, and the fact that you don’t have your data on a docker instance.
Mup can be a little quirky, but IMO it’s worth sticking with it, as it makes deployment simple, and you can easily run multiple meteor instances on the same Droplet (memory allowing, of course). Once you have used it a few times, you’ll get to trust it.
I have found if things go really pear shaped with mup, it works best just to start again. That means stopping the docker instance, deleting it, and running mup setup again. That’s another reason to store your data on a database server :slight_smile:

Thank I will try, Your recommendation

Honestly guys you don’t need mup it’s just literally 5 or 6 commands and you can get rid of it. imho ‘Deployment’ is way over complicating what it is, it’s just a glorified scp command…

  • Build your app: meteor build ../build --architecture os.linux.x86_64
  • Deploy it: scp ../build/app.tar.gz user@server:~/
    • (Optional Backup to instant rollback): sudo cp -R bundle bundle-backup/
  • Unpack it on server: tar -zxf app.tar.gz
  • Install: (cd programs/server && npm install)
  • Run: node main.js (do this inside a screen and dettach it so it runs in the background with screen and ctrl + a d)

Of course you can save this all in a script and just call it when you need…

And for first time configuration, you just tell nginx to run localhost:your-port as the upstream and export shell variables:

  $ export MONGO_URL='mongodb://user:password@host:port/databasename'
  $ export ROOT_URL='http://example.com'
  $ export MAIL_URL='smtp://user:password@mailhost:port/'

That’s it. This is the official directions given in the included README when you build the app btw

2 Likes