Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Deployment broken #15

Open
xurei opened this issue Dec 7, 2017 · 8 comments
Open

Deployment broken #15

xurei opened this issue Dec 7, 2017 · 8 comments

Comments

@xurei
Copy link

xurei commented Dec 7, 2017

When I try to deploy a new version of my app, I get this error from Elastic Beanstalk :

Command failed on instance. Return code: 1 
Output: ln: failed to create symbolic link ‘/tmp/deployment/application/node_modules’: File exists. 
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/46cache_node_modules.sh failed. 
For more detail, check /var/log/eb-activity.log using console or EB CLI.

Did I miss something ?

@wearhere
Copy link
Contributor

wearhere commented Dec 11, 2017

Hm, it looks like the Elastic Beanstalk staging directory (/tmp/deployment/application/) is unclean for some reason. What version of the EB Node.js platform do you use and what are the contents of /opt/elasticbeanstalk/hooks/appdeploy/pre/ on one of your EC2 instances? I wonder if in a newer version of the EB platform, EB installs the node modules earlier than 50npm.sh.

Also if you run this script on a fresh EC2 instance (by terminating one of the instances in your application), does it work then?

@xurei
Copy link
Author

xurei commented Dec 14, 2017

Platform version : 4.3.0
Content of directory (without eb-fix-npm) :
01_configure_xray.sh 10clean.sh 20unzip.sh 30config_clean.sh 40install_node.sh 50npm.sh 60config_generate.sh

It works the first time, yes. But if I try to update an existing instance it does not.

@wearhere
Copy link
Contributor

Ok, my next move to debug this would be to check if, when you get the "/tmp/deployment/application/node_modules exists" error, /tmp/deployment/application/node_modules is a regular folder or already somehow is the symlink to /var/node_modules as initialized here. It might be that EB reuses the staging directory somehow on platform 4.3.0, and so that line needs to check whether the symlink exists already or not.

By the way, this module probably needs to be updated in other ways for platform 4.3.0. For instance, if you're using Node 8.x, thus npm 5, it might be that you no longer need to downgrade to npm 2 for speed reasons.

A disclaimer that's at the top of the README but I should repeat here: Mixmax no longer uses this module in favor of eb-disable-npm.

@rkrasiuk
Copy link

rkrasiuk commented Jun 16, 2018

@xurei @wearhere any update on the issue? having same trouble here

@d1manson
Copy link

ended up in a lot of EB pain.

@rkrasiuk
Copy link

rkrasiuk commented Jun 23, 2018

for anyone struggling, removing cached modules and setting up aws codepipeline helped

@dblythy
Copy link

dblythy commented Aug 14, 2018

@rkrasiuk could you please explain how to do this?

@rkrasiuk
Copy link

@dblythy well, i couldn't get direct deployment to work, so i set up aws codepipeline - webhook for github -> aws codebuild -> deployment to eb. hope that helps you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants