Mup Deploy dont work on AWS

610 Views Asked by At

i will explain my problem, im trying to deploy an Meteor App on EC2 AWS (Ubuntu 16), the code is download from bitbucket and i was trying deploy with Mup. Mup Setup has no problems, but when using the Mup deploy command, it progresses to "minifying app code" and never goes forward.

Meteor 1.7.0.4 node v 10.9.0 mup --version 1.4.5

Attach the Mup.js file and the putty session

module.exports = {
  servers: {
    one: {
      // TODO: set host address, username, and authentication method
      host: 'xxxx',
      username: 'ubuntu',
      pem: '../xxxx.pem'
      // password: 'server-password'
      // or neither for authenticate from ssh-agent
    }
  },

  app: {
    // TODO: change app name and path
    name: 'xxxx',
    path: '../',

    servers: {
      one: {},
    },

    buildOptions: {
      serverOnly: true,
      executable: 'meteor'
    },

    env: {
      ROOT_URL: 'http://xxxx',
      MONGO_URL: 'mongodb://mongodb/meteor',
      MONGO_OPLOG_URL: 'mongodb://mongodb/local',
    },

    docker: {
      // change to 'abernix/meteord:base' if your app is using Meteor 1.4 - 1.5
      image: 'abernix/meteord:node-8.4.0-base',
    },

    enableUploadProgressBar: true,
    deployCheckWaitTime: 120,
  },

  mongo: {
    version: '3.4.1',
    servers: {
      one: {}
    }
  },

};

Putty Session

Using username "ubuntu".
Authenticating with public key "imported-openssh-key"
Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 4.4.0-1065-aws x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

28 packages can be updated.
0 updates are security updates.

New release '18.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


Last login: Fri Aug 17 22:06:59 2018 from xxxx
ubuntu@xxxx:~$ meteor --version
Meteor 1.7.0.4
ubuntu@xxxx:~$ node -v
v10.9.0
ubuntu@xxxx:~$ mup --version
1.4.5
ubuntu@xxxx:~$ cd xxxx
ubuntu@xxxx:~/xxxx$ cd .deploy
ubuntu@xxxx:~/xxxx/.deploy$ mup status
=> Servers
  - xxxx: Ubuntu 16.04

=> Docker Status
 - xxxx: 18.06.0-ce Running

=> Meteor Status
 - xxxx: created
    Created at 2018-08-17T16:17:42.747786756Z
    Restarted 0 times
    ENV:
     - ROOT_URL=http://xxxx
     - MONGO_URL=mongodb://mongodb:27017/xxxx
     - MONGO_OPLOG_URL=mongodb://mongodb/local
     - METEOR_SETTINGS={"public":{}}
     - PORT=80
     - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
     - METEORD_DIR=/opt/meteord
     - NODE_VERSION=8.4.0
    Published Ports:
     - 80/tcp => 80
    App running at http://xxxx:80
     - Available in app's docker container: false
     - Available on server: false
     - Available on local computer: false

=> Mongo Status
  running on server xxxx
  Restarted 0 times
  Running since 2018-08-17T21:41:02.553644287Z
  Version: 3.4.1
  Connections: 1
  Storage Engine: wiredTiger
ubuntu@xxxx:~/xxxx/.deploy$ mup setup

Started TaskList: Setup Docker
[xxxx] - Setup Docker
[xxxx] - Setup Docker: SUCCESS

Started TaskList: Setup Meteor
[xxxx] - Setup Environment
[xxxx] - Setup Environment: SUCCESS

Started TaskList: Setup Mongo
[xxxx] - Setup Environment
[xxxx] - Setup Environment: SUCCESS
[xxxx] - Copying mongodb.conf
[xxxx] - Copying mongodb.conf: SUCCESS

Started TaskList: Start Mongo
[xxxx] - Start Mongo
[xxxx] - Start Mongo: SUCCESS

Next, you should run:
    mup deploy
ubuntu@xxxx:~/xxxx/.deploy$ mup deploy --verbose settings settings.json
Building App Bundle Locally
   Minifying app code

After several minutes the connection with the instance is lost and I have to restart it, please help me with this problem that i never had before and i need fix soon. Thanks!

I tried "mup deploy --verbose --settings settings.json" command with a very basic app in the same instance of AWS, and get pass the "minifiying" problem, but throw the next error:

Next, you should run:
    mup deploy
ubuntu@xxxx/.deploy$ mup deploy --verbose --settings settings.json
Building App Bundle Locally

Started TaskList: Pushing Meteor App
[xxxx] - Pushing Meteor App Bundle                                                                              to the Server
[xxxx] - Pushing Meteor App Bundle                                                                              to the Server: SUCCESS
[xxxx] - Prepare Bundle
base: Pulling from abernix/meteord
...
Digest: sha256:5138e4ba3c55cc6fabe0ba859f984e9725599a9f53ed5d759dd4f350770a62b2
Status: Downloaded newer image for abernix/meteord:base
Finished Extracting
Creating Dockerfile
Finished creating Dockerfile
Building image
Sending build context to Docker daemon  67.59MB
Step 1/7 : FROM abernix/meteord:base
# Executing 1 build trigger
 ---> Running in cf74d5b4fa68
Removing intermediate container cf74d5b4fa68
 ---> 1f37c25d0989
Step 2/7 : RUN mkdir /built_app || true
 ---> Running in 1aee7bfde84f
Removing intermediate container 1aee7bfde84f
 ---> f82f6ad23a8a
Step 3/7 : ENV ROOT_URL=xxxx
 ---> Running in f26ac397298a
Removing intermediate container f26ac397298a
 ---> c2eb2e8861f7
Step 4/7 : ENV MONGO_URL=mongodb://mongodb:27017/xxxx
 ---> Running in be1f89f57b08
Removing intermediate container be1f89f57b08
 ---> 877e22ea42db
Step 5/7 : ENV MONGO_OPLOG_URL=mongodb://mongodb/local
 ---> Running in 7801b4f3be1e
Removing intermediate container 7801b4f3be1e
 ---> 657785f145b4
Step 6/7 : COPY ./ /built_app
 ---> 3043416670e1
Step 7/7 : RUN cd  /built_app/programs/server &&     npm install --unsafe-perm
 ---> Running in d2ae3b014734
...
Removing intermediate container d2ae3b014734
 ---> df4a55163cc2
Successfully built df4a55163cc2
Successfully tagged mup-xxxx:build
Error response from daemon: No such image: mup-xxxx:latest
Total reclaimed space: 0B
[xxxx] - Prepare Bundle: SUCCESS

Started TaskList: Configuring App
[xxxx] - Pushing the Startup Script
[xxxx] - Pushing the Startup Script                                                                             : SUCCESS
[xxxx] - Sending Environment Variab                                                                             les
[xxxx] - Sending Environment Variab                                                                             les: SUCCESS

Started TaskList: Start Meteor
[xxxx] - Start Meteor
using image
Error: No such image: mup-xxxx:previous
Image mup-xxxx:latest
Volume
Removing docker containers. Errors about nonexistent endpoints and containers ar                                                                             e normal.
Error: No such container: xxxx
Error response from daemon: endpoint xxxx not found
Error: No such container: xxxx-frontend
Error response from daemon: endpoint xxxx-frontend not found
Error: No such container: xxxx-nginx-letsencrypt
Error response from daemon: endpoint xxxx-nginx-letsencrypt not found
Error: No such container: xxxx-nginx-proxy
Error response from daemon: endpoint xxxx-nginx-proxy not found
Finished removing docker containers
0e23b10725796947401ab151a78b2349f32a3779249f3847d20f1b82d2c251a4
Ran abernix/meteord:base
[xxxx] - Start Meteor: SUCCESS
[xxxx] - Verifying Deployment
Container has no IP Address, likely from the app crashing.
Container has no IP Address, likely from the app crashing.
=> Container status:
Container spent too much time restarting.
restarted: 8 times {"Bridge":"","SandboxID":"d97cbb37a87106a3bdeaa51022acabd5e13                                                                             66a52317d11fcd75a3593730349bd","HairpinMode":false,"LinkLocalIPv6Address":"","Li                                                                             nkLocalIPv6PrefixLen":0,"Ports":{},"SandboxKey":"/var/run/docker/netns/d97cbb37a                                                                             871","SecondaryIPAddresses":null,"SecondaryIPv6Addresses":null,"EndpointID":"","                                                                             Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"IPAddress":"","IPPre                                                                             fixLen":0,"IPv6Gateway":"","MacAddress":"","Networks":{"bridge":{"IPAMConfig":nu                                                                             ll,"Links":null,"Aliases":null,"NetworkID":"081a5c91dc08e96e9a6efc23130e8e602951                                                                             1153751498da778dac3c9a8beb9d","EndpointID":"","Gateway":"","IPAddress":"","IPPre                                                                             fixLen":0,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAd                                                                             dress":"","DriverOpts":null}}} {"Status":"restarting","Running":true,"Paused":fa                                                                             lse,"Restarting":true,"OOMKilled":false,"Dead":false,"Pid":0,"ExitCode":1,"Error                                                                             ":"","StartedAt":"2018-08-20T20:08:58.615954182Z","FinishedAt":"2018-08-20T20:08                                                                             :58.900441472Z"}
=> Logs:
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/built_app/main.js:4:1)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
=> Starting meteor app on port:80
/built_app/programs/server/boot.js:49
    const { pause } = require("./debug.js");
          ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/built_app/main.js:4:1)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
=> Starting meteor app on port:80
/built_app/programs/server/boot.js:49
    const { pause } = require("./debug.js");
          ^
Module._extensions..js (module.js:416:10)

To see more logs type 'mup logs --tail=200'

[xxxx] x Verifying Deployment: FAIL                                                                             ED

              ------------------------------------STDERR------------------------                                                                             ------------
              Container spent too much time restarting.
            at require (internal/module.js:12:17)
            at Object.<anonymous> (/built_app/main.js:4:1)
            at Module._compile (module.js:409:26)
            at Object.Module._extensions..js (module.js:416:10)
        => Starting meteor app on port:80
        /built_app/programs/server/boot.js:49
            const { pause } = require("./debug.js");
                  ^

        SyntaxError: Unexpected token {
            at exports.runInThisContext (vm.js:53:16)
            at Module._compile (module.js:373:25)
            at Object.Module._extensions..js (module.js:416:10)
            at Module.load (module.js:343:32)
            at Function.Module._load (module.js:300:12)
            at Module.require (module.js:353:17)
            at require (internal/module.js:12:17)
            at Object.<anonymous> (/built_app/main.js:4:1)
            at Module._compile (module.js:409:26)
            at Object.Module._extensions..js (module.js:416:10)
        => Starting meteor app on port:80
        /built_app/programs/server/boot.js:49
            const { pause } = require("./debug.js");
                  ^

        SyntaxError: Unexpected token {
            at exports.runInThisContext (vm.js:53:16)
            at Module._compile (module.js:373:25)
            at Object.Module._extensions..js (module.js:416:10)
            at Module.load (module.js:343:32)
            at Function.Module._load (module.js:300:12)
            at Module.require (module.js:353:17)
            at require (internal/module.js:12:17)
            at Object.<anonymous> (/built_app/main.js:4:1)
            at Module._compile (module.js:409:26)
            at Object.Module._extensions..js (module.js:416:10)
        => Starting meteor app on port:80
        /built_app/programs/server/boot.js:49
            const { pause } = require("./debug.js");
                  ^

        SyntaxError: Unexpected token {
            at exports.runInThisContext (vm.js:53:16)
            at Module._compile (module.js:373:25)
            at Object.Module._extensions..js (module.js:416:10)
            at Module.load (module.js:343:32)
            at Function.Module._load (module.js:300:12)
            at Module.require (module.js:353:17)
            at require (internal/module.js:12:17)
            at Object.<anonymous> (/built_app/main.js:4:1)
            at Module._compile (module.js:409:26)
            at Object.Module._extensions..js (module.js:416:10)
        => Starting meteor app on port:80
        /built_app/programs/server/boot.js:49
            const { pause } = require("./debug.js");
                  ^

              ------------------------------------STDOUT------------------------                                                                             ------------
              Container has no IP Address, likely from the app crashing.
        Container has no IP Address, likely from the app crashing.
        Container has no IP Address, likely from the app crashing.
        Container has no IP Address, likely from the app crashing.
        => Container status:
        restarted: 8 times {"Bridge":"","SandboxID":"d97cbb37a87106a3bdeaa51022a                                                                             cabd5e1366a52317d11fcd75a3593730349bd","HairpinMode":false,"LinkLocalIPv6Address                                                                             ":"","LinkLocalIPv6PrefixLen":0,"Ports":{},"SandboxKey":"/var/run/docker/netns/d                                                                             97cbb37a871","SecondaryIPAddresses":null,"SecondaryIPv6Addresses":null,"Endpoint                                                                             ID":"","Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"IPAddress":"                                                                             ","IPPrefixLen":0,"IPv6Gateway":"","MacAddress":"","Networks":{"bridge":{"IPAMCo                                                                             nfig":null,"Links":null,"Aliases":null,"NetworkID":"081a5c91dc08e96e9a6efc23130e                                                                             8e6029511153751498da778dac3c9a8beb9d","EndpointID":"","Gateway":"","IPAddress":"                                                                             ","IPPrefixLen":0,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":                                                                             0,"MacAddress":"","DriverOpts":null}}} {"Status":"restarting","Running":true,"Pa                                                                             used":false,"Restarting":true,"OOMKilled":false,"Dead":false,"Pid":0,"ExitCode":                                                                             1,"Error":"","StartedAt":"2018-08-20T20:08:58.615954182Z","FinishedAt":"2018-08-                                                                             20T20:08:58.900441472Z"}
        => Logs:

        To see more logs type 'mup logs --tail=200'


              ------------------------------------------------------------------                                                                             ------------
0

There are 0 best solutions below