why eb deploy failed on first deploy? - amazon-web-services

I have created 2 NodeJs environments. It works fine.
Later created a new environment and eb deploy env_name give me the following error:
Creating application version archive "app-ceb7-200713_223016".
Uploading appname/app-ceb7-xxxxx.zip to S3. This may take a while.
Upload Complete.
2020-07-13 17:00:23 INFO Environment update is starting.
2020-07-13 17:00:44 INFO Deploying new version to instance(s).
2020-07-13 17:00:50 ERROR [Instance: i-066f599db7ee34] Command failed on instance.
An unexpected error has occurred [ErrorCode: 0000000001].
2020-07-13 17:00:50 INFO Command execution completed on all instances. Summary:
[Successful: 0, Failed: 1].
2020-07-13 17:00:50 ERROR Unsuccessful command execution on instance id(s) 'i-
06682f599db76ee34'. Aborting the operation.
2020-07-13 17:00:50 ERROR Failed to deploy application.
ERROR: ServiceError - Failed to deploy application.
Why this happen? Thanks in advance

Based on the comments.
To solve the issue, EB logs were inspected to identify the error message:
[app-deploy] - [Install customer specified node.js version]. Stop running the command. Error: unsupported node version >=6, please specify any of node versions in [v12.0.0 v12.1.0 v12.10.0 v12.11.0 v12.11.1 v12.12.0 v12.13.0 v12.13.1 v12.14.0 v12.14.1 v12.15.0 v12.16.0 v12.16.1 v12.16.2 v12.16.3 v12.17.0 v12.18.0 v12.18.1 v12.2.0 v12.3.0 v12.3.1 v12.4.0 v12.5.0 v12.6.0 v12.7.0 v12.8.0 v12.8.1 v12.9.0 v12.9.1]
Then, the correct version of the nodejs was specified in package.json:
"engines": { "node": "12.13.0"},

Related

I am getting "Deployment completed, but with errors: During an aborted deployment, some instances may have deployed the new application version."

I am getting Action execution failed
Deployment completed, but with errors: During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version. Failed to deploy application. Unsuccessful command execution on instance id(s) 'i-0a956bec0b978125a'. Aborting the operation. [Instance: i-0a956bec0b978125a] Command failed on instance. Return code: 1 Output: Engine execution has encountered an error.. Instance deployment failed. For details, see 'eb-engine.log'. error while deploying via code pipeline.
I have no idea why this error occurring. My application is a legacy spring 1.5.9 application built on java 8.
My buildspec.yml:
phases:
install:
runtime-versions:
java: corretto8
build:
commands:
- java -version
- mvn clean install
artifacts:
files:
- target/d_campus.jar
Its about 4 hours.....I am stucked. Please help

Deployment of dotnet core application fails in Elastic Beanstalk

I have created Elastic Beanstalk using Cloudformation template and deploying a dotnet core application in it. While trying to deploy it, the deployment was failing and it shows the below issues:
Inside my environments in Beanstalk im seeing below error:
Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.
[Instance: i-0d2a1ee08dc2813ff ConfigSet: Infra-EmbeddedPreBuild, Hook-PostInit, Hook-PreAppDeploy, Infra-EmbeddedPostBuild, Hook-EnactAppDeploy, Hook-PostAppDeploy, Infra-WriteVersionOnStartup] Command failed on instance. Return code: 1 Output: null.
The Health status is showing severe and if I visit the causes, im getting the below error:
Application deployment failed at 2021-08-19T05:36:34Z with exit status 1 and error: .
Process default has been unhealthy for 19 minutes (Target.FailedHealthChecks).
In Cloudwatch log groups, the deployment log shows the below deployment failure:
AWSBeanstalkCfnDeploy.DeploymentUtils - Unexpected Exception: System.Exception: Exception during deployment. ---> Microsoft.Web.Deployment.DeploymentDetailedException: Object of type 'package' and path 'C:\cfn\ebdata\source_bundle_final.zip' cannot be created. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEPTION_WHILE_CREATING_OBJECT. ---> Microsoft.Web.Deployment.DeploymentException: The Zip package 'C:\cfn\ebdata\source_bundle_final.zip' could not be loaded. ---> System.IO.FileNotFoundException: Could not find file 'C:\cfn\ebdata\source_bundle_final.zip'
INFO 1 AWSBeanstalkCfnDeployApp.DeployApp - Event [ERROR]: Deployment Failed: Unexpected Exception
I am using Solution stack as "64 bit windows server 2019 v2.6.8 running IIS 10.0", not sure if that is causing the issue. Can someone provide your inputs on the deployment part on what could could be the issue ? Thanks!

EB throwing nodejs version error during deployment

I'm trying to deploy a nodejs app on elastic beanstalk. I create the environment with nodejs 10, matching the nodejs version in my package.json. The deployment fails, and the logs show
An error occurred during execution of command [app-deploy] - [Install customer specified node.js version]. Stop running the command. Error: unsupported node version v10.23.1, please specify any of node versions in [v10.0.0 v10.1.0 v10.10.0 v10.11.0 v10.12.0 v10.13.0 v10.14.0 v10.14.1 v10.14.2 v10.15.0 v10.15.1 v10.15.2 v10.15.3 v10.16.0 v10.16.1 v10.16.2 v10.16.3 v10.17.0 v10.18.0 v10.18.1 v10.19.0 v10.2.0 v10.2.1 v10.20.0 v10.20.1 v10.21.0 v10.22.0 v10.22.1 v10.23.0 v10.23.1 v10.23.2 v10.23.3 v10.24.0 v10.3.0 v10.4.0 v10.4.1 v10.5.0 v10.6.0 v10.7.0 v10.8.0 v10.9.0]
My package.json include:
"engines": {
"node": "v10.23.1", # I've tried 10.23.1, ^10.23.1, etc
"npm": ">=6.14.10"
}
This error appears to be non-sensical - am I missing something about EB?

AWS: ERROR: Pre-processing of application version xxx has failed and Some application versions failed to process. Unable to continue deployment

Hi I am trying to deploy a node application from cloud 9 to ELB but I keep getting the below error.
Starting environment deployment via CodeCommit
--- Waiting for Application Versions to be pre-processed --- ERROR: Pre-processing of application version app-491a-200623_151654 has
failed. ERROR: Some application versions failed to process. Unable to
continue deployment.
I have attached an image of the IAM roles that I have. Any solutions?
Go to your console and open up your elastic beanstalk console. Go to both applications and environments and delete them. Then in your terminal hit
eb init #Follow instructions
eb create --single ##Follow instructions.
It would fix the error, which is due to some application states which are failed. If you want to check those do
aws elasticbeanstalk describe-application-versions
I was searching for this answer as a result of watching a YouTube tutorial for how to pass the AWS Certified Developer Associate exam. If anyone else gets this error as a result of that tutorial, delete the 002_node_command.config file created in the tutorial and commit that change, as that is causing the error to occur.
A failure within the pre-processing phase, may be caused by an invalid manifest, configuration or .ebextensions file.
If you deploy an (invalid) application version using eb deploy and you enable the preprocess option, The details of the error will not be revealed.
You can remove the --process flag and enable the verbose option to improve error output.
in my case I deploy using this command:
eb deploy -l "XXX" -p
And can return a failure when I mess around with .ebextensions:
ERROR: Pre-processing of application version xxx has failed.
ERROR: Some application versions failed to process. Unable to continue deployment.
With that result I can't figure up what is wrong,
but deploying without -p (or --process)and adding -v (verbose) flag:
eb deploy -l "$deployname" -v
It returns something more useful:
Uploading: [##################################################] 100% Done...
INFO: Creating AppVersion xxx
ERROR: InvalidParameterValueError - The configuration file .ebextensions/16-my_custom_config_file.config in application version xxx contains invalid YAML or JSON.
YAML exception: Invalid Yaml: while scanning a simple key
in 'reader', line 6, column 1:
(... details of the error ...)
, JSON exception: Invalid JSON: Unexpected character (#) at position 0.. Update the configuration file.
Now I can fix the problem.

AWS Elastic Beanstalk Issues Failed to deploy on all servers

Yesterday and today i tried to deploy on aws eb but I always get this error:
INFO: Environment update is starting.
INFO: Deploying new version to instance(s).
INFO: Environment health has transitioned from Ok to Info. Command is executing on all instances.
WARN: Environment health has transitioned from Info to Severe. None of the instances are sending data.
ERROR: Failed to run npm install. Snapshot logs for more details.
ERROR: [Instance: i-0632a672238b6ee0b] Command failed on instance. Return code: 1 Output: (TRUNCATED).../opt/elasticbeanstalk/containerfiles/ebnode.py", line 166, in npm_install
raise e
subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.2.3-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status -9.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Unsuccessful command execution on instance id(s) 'i-0632a672238b6ee0b'. Aborting the operation.
ERROR: Failed to deploy application.
ERROR: Failed to deploy application.
The built was successfull yesterday and i tried to push the old version and on another instance i just tried to deploy again. every instance is now in status severe or degraded.
Is this a aws issues, did i do something wrong? I did all the steps i do everyday and until now i never had any issues. Even after i uploaded the old applicationzip which was okay nothing changed.
I am having exactly the same issue. Build started to fail during the last weekend. Due to logs, the problem seems to be that while running npm install, the process runs out of memory. It doesn't matter whether I deploy directly or use a Docker container.
I am using a free tier micro instance with 1 GB of memory. I just can't understand why it worked before and now it doesn't work even if I deploy the same version that was working before...