parse-server-example icon indicating copy to clipboard operation
parse-server-example copied to clipboard

Can't update parse-server-example on AWS Elastic Beanstalk

Open meilers opened this issue 10 years ago • 17 comments

I deployed the Parse-server-example to AWS EB using the deploy button a few weeks ago. Now I want to update it so it uses the latest Parse-Server version.

So I downloaded the zip and uploaded it to my EB application. The application hung and never started (Failed to Deploy)

I then noticed that the app.config in .extensions had a new field: SERVER_URL. I updated the value, and reuploaded, but it never succeeded either. All my environment variables are set in the dashboard. They are also set in the app.config file.

Finally, I installed EB CLI and tried to upload it once again, to no avail. All I get from the console is:

iMac-10DDB1A2E9E9:birder_eb michael2$ eb push
Updating the AWS Elastic Beanstalk environment parse-server-dev...
Environment update initiated successfully.

2016-04-02 14:48:40 INFO    Deploying new version to instance(s).
Timeout for waiting Environment "parse-server-dev" finishing update.

Any idea what's happening? Am I missing something? I thought that just uploading the latest parse-server-example zip to my current EB application would do the trick.

Any help would be much appreciated. Thanks!

Here's my configuration: screen shot 2016-04-02 at 3 06 06 pm

meilers avatar Apr 02 '16 19:04 meilers

This seems to be affecting everyone who deploys from eb. See final page of comments here

nickgerig avatar Apr 02 '16 20:04 nickgerig

Yeah, so after digging in eb-activity.log I found this:

Running npm install: /opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm Setting npm config jobs to 1 npm config jobs set to 1 Running npm with --production flag Failed to run npm install. Snapshot logs for more details. Traceback (most recent call last): File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 681, in main() File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 663, in main node_version_manager.run_npm_install(options.app_path) File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 131, in run_npm_install self.npm_install(bin_path, self.config_manager.get_container_config('app_staging_dir')) File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 166, in npm_install raise e subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)

No indication on how to fix this...

meilers avatar Apr 03 '16 20:04 meilers

Per @dennisAWS (https://github.com/ParsePlatform/parse-server/issues/1276)

1.) Add the following to the .ebextensions/app.config file if you are upgrading from 2.x.x to 2.2.x:

packages:
  yum:
    krb5-devel: []

2.) If that doesn't work, then try upgrading your instance type to something larger than your t1.micro

The Parse Server Deploy button deployed my instance on a t2.nano which had issues upgrading my parse server. These two steps fixed my problem.

pbmarcano avatar Apr 06 '16 20:04 pbmarcano

Any updates on how to resolve this issue?

jc73300 avatar Apr 11 '16 15:04 jc73300

Yes. Move to Heroku. AWS Elastic Beanstalk support is terrible.

meilers avatar Apr 11 '16 15:04 meilers

@meilers haha.

Just for the record, the above suggested solutions (1&2) don't work for me. Not sure if that's the case for others.

nickgerig avatar Apr 11 '16 15:04 nickgerig

Thanks for the update, any idea when 2.2.7 will be released?-----Original Message-----

From: Tanmay Sent: Apr 14, 2016 3:36 AM To: ParsePlatform/parse-server-example Cc: jc73300 Subject: Re: [ParsePlatform/parse-server-example] Can't update parse-server-example on AWS Elastic Beanstalk (#150)

Its a known issue and will be fixed with parse-server release v2.2.7

The cause is insufficient RAM while building packages. You can find more info about it here: ParsePlatform/parse-server#1276

A temporary fix is to change instance to t2.small which comes with 2Gb RAM.

—You are receiving this because you are subscribed to this thread.Reply to this email directly or view it on GitHub

jc73300 avatar Apr 14 '16 21:04 jc73300

@nickgerig - Did you get your deployment resolved? Still having issues after applying @pbmarcano two suggestions? The one other recent issue that others (also on other providers like digital ocean) are discussing is with grpc. I'm not able to reproduce this issue here and so I don't know exactly where to focus. If you can provide us some more details regarding the most recent errors from beanstalk logs, I can take a look.

Also, depending on if you made any server changes after deployment, it may be easier to just re-deploy using the current "Deploy to AWS" link from the AWS Mobile Blog here. That parse-server-example version will deploy as version 2.1.6 and then you can upgrade by simply changing the version to ~2.2.2 and re-deploy to get the latest. If you do this, you'll have to provide the Environment Variables again which shouldn't take too long and you would be re-connecting to the existing MongoDB database.

