Meteor app on digitalocean with https://app and https//www. Sometimes fails to serve https://app - meteor

Problem:
My app runs on digitalocean droplet with multiple domains:
proxy: {
domains: 'example.com,www.example.com',
ssl: {
letsEncryptEmail: '#'
}
}
Sometimes, for about half an hour the https://example.com fails to load completely but indirect links like https://example.com/about works fine.
Tried:
fiddling with nginx option:
nginxServerConfig: './nginx.conf',
Any attempts with it failed loading page completely
Mup.js file:
module.exports = {
servers: {
one: {}
},
app: {
deployCheckWaitTime: 300,
name: 'example',
path: '../',
buildOptions: {
serverOnly: true,
},
env: {
ROOT_URL: 'https://example.com',
MONGO_URL: 'mongodb://mongodb:27017/example',
},
docker: {
image: 'abernix/meteord:node-8.4.0-base',
args: ['--link=mongodb:mongodb'],
},
enableUploadProgressBar: true
},
proxy: {
domains: 'example.com,www.example.com',
ssl: {
letsEncryptEmail: '#'
}
}
};

Turns out, that problem lied in mailgun.
The mailgun DNS records didn't match v=spf1 include:eu.mailgun.org ~all thus those mails weren't authorized and whenever mail was sent through the system it was tripping domain provider to refresh it's DNS.

I solved this issue by setting up a permanent redirect for www through my domain settings.

Related

First time deploying meteor app with meteor-up

This is the first time i am deploying from Meteor-up and I followed the docs to deploy a dummy application first. I am deploying on a shared linux server. Everything is going great but i can't find my app on ROOT_URL. My domain is pointing to the server and that very domain is also my ROOT_URL. when I hit the domain link it goes to the index of file explorer on the server instead of my web app. I tried to find logs but logs command and --verbose flag returned no log and the command simply run as usual.
Mup version (``1.5.3`):
Mup config
{ "servers": {
"one": {
"host": "1.2.3.4",
"username": "totalti1",
"password": "password",
"opts": {
"port": 2083
}
} }, "proxy": {
"servers": {
"one": {}
},
"domains": "host.com,subdomain.host.com",
"shared": {
"httpPort": 80,
"httpsPort": 443
} }, "app": {
"name": "my-app",
"path": "../.",
"deployCheckWaitTime": 300,
"servers": {
"one": {}
},
"buildOptions": {
"serverOnly": true
},
"env": {
"ROOT_URL": "https://host.com",
"MONGO_URL": "mongodb://mongodb:27017/my-app",
"MONGO_OPLOG_URL": "mongodb://localhost/local",
"VIRTUAL_HOST": "host.com,subdomain.host.com",
"HTTPS_METHOD": "noredirect",
"VIRTUAL_PORT": 3000,
"HTTP_FORWARDED_COUNT": 1
},
"docker": {
"image": "abernix/meteord:node-12-base",
"prepareBundle": false,
"stopAppDuringPrepareBundle": true,
"imagePort": 3000,
"args": [
"--link=mongodb:mongodb"
]
},
"enableUploadProgressBar": true,
"type": "meteor" }, "mongo": {
"version": "3.4.1",
"servers": {
"one": {}
},
"dbName": "DemoApp" } }
the port of my host is 2083 and I am not sure if that is causing a problem. I am not sure if the deployment was unsuccessful or the URL had a mistake. I was able to get some log after setting the debug Environmental variable. And here is it.
Output of command
$ DEBUG=mup* mup reconfig --verbose
mup:updates checking for updates +0ms
mup:updates Packages: [ { name: 'mup', path: '/usr/lib/node_modules/mup/package.json' } ] +2ms
mup:updates retrieving tags for mup +2ms
mup:api Running command default.reconfig +0ms
mup:module:default exec => mup reconfig +0ms
mup:api Running command meteor.envconfig +2ms
mup:module:meteor exec => mup meteor envconfig +0ms
Started TaskList: Configuring App [213.136.76.119] - Pushing the Startup Script
mup:updates finished update check for mup +1s
I am looking for some instant help as i am stuck on this deployment for three days now. Thanks in Advance
EDIT
Is there a way to know that the deployment was successful or not. Also is there something wrong with my ROOT_URL? Root url contains the IP of server on which i have hosted the app. The domain also points to the IP. When I access by IP it says
Sorry!
IP changed or server misconfig or site may have moved to different ip. Contact your hosting provider.
When i access via domain it shows the empty directory the default domain is set to.

Using MUP returned a container error

When I used the following config deploying to digitalocean, I did a $ mup setup with no errors and then ran $ mup deploy and everything went well until it tried to prepare bundle...what am I missing here?
This is the error I'm getting with the following config when deploying...
module.exports = {
servers: {
one: {
host: 'xxx.xxx.xxx.xxx',
username: 'root',
pem: "~/.ssh/id_rsa"
}
},
app: {
name: 'hotel',
path: '../hotel',
// this is my local path to the application root
servers: {
one: {},
},
buildOptions: {
serverOnly: true,
},
env: {
ROOT_URL: 'http://xxx.xxx.xxx.xxx',
MONGO_URL: 'mongodb://localhost/meteor',
},
docker: {
image: 'abernix/meteord:base',
},
// Show progress bar while uploading bundle to server
// You might need to disable it on CI servers
enableUploadProgressBar: true
},
mongo: {
version: '3.4.1',
servers: {
one: {}
}
}
};

Meteor Up deployment error

I am deploying meteor app using Meteor Up.
The development app is at the location /apps/proto/meteor/GatewayUI
and i have the .deploy folder which is inside the GatewayUI folder.
On giving the command "mup deploy", I get the following error
{ Error: spawn meteor ENOENT
at exports._errnoException (util.js:1018:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn meteor',
path: 'meteor', spawnargs:
[ 'build',
'--directory',
'/tmp/mup-meteor-981e8b09-055e-4ffe-a50a-d73d07c1ac5f',
'--architecture',
'os.linux.x86_64',
'--debug',
'--mobile-settings',
'/apps/proto/meteor/GatewayUI/settings.json' ] }
This error usually happens when meteor is not installed.
My mup.js is as follows:
module.exports = {
servers: {
one: {
// TODO: set host address, username, and authentication method
host: 'myhost',
username: 'myusername',
// pem: './path/to/pem'
password: 'mypassword'
// or neither for authenticate from ssh-agent
}
},
meteor: {
// TODO: change app name and path
name: 'GatewayUI',
path: '../../GatewayUI/',
servers: {
one: {},
},
buildOptions: {
debug: true,
executable: 'meteor',
},
env: {
// TODO: Change to your app's url
// If you are using ssl, it needs to start with https://
ROOT_URL: 'http://gatewayui.com',
MONGO_URL: 'mongodb://localhost/meteor',
},
// ssl: { // (optional)
// // Enables let's encrypt (optional)
// autogenerate: {
// email: 'email.address#domain.com',
// // comma seperated list of domains
// domains: 'website.com,www.website.com'
// }
// },
docker: {
// change to 'kadirahq/meteord' if your app is not using Meteor 1.4
image: 'abernix/meteord:base',
// imagePort: 80, // (default: 80, some images EXPOSE different ports)
},
// This is the maximum time in seconds it will wait
// for your app to start
// Add 30 seconds if the server has 512mb of ram
// And 30 more if you have binary npm dependencies.
deployCheckWaitTime: 60,
// Show progress bar while uploading bundle to server
// You might need to disable it on CI servers
enableUploadProgressBar: true
},
mongo: {
port: 27199,
version: '3.4.1',
servers: {
one: {}
}
}
};
A couple of things for this to not happen
1) make sure Meteor is installed. In my case, it was installed, however, the path was not set. It happened, because I forgot to add the path permanently
2) Docker, Mongo, Meteor should be installed in effect.
3) Every time, mup setup must precede mup deploy.

Meteor Up mup deploy fails - Error response from daemon

I have a Meteor application that I'm trying to deploy on a VPS. I am using Meteor Up to do this.
By following the instructions I have set up my mup.js file to look like this:
module.exports = {
servers: {
one: {
host: '41.185.27.69',
username: 'root',
// pem:
password: 'secret',
// or leave blank for authenticate from ssh-agent
opts: {
port: 22
}
}
},
meteor: {
name: 'HelderbergLink',
path: '../../HelderbergLink',
servers: {
one: {}
},
buildOptions: {
serverOnly: true,
},
env: {
ROOT_URL: 'http://41.185.27.69',
MONGO_URL: 'mongodb://127.0.0.1:27017/HelderbergLink'
},
dockerImage: 'abernix/meteord:base',
deployCheckWaitTime: 60
},
mongo: {
oplog: true,
port: 27017,
servers: {
one: {},
},
},
};
After this is set up I run the following command in my .deploy directory:
mup.cmd setup
Everything setups successfully here, but then when I need to run the next command:
mup.cmd deploy
It runs through most of the process but then gives me this error:
I'm not sure what to do to resolve this. Any help would be much appreciated!

Meteor Up Setup Error on DigitalOcean

I am trying to deploy a Meteor app onto a DigitalOcean droplet, via its IP address (I have no domain name). I am doing this kind of thing for the first time, and am having a lot of issues with it.
This is my droplet on Digital Ocean:
I created a MUP (Meteor Up) directory outside my Meteor app’s repo using mup init, and this is the mup.js file that I have:
module.exports = {
servers: {
one: {
host: 'http://162.243.57.207',
username: 'cs673f16',
pem: '/Users/gautambhat/.ssh/id_rsa'
// password:
// or leave blank for authenticate from ssh-agent
}
},
meteor: {
name: 'meetcute',
path: '/Users/gautambhat/Repos/CS673_team2',
servers: {
one: {}
},
buildOptions: {
serverOnly: true,
},
env: {
ROOT_URL: 'http://162.243.57.207',
PORT : 3000
//MONGO_URL: 'mongodb://localhost/meteor'
},
//dockerImage: 'kadirahq/meteord'
deployCheckWaitTime: 60
},
mongo: {
oplog: true,
port: 27017,
servers: {
one: {},
},
},
};
Also, I don't know my MONGO_URL, or where to find it, so I just commented it out. On running mup setup, I get the following error:
Started TaskList: Setup Docker
[http://162.243.57.207] - setup docker
Error getaddrinfo ENOTFOUND http://162.243.57.207 http://162.243.57.207:22
Can anyone point me in the right direction?
The error—as described in your original post—is as follows:
Started TaskList: Setup Docker
[http://162.243.57.207] - setup docker
Error getaddrinfo ENOTFOUND http://162.243.57.207 http://162.243.57.207:22
The error basically means it can’t find the host http://162.243.57.207. So let’s look at the `servers part of your configuration:
servers: {
one: {
host: 'http://162.243.57.207',
username: 'cs673f16',
pem: '/Users/gautambhat/.ssh/id_rsa'
// password:
// or leave blank for authenticate from ssh-agent
}
},
Your host setting is a URL when it should be a hostname or IP address; meaning host: 'http://162.243.57.207' should just be 162.243.57.207. So change that and try again:
servers: {
one: {
host: '162.243.57.207',
username: 'cs673f16',
pem: '/Users/gautambhat/.ssh/id_rsa'
// password:
// or leave blank for authenticate from ssh-agent
}
},

Resources