Meteor Deployment via MUP - meteor

I am trying to deploy my app via MUP ,everything works fine except when I run command mup deploy. In browser website loads but it does not shows the latest changes I have made. Build files has all changes that I have made.I am using Amazon EC2 for server.
Edit:
In MUP logs it shows that server has started on port 80. I also checked the build file it has latest code but somehow server is not rendering in browser.I am not sure its issue of MUP Or meteor build or amazon EC2 server.

Since I'm having the exact same problem, I can clarify the question.
I'm using Mup build 1.2.8/latest on Windows 10, Meteor v1.4.4.2/latest, deploying to Ubuntu 14.04 on Digital Ocean.
Doing "mup.cmd deploy" builds the bundle, pushes it to the server, starts the app and verifies the deployment, all successfully. The meteor logs as shown by "mup.cmd logs" shows the app started successfully (other than the Kadira warning which should be fixed in the newly deployed version). Browsing to my app doesn't show any of my recent changes (they do show up when running locally). It seems as if the updated container isn't the one running. I've tried starting, stopping and removing the Docker container to no avail.
For reference, here is the mup.js file I'm using (with the names changed to protect the guilty). This file worked to deploy fine 6 weeks ago.
module.exports = {
servers: {
one: {
host: '1.2.3.4',
username: 'Ron',
pem: '/cygwin64/home/Ron/.ssh/id_rsa',
}
},
meteor: {
name: 'MyApp',
path: '../',
servers: {
one: {}
},
buildOptions: {
serverOnly: true,
debug: true,
cleanAfterBuild: true,
buildLocation: '../../output'
},
env: {
// TODO: Change to your app's url
// If you are using ssl, it needs to start with https://
ROOT_URL: 'https://MyApp.com',
MONGO_URL: 'mongodb://localhost/meteor'
},
docker: {
// change to 'kadirahq/meteord' if your app is not using Meteor 1.4
image: 'abernix/meteord:base'
},
// 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,
ssl: {
autogenerate: {
email: 'email#example.com',
domains: 'MyApp.com, www.MyApp.com'
}
},
// Show progress bar while uploading bundle to server
// You might need to disable it on CI servers
enableUploadProgressBar: true
},
mongo: {
port: 27017,
version: '3.4.1',
servers: {
one: {}
}
}
};
EDIT::
I deleted all of the containers and images except mongo, ran "mup setup" and "mup deploy" again with exactly the same results, old version is running. So the problem seems to be with the meteor build portion of mup.
EDIT 2::
I found at least 1 of the problems. I have the buildLocation set to a relative path. At some point Mup changes the current directory which causes multiple copies of the buildLocation to be used. In my case the output of the Meteor build command (the new files) were in one and Mup was deploying to the server from another one that happened to contain the old files. I changed buildLocation to an absolute path and the new version is being deployed. Yeah! But wait, even though Mup says the verification worked, my app never runs and the container keeps restarting. Looking out the logs I suspect that the problem is with the line below. Somehow the path has a backslash in it. I'm not sure where this is coming from.
[192.241.229.15]npm ERR! enoent ENOENT: no such file or directory,
chmod
'/bundle/bundle/programs/server/npm/node_modules/sshpk/bin\sshpk-conv'
SOLUTION:: Thanks to Parth Mahida I was inspired to remove the /opt/MyApp directory on the server, as well as removing and reinstalling the sshpk NPM package on my build machine then redid Mup setup and Mup deploy and everything worked again. No idea how the sshpk package became corrupt, but at this point I don't care.

Related

AWS Codedeploy Wordpress deployment fails due to PHP version change in buildspec file

I am running my Wordpress site hosted in AWS EC2 [Amazon Linux2 AMI].
I have a pipeline to deploy the latest source from Github.
The codebuild buildspec file is as follow: [Mentioned only related part]
version: 0.2
phases: install:
runtime-versions: php: 7.4
Codebuild project in cloudformation is like this:
Image: 'aws/codebuild/amazonlinux2-x86_64-standard:3.0'
Using above configuration, deployment is going without problem and problem happens when I update like below: [Mentioned only related part]
In cfn template:
Image: 'aws/codebuild/amazonlinux2-x86_64-standard:4.0'
In buildspec: runtime-versions: php: 8.1
Validation script in deployment hooks runs some validation commands to check RDS connection and it fails:
LifecycleEvent - ValidateService Script - deploy_hooks/validate_service.sh [stdout]OK SO FAR
[stderr]mysqlcheck: Got error: 1045: Access denied for user 'root'#'10.37.253.207' (using password: NO) when trying to connect
After deployment, I loginto the ec2 instance and below WP cli command fails as well:
$ wp db check
These above problems does not occur when I roll back to previous state of the PHP version.
In cfn template:
Image: 'aws/codebuild/amazonlinux2-x86_64-standard:3.0'
In buildspec:
runtime-versions: php: 7.4
What might be the problem ?
Reference:
https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
https://docs.aws.amazon.com/codebuild/latest/userguide/available-runtimes.html#linux-runtimes
** UPDATE:
Codedeploy is failing to deploy DB endpoint , password and other information in wp-config.php file when codedeploy is executed by codepipeline.
If I terminate the ec2 instance, the auto-scaling will launch a new instance for me and deployment is triggered by the codedeploy and the deployment is success. I can access the site.
Does it mean that executing Codedeploy through Codepipeline is the problem?

(Meteor) Mup deploy "read ECONNREST Error"

I don’t know what is going on.
I reinstalled my Computer and updated Meteor. I had some permission problems in a earlier problem I could fix that tho. Meteor is normally running if I don't want to deploy it. Deploying used to work just fine btw.
mup.cmd deploy --settings settings.json
Building App Bundle Locally
Started TaskList: Pushing Meteor App
[82.165.207.55] - Pushing Meteor App Bundle to the Server
[82.165.207.55] - Pushing Meteor App Bundle to the Server: SUCCESS
[82.165.207.55] - Prepare Bundle
[82.165.207.55] - Prepare Bundle: SUCCESS
Started TaskList: Configuring App
[82.165.207.55] - Pushing the Startup Script
[82.165.207.55] - Pushing the Startup Script: SUCCESS
[82.165.207.55] - Sending Environment Variables
[82.165.207.55] - Sending Environment Variables: SUCCESS
Started TaskList: Start Meteor
[82.165.207.55] - Start Meteor
events.js:183
throw er; // Unhandled ‘error’ event
^
Error: read ECONNRESET
at _errnoException (util.js:1022:11)
at TCP.onread (net.js:615:25)
What does that mean? I couldn’t find any solution for my problem online. Do you know what is wrong?
This error can happen if your IP address cannot SSH. Make sure your IP
hasn't changed, or change your rules/IP in the security groups of the
service you are using.
There was another case of this recently here mup setup : Error: Timed out while waiting for handshake
But I don't think he sorted it out. He has also reported it on the mup issues list
You can also enable debugging and set mup to be verbose like this:
DEBUG=mup* mup <command> --verbose
(docs at http://meteor-up.com/docs.html)

Deploying an Meteor app with mup - error: no configs found for meteor

I've been trying to deploy a meteor app to Digital Ocean. I've configured mup.js like this:
module.exports = {
servers: {
one: {
host: '[droplet ip address]',
username: '[username]',
password: '[password]'
}
},
// 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,
// Application name (no spaces).
"appName": "pichaprint",
// 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": ".",
// 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://pichaprint.com",
},
"deployCheckWaitTime": 15
};
When I try to run mup setup, I get the following error:
error: no configs found for meteor
I'm currently working live by using PuTTY and I'm within the meteor project folder which contains the mup.js file (that's the reason the app property value is a period). What could I be doing wrong?
It turns out that even though I initialized mup by entering mup init, it did not actually generate a mup.json. So I had to create that manually by entering the following command: cat > mup.json in the root of my project folder

Meteor app doesn't appear in browser after deployment with mup

I'm facing strange issue - I deployed my Meteor app with mup ( followed this instruction: https://www.vultr.com/docs/deploy-a-meteor-application-on-ubuntu ). Everything went successfully (see screenshot).
However the content doesn't appear when I try to access it via browser (I type IP-address).
As a server I use apache2 on Ubuntu 15.04, and mup.json as following:
{
// Server authentication info
"servers": [
{
"host": "IP_ADDRESS",
"username": "developer"
//"password": "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": false,
// 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.36",
// 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": true,
// Application name (No spaces)
"appName": "meteor",
// Location of app (local directory)
"app": "~/app",
// Configure environment
"env": {
"PORT": 80,
"UPSTART_UID": "meteoruser",
"ROOT_URL": "http://IP_ADDRESS",//and I also tried http://localhost
//"MONGO_URL": "",
"METEOR_ENV": "production"
},
// 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": 15
}
I would appreciate any help! Thanks in advance!
UPD: I made a better research and found a great tutorial - https://www.phusionpassenger.com/library/walkthroughs/deploy/meteor/ownserver/apache/oss/vivid/deploy_app.html . So, if anyone else curious about how to deploy Meteor app, please have a look :)

Deploying Telescope App to Amazon EC2

What am I doing wrong? I'm trying to deploy my Telescope app. I'm using this to do that: https://github.com/arunoda/meteor-up. It gives me an error when I try to deploy using Mup. Here's my mup.json config file:
{
// Server authentication info
"servers": [
{
"host": "52.25.228.14",
"username": "ec2-user",
//"password": "password"
// or pem file (ssh based authentication)
"pem": "~/Documents/appname/appname.pem"
}
],
// 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.36",
// 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": true,
// Application name (No spaces)
"appName": "appname",
// Location of app (local directory)
"app": "~/Documents/appname/Telescope",
// Configure environment
"env": {
"ROOT_URL": "ec2-52-25-228-14.us-west-2.compute.amazonaws.com"
},
// 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": 15
}
Common pitfalls :
Are sure you ran mup setup before deploying ?
Try using a relative path to setup the app location, ie replace ~/Documents/appname/Telescope by . if your mup.json is located at the root of your Telescope instance.
I did run mup setup, did use http://, and tried many times to get it to connect/deploy.
I gave up and just went with a Wordpress theme and am customizing it how I want it. The other way was way too complicated. It didn't allow me to do what I wanted in a timely manner. Thanks for trying to help though guys.

Resources