If you are already in production, disregard this and I can provide another option such as a Blue/Green Deployment as discussed here.

dmennis avatar Apr 15 '16 23:04 dmennis

Yes I did but it was a combination of upgrading my AWS to a t2.small and as you suggested redeploying the example only instead of 2.2.2 I went with 2.2.7. After that the dashboard sees my server and it is now able to send push notifications to my ios device. Thanks for your help.-----Original Message-----

From: Dennis Hills Sent: Apr 15, 2016 4:19 PM To: ParsePlatform/parse-server-example Cc: jc73300 Subject: Re: [ParsePlatform/parse-server-example] Can't update parse-server-example on AWS Elastic Beanstalk (#150)

@nickgerig - Did you get your deployment resolved? Still having issues after applying @pbmarcano two suggestions? The one other recent issue that others (also on other providers like digital ocean) are discussing is with grpc. I'm not able to reproduce this issue here and so I don't know exactly where to focus. If you can provide us some more details regarding the most recent errors from beanstalk logs, I can take a look. Also, depending on if you made any server changes after deployment, it may be easier to just re-deploy using the current "Deploy to AWS" link from the AWS Mobile Blog here. That parse-server-example version will deploy as version 2.1.6 and then you can upgrade by simply changing the version to ~2.2.2 and re-deploy to get the latest. If you do this, you'll have to provide the Environment Variables again which shouldn't take too long and you would be re-connecting to the existing MongoDB database. If you are already in production, disregard this and I can provide another option such as a Blue/Green Deployment as discussed here.

—You are receiving this because you are subscribed to this thread.Reply to this email directly or view it on GitHub

jc73300 avatar Apr 16 '16 01:04 jc73300

@dennisAWS thanks for the detailed instructions. That worked for me. The only issue I encountered was that the original instructions don't ask you to create a VPC which is required for T2. So the initial run through from the 'Deploy to AWS' link results in a failed deployment (degraded state). I had to create a VPC and start over because I couldn't see an option to add a VPC after creating the environment.

I am working with 2 apps, one of these will be in production within a week so we might look at Blue/Green as a safe migration strategy - thanks for the link.

Note: If you do edit the blog article it would be good to add some higher res screenshots as they are virtually unreadable :)

nickgerig avatar Apr 20 '16 16:04 nickgerig

How have you guys been liking EB with Parse, Ill prob choose that over Heroku since they add a premium $$ to the service. What I dont like is the the update ability, seems like you need to upload a zip file every time you make a change, where with Heroku you just push via git?

Also since you can get multi core/cpus with AWS, how do you run more than one parse server in a cluster on the same box.. so lets say you have 4 cpus, run 3 parse servers keeping 1 cpu for operations and memory..

gateway avatar Apr 21 '16 19:04 gateway

Please try to rebuild environment then deploy application.

david-koch-pro avatar May 24 '16 11:05 david-koch-pro

For whom are unable to run or update Parse Server in EB enviroment, should use a normal EC2 instance.

For example: Choose an Ubuntu instance, like t2.micro. Install nodejs, git clone parse-server-example, do some normal parse server configurations and start parse server.

In AWS, you can use a Load Balancer and Certificate Manager to enable HTTPs and protect your server.

Elastic Beanstalk isn't the only option in Amazon Enviroment and the "Deploy to Elastic Beanstalk button" it's not necessarily the best option for beginners.

cleever avatar May 25 '16 18:05 cleever

Has anyone gotten parse-server totally working (parity with parse.com) on AWS Elastic Beanstalk?

I am having this issue: https://github.com/ParsePlatform/parse-server/issues/2061

sprabs avatar Jun 14 '16 23:06 sprabs

Did you use this to install on EB?

david-koch-pro avatar Jul 08 '16 21:07 david-koch-pro

@david-koch-pro I think the main issue still is how to update parse as new updates/fixes/features come out..

gateway avatar Jul 08 '16 22:07 gateway

Hello, I had the same issue. In my case, I wanted to update Parse Server from v2.2.17 to v2.2.23, updating package.json and using CLI eb deploy. It failed all the time, even with .ebextensions/app.config modified.

This morning I tried again and it worked, even with a t2.micro

The only difference is that I forgot to update my local folder (npm update) before "eb deploy". Maybe the error comes from the node_modules files of the local directory?

henrikperrochon avatar Nov 01 '16 08:11 henrikperrochon