zodern / mup-aws-beanstalk

Deploy Meteor apps to AWS Elastic Beanstalk using Meteor Up
127 stars 55 forks source link

Failed Deployment - Maybe missing node_modules #153

Closed Roshdy closed 2 years ago

Roshdy commented 2 years ago

I've been suffering all kinds of errors for the past 20hrs

This is the latest error

[ERROR] An error occurred during execution of command [self-startup] - [StageApplication]. Stop running the command. Error: chown /var/app/staging/programs/server/npm/node_modules/meteor/activitree_push/node_modules/protobufjs/.node_modules-garbage-1ydhp9e.4yb7/@types: no such file or directory

my mup.js is:-

module.exports = {
  app: {
    // --------------------------------------- //
    // ----------------- APP ----------------- //
    // --------------------------------------- //
    // Application Name
    name: 'xxx-meteor',
    // Build path
    path: '../',
    // Environment Variables
    env: {
      "WEB_URL": "---",
      "ROOT_URL": "---",
      "MAIL_URL": "---",
      "MONGO_URL": "---",
      "MONGO_OPLOG_URL": "---",
      "TZ": "---",
      "NODE_TLS_REJECT_UNAUTHORIZED": "0",
      "HTTP_FORWARDED_COUNT": "2",
      "HEALTH_CHECK_VERBOSE": "true"
    },

    // (optional) Same options as when deploying with mup.
    // The one difference is serverOnly now defaults to true
    buildOptions: {
      // Default is true
      serverOnly: true,
    },

    sslDomains: [
      '----'
    ],

    // (optional) Redirect http to https
    forceSSL: true,

    // (optional) Send a SIGTERM signal to the app instances 30 seconds before they will be shut down.
    gracefulShutdown: true,

    // (optional) Supports large environment variables and settings.json by storing them in s3. 
    longEnvVars: false,

    // (optional, default is 3) Number of old application versions to keep
    oldVersions: 3,

    // --------------------------------------- //
    // ----------------- AWS ----------------- //
    // --------------------------------------- //
    // Tells mup that the AWS Beanstalk plugin will manage the app
    type: 'aws-beanstalk',

    // (optional, default is "mup-env-<app name>")
    // Name of AWS Elastic Beanstalk environment
    envName: '---',

    // AWS Authentication
    auth: {
      // IAM user's Access key ID
      id: '---',
      // IAM user's Secret access key
      secret: '---'
    },

    // (required) Minimum number of servers running your app
    minInstances: 3,

    // (optional, default is inInstances) Maximum number of servers
    // for autoscale to scale up to
    maxInstances: 8,

    // (optional, default is t2.micro) Type of instance to use
    instanceType: 't4g.medium',

    yumPackages: {
      'telnet': ''
    },

    // (optional, default is us-east-1) AWS region to deploy to
    // region: 'us-east-1',

    // (optional) Override or add options in the beanstalk config
    // this plugin creates.You can customize any option on:
    // https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html
    customBeanstalkConfig: [
      {
        namespace: 'aws:ec2:vpc',
        option: 'VPCId',
        value: 'vpc-xxxx'
      },
      {
        namespace: 'aws:ec2:vpc',
        option: 'Subnets',
        value: 'subnet-xxxx'
      },
      {
        namespace: 'aws:ec2:vpc',
        option: 'ELBSubnets',
        value: 'subnet-xxxx,subnet-xxxx'
      },
      {
        namespace: 'aws:autoscaling:launchconfiguration',
        option: 'SecurityGroups',
        value: 'sg-xxxx'
      },
      {
        namespace: 'aws:elb:loadbalancer',
        option: 'SecurityGroups',
        value: 'sg-xxxx'
      },
      // -------------------------------------------------------------------- //
      {
        namespace: 'aws:ec2:vpc',
        option: 'ELBScheme',
        value: 'internal'
      },
      {
        namespace: 'aws:autoscaling:launchconfiguration',
        option: 'EC2KeyName',
        value: 'firewal-rsa'
      },
      {
        namespace: 'aws:elasticbeanstalk:command',
        option: 'Timeout',
        value: '1500'
      },
      {
        namespace: 'aws:elasticbeanstalk:command',
        option: 'IgnoreHealthCheck',
        value: 'true'
      }
    ]
  },
  plugins: ['mup-aws-beanstalk']
};

When i access the EC2 through SSH, i can't find the meteor app installed at all. Even when i pull the logs there are no nginx logs or web.stdout.log files.

What I have tried:-

Roshdy commented 2 years ago

Could it be the instanceType???

zodern commented 2 years ago

This error looks similar to #135.

When Meteor builds the app, it copies the npm dependencies needed by the app and Meteor packages into the bundle. The missing file is from the activitree:push package. Which version of the package are you using?

Roshdy commented 2 years ago

i was using 2.0.9 Now i'm trying with local package 2.0.11

Roshdy commented 2 years ago

This error looks similar to #135.

When Meteor builds the app, it copies the npm dependencies needed by the app and Meteor packages into the bundle. The missing file is from the activitree:push package. Which version of the package are you using?

Does this mean, that t4g instanceType is not an issue here at all?

zodern commented 2 years ago

Does this mean, that t4g instanceType is not an issue here at all?

I've never tried the graviton2 instances with Meteor. It might be worth trying an instance type that has a x86 processor to see if it makes a difference.