Cannot find the correct server path after success deployment to beanstalk

I will send another zip for you to try this afternoon

Ok. Thanks. I am looking forward to it.

Does this help?

It still failed. It says it could not find the node version in package.json.
But I see that you have specified the node version in package.json.
So, I donā€™t understand why Beanstalk complains about this.
Here are the complete log:

Iā€™m not really sure whatā€™s going on here.

Is this a new instance or continuing on from the server that you previously installed on?

It worked as a fresh initial installation. But whenever any environment variable changes, it fails.
Does this happen to you when you deploy the code?

I just tried one more time. It looks like it is working now even after some environment variable changes.

Do you see any similar problems after you uploaded the code?

I normally set up the environment variables, and then deploy via EB CLI or with GitHub actions. I donā€™t normally upload via dragging and dropping the package.

I see. Beanstalk in China does not support cli deployment at this moment. So, uploading via the web is my only choice.

Can you access GitHub / GitHub Actions? I can show you how you can link EB to GitHub so that when you push changes to git, your EB will redeploy

Thanks. Let me explore this. After I upload the code to EB, it usually lost the git connection. Let me see whether I can re-establish the git connection by ssh to EB.

I have created this example package so you can see how to link GitHub up with EB.

This is the way I normally set my servers up, so whenever any changes are commited to the master branch of the repo, npm lint and npm test are ran, and then the code is zipped and uploaded.

Hey @dblythy has any progress been made on the parse-server-example repository to fix some of these issue? I cannot seem to successfully deploy the server example ā€œout of the boxā€ to AWS Elastic beanstalk.

Steps to reproduce:

  1. In AWS, create new elasticbeanstalk NodeJS 16 environment based on sample application.
  2. On my local machine, clone the parse-server-example master branch.
  3. Open the newly cloned project in an editor and update ./.ebextensions/app.config with my required env variables. I am using MongoDB atlas hosted URI for database connection and have verified that database connections works when running locally.
  4. From the project directory, run eb init and choose required region and newly created Node 16 environment.
  5. Choose no when prompted for using with AWS code commit in the eb-cli.
  6. Run eb deploy.

Result:
The new environment undergoes deployment for approximately 15 minutes before it seems like it times out. I cannot seem to request logs from the environment to trouble shoot, as the ā€œrequest logsā€ causes the environment to timeout again.

Are you able to get the latest parse-server-example working out of the box on elasticbeanstalk? Are there any additional steps Iā€™m missing here?

Can you try uploading and deploying the example package as a zip to your Elastic Beanstalk environment?

It seems like uploading the zip file from the example works as long as I include the node_modules folder.

When I am able to get the logs (sometimes requesting the logs throws the environment into a timeout loop again), I am getting the same error as discussed above.

I canā€™t be sure the error below is happening every time I try to deploy.

2022/05/18 22:19:04.979183 [ERROR] An error occurred during execution of command [app-deploy] - [Use NPM to install dependencies]. Stop running the command. Error: Command /bin/sh -c npm --production install failed with error signal: killed 

I have tried adding the .npmrc file and the additional .ebextensions config lines to the sample and deploying using CLI and I am still getting an environment timeout.

.npmrc:

unsafe-perm=true

.ebextensions:

files:
  "/opt/elasticbeanstalk/hooks/appdeploy/post/00_set_tmp_permissions.sh":
    mode: "000755"
    owner: root
    group: root
    content: |
      #!/usr/bin/env bash
      chown -R nodejs:nodejs /tmp/.npm

Note that I am using the latest sample that just got updated with PR 418. Therefore this is being deployed on a Node 16 environment.

Here is my copy of the sample project (I deleted all of the extraneous deployment files for other services in hopes of speeding up deploy time):

I fixed my issue here. It seems like I was running out of memory on my instance during the npm install.

By changing my instance type from t2.micro to t2.small allowed me to deploy from the CLI (kicking off an npm install) without committing my node_modules folder.

You can modify the capacity of your environment by going to Configuration ā†’ Capacity ā†’ Edit ā†’ Instance Types and removing t2.micro.