arunoda / meteor-up-legacy

Production Quality Meteor Deployments
MIT License
2.26k stars 395 forks source link

Forever crashing with Meteor Up / Iron on fresh Ubuntu 14.04 Nginx server (DigitalOcean) #765

Open Loschcode opened 8 years ago

Loschcode commented 8 years ago

After 12 hours trying to resolve this issue, I guess it might be a bug. My configuration includes this

   {
      // Server authentication info
     "servers": [
       {
        "host": "MY SERVER",
        "username": "root",
        "password": "MY PASSWORD"
        // or pem file (ssh based authentication)
        //"pem": "~/.ssh/id_rsa"
      }
    ],

  // Install MongoDB in the server, does not destroy local MongoDB on future setup
  "setupMongo": true,

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

  // WARNING: If nodeVersion omitted will setup 0.10.36 by default. Do not use v, only version number.
  "nodeVersion": "0.10.40",

  // Install PhantomJS in 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": false,

  // Application name (No spaces)
  "appName": "geokaliz",

  // Location of app (local directory)
  "app": "/Users/Loschcode/Google Drive/projects/geokaliz_lo/website/app",

  // Configure environment
  "env": {

    "PORT": 80,
    "ROOT_URL": "http://laurent.tech",
    "MONGO_URL": "mongodb://root:root@localhost:27017/geokaliz",
    "MAIL_URL": "smtp://this-is-shit/"

  },

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

Meteor Up is deploying correctly, all the files are going into /opt/ but forever uptime is less than 1sec and then restart systematically. I did a a userdown app/main.js into the correct folder to replicate what forever does and a big error shows up

 Error: MONGO_URL must be set in environment
        at Object.<anonymous> (packages/mongo/remote_collection_driver.js:36:1)
        at Object.defaultRemoteCollectionDriver (packages/underscore/underscore.js:750:1)
        at new Mongo.Collection (packages/mongo/collection.js:102:1)
        at AccountsServer.AccountsCommon (accounts_common.js:23:18)
        at new AccountsServer (accounts_server.js:16:5)
        at Package (globals_server.js:5:12)
        at /opt/geokaliz/app/programs/server/packages/accounts-base.js:1814:4
        at /opt/geokaliz/app/programs/server/packages/accounts-base.js:1825:3
        at /opt/geokaliz/app/programs/server/boot.js:242:10
        at Array.forEach (native)

Yeah ... Pretty weird since everything has been set. It's been a while i'm on it and the issue changes, i clear the droplet and try again all the time with different versions of everything, etc. nothing works

Any guess ?

MasterJames commented 8 years ago

Maybe this helps. http://stackoverflow.com/questions/18359326/how-do-i-fix-error-mongo-url-must-be-set-in-environment-on-ubuntu-using-forev or https://groups.google.com/forum/#!topic/meteor-talk/dUFTMoIdS_0

Is this Meteor 1.2.1? mup or mupx? or right always try mupx if mup doesn't work properly.

Loschcode commented 8 years ago

It's mup, but i also tried mupx (took me the whole day, i really tried everything) and i had some big errors linked to docker so i was like "yeah whatever" and came back to mup ...

Also the answers on the topic aren't relevant to me :(

MasterJames commented 8 years ago

Oh okay well I'm more familiar with mupx. So hopefully someone else has an idea, sorry. It seems the mongo_url is the problem. Sometimes a ctrl character or something like that can get in there. You'll need to double check it. Even try retyping it manually if verified correct. Update all versions of everything would also be a pertinent step.

Loschcode commented 8 years ago

I'm still checking it, and I think the problems comes from the fact it doesn't take my settings.json into consideration (i'm using Iron and there's a config in config/production/settings.json containing some things and a config/env.sh containing things like MONGO_URL which aren't loaded when I build and launch the main.js, same when I deploy with mup/mupx

Very weird stuff ...

Loschcode commented 8 years ago

After those days of research I opened an issue on iron-cli ; I don't know which one of mup or iron-cli is responsible for that ...

https://github.com/iron-meteor/iron-cli/issues/224

Any guess of what i'm missing here ?