error while running update environment in elastic beanstalk - amazon-web-services

Hi Could someone help with the following error on one of our elastic beanstalk application please.
ERROR Docker container quit unexpectedly after launch: lipse.jetty.server.Server.doStart(Server.java:431) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at winstone.Launcher.<init>(Launcher.java:152) ... 7 more. Check snapshot logs for details.
[Instance: i--------] Command failed on instance. Return code: 1 Output: (TRUNCATED)...xpectedly after launch: lipse.jetty.server.Server.doStart(Server.java:431) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at winstone.Launcher.<init>(Launcher.java:152) ... 7 more. Check snapshot logs for details. Hook /opt/elasticbeanstalk/hooks/appdeploy/enact/00run.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
This error occurs when running the following update command is run:
aws elasticbeanstalk update-environment \
--application-name app_name \
--environment-name --------- \
--version-label ------- \
--template-name ------- \
--region eu-west-1
Thanks

Related

AWS EMR - Terminated with errors On the master instance application provisioning failed

I'm provisioning an EMR cluster emr-5.30.0. I run this using Terraform and get the following error on AWS CONSOLE as it fails.
Amazon EMR Cluster j-11I5FOBxxxxxx has terminated with errors at 2020-10-26 19:51 UTC with a reason of BOOTSTRAP_FAILURE.
I don't have any bootstrap steps. I can't view any logs either to see what is happening. Log URI is blank and can't SSH to cluster too since it's terminated.
Any pointers would be appreciated?
Providing AWS-CLI-EXPORT output:
aws emr create-cluster --auto-scaling-role EMR_AutoScaling_DefaultRole --applications Name=Spark --tags 'Account=xxx' 'Function=xxx' 'Repository=' 'Mail=xxx#xxx.com' 'Slack=xxx' 'Builder=xxx' 'Environment=xxx' 'Service=xxx xxx xxx' 'Team=xxx' 'Name=xxx-xxx-xxx' --ebs-root-volume-size 100 --ec2-attributes '{"KeyName":"xxx","AdditionalSlaveSecurityGroups":[""],"InstanceProfile":"EMR_EC2_DefaultRole","ServiceAccessSecurityGroup":"sg-xxx","SubnetId":"subnet-xxx","EmrManagedSlaveSecurityGroup":"sg-xxx","EmrManagedMasterSecurityGroup":"sg-xxx","AdditionalMasterSecurityGroups":[""]}' --service-role EMR_DefaultRole --release-label emr-5.30.0 --name 'xxx-xxx-xxx' --instance-groups '[{"InstanceCount":1,"EbsConfiguration":{"EbsBlockDeviceConfigs":[{"VolumeSpecification":{"SizeInGB":32,"VolumeType":"gp2"},"VolumesPerInstance":4}]},"InstanceGroupType":"MASTER","InstanceType":"m5.2xlarge","Name":""},{"InstanceCount":2,"EbsConfiguration":{"EbsBlockDeviceConfigs":[{"VolumeSpecification":{"SizeInGB":40,"VolumeType":"gp2"},"VolumesPerInstance":1}]},"InstanceGroupType":"CORE","InstanceType":"m5.2xlarge","Name":""}]' --configurations '[{"Classification":"hadoop-env","Properties":{},"Configurations":[{"Classification":"export","Properties":{"PYSPARK_PYTHON":"/usr/bin/python3","JAVA_HOME":"/usr/lib/jvm/java-1.8.0"}}]},{"Classification":"spark-env","Properties":{},"Configurations":[{"Classification":"export","Properties":{"PYSPARK_PYTHON":"/usr/bin/python3","JAVA_HOME":"/usr/lib/jvm/java-1.8.0"}}]}]' --scale-down-behavior TERMINATE_AT_TASK_COMPLETION --region eu-west-2
Issue was due to JAVA_HOME incorrectly set.
JAVA_HOME":"/usr/lib/jvm/java-1.8.0"
Resolution: Check logs in S3 under: provision-node/reports and it should tell you which bootstrap step fails...
Try to change the instance type and try running it in different AZ and see if problem persists.
Building a cluster with emr-6.2.0 on md5.xlarge, this is JAVA_HOME:
/usr/lib/jvm/java-1.8.0-amazon-corretto.x86_64

Amazon ECS "the referenced cluster was inactive"

I followed the steps to install the ECS client on Ubuntu 16, but when I try to run the ECS container agent, it keeps restarting and when I have a look at the logs
2016-12-07T06:01:39Z [INFO] Starting Agent: Amazon ECS Agent - v1.13.1 (efe53c6)
2016-12-07T06:01:39Z [INFO] Loading configuration
2016-12-07T06:01:39Z [INFO] Checkpointing is enabled. Attempting to load state
2016-12-07T06:01:39Z [INFO] Loading state! module="statemanager"
2016-12-07T06:01:39Z [INFO] Event stream ContainerChange start listening...
2016-12-07T06:01:39Z [INFO] Detected Docker versions [1.17 1.18 1.19 1.20 1.21 1.22 1.23]
2016-12-07T06:01:39Z [INFO] Registering Instance with ECS
2016-12-07T06:01:39Z [ERROR] Could not register module="api client" err="ClientException: The referenced cluster was inactive.
status code: 400, request id: 9eaa4124-bc42-11e6-9cf1-7559dea2bdf8"
2016-12-07T06:01:39Z [ERROR] Error registering: ClientException: The referenced cluster was inactive.
status code: 400, request id: 9eaa4124-bc42-11e6-9cf1-7559dea2bdf8
I didn't find a reference for this error on google and I'm wondering what's wrong...
Do I need to create the cluster name on the ECS dashboard ?
I have attacher the container role to my EC2 instance, which allows for cluster creation so I don't think the problem comes from here...
My docker run config
sudo docker run --name ecs-agent \
--detach=true \
--restart=on-failure:10 \
--volume=/var/run/docker.sock:/var/run/docker.sock \
--volume=/var/log/ecs/:/log \
--volume=/var/lib/ecs/data:/data \
--net=host \
--env=ECS_LOGFILE=/var/log/ecs-agent.log \
--env=ECS_LOGLEVEL=info \
--env=ECS_DATADIR=/data \
--env=ECS_CLUSTER=my-cluster \
--env=ECS_ENABLE_TASK_IAM_ROLE=true \
--env=ECS_ENABLE_TASK_IAM_ROLE_NETWORK_HOST=true \
amazon/amazon-ecs-agent:latest
You need to call aws ecs create-cluster --region $REGION --cluster my-cluster, call the CreateCluster API through the SDK, or create it in the console. The ECS agent will only automatically create a cluster named default, and only when ECS_CLUSTER is unspecified.

AWS CLI - CodeDeploy Create-Deployment has Unknown Options error

I have a normal CodeDeploy package which is able to deployed using the Console without any issues, but when using the CLI, I get a weird error.
aws deploy create-deployment --application-name MyApp --s3-location bucket=mybucket,key=My.Zip.1.1.1.zip,bundleType=zip --deployment-group-name MyDeploymentGroup --deployment-config-name CodeDeployDefault.OneAtATime --description "This throwns an error"
Running the above, I get the following returned:
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
Unknown options: bundleType=zip, key=My.Zip.1.1.1.zip
Weird, since the help does say you need bundleType and key in the s3-location parameter. Just as a test, I remove these unknown options:
aws deploy create-deployment --application-name MyApp --s3-location bucket=mybucket --deployment-group-name MyDeploymentGroup --deployment-config-name CodeDeployDefault.OneAtATime --description "This throwns an error"
Which returns:
--s3-location must specify bucket, key and bundleType.
So, now you know of these options and require them? What is going on here? Am I missing something obvious?
When I ran the code you provided, I got the following returned:
$ aws --version
aws-cli/1.10.60 Python/2.7.11 Darwin/15.6.0 botocore/1.4.50
$ aws deploy create-deployment --application-name ...snip
An error occurred (ApplicationDoesNotExistException) when calling the CreateDeployment operation: No application found for name: MyApp
And this(AWS server side error) is the expected behaviour(I guess).
One possibility that your CLI raised the validation error is that your AWS CLI is out of date.
Which version is your AWS CLI?
I had the same issue. It seemed to be related to the version of PowerShell. It worked on v5, but not on v4.
To fix it, I just put double quotes around the s3-location argument:
aws deploy create-deployment --application-name MyApp --s3-location "bucket=mybucket,key=My.Zip.1.1.1.zip,bundleType=zip" --deployment-group-name MyDeploymentGroup --deployment-config-name CodeDeployDefault.OneAtATime --description "This throwns an error"

AWS CodeDeploy - Error deploying - ApplicationDoesNotExistException

I want to deploy a project in AWS using :
$ aws --region eu-central-1 deploy push --application-name DemoApp --s3-location s3://paquirrin-codedeploy/Project1.zip --ignore-hidden-file --source .
But I got this error:
A client error (ApplicationDoesNotExistException) occurred when calling the RegisterApplicationRevision operation: Applications not found for 289558260222
but the application exists:
$ aws deploy list-applications
{
"applications": [
"DemoApp"
]
}
and CodeDeploy agent is running
[root#ip-171-33-54-212 ~]# /etc/init.d/codedeploy-agent status
The AWS CodeDeploy agent is running as PID 2649
but I haven't found the folder deployment-root inside /opt/codedeploy-agent !
You are deploying to region eu-central-1. But you may not be listing the applications in eu-central-1 using following command:
aws deploy list-applications
Instead, use following command to ensure that application exists:
aws deploy list-applications --region eu-central-1

getting an error when doing code deploy

I'm running the following command to do a code deploy from jenkins to EC2 server
aws deploy create-deployment --application-name $APPNAME --s3-location bucket=$S3BUCKET,key=chefdeployment.zip,bundleType=zip --deployment-group-name $DEPLOYMENTGROUPNAME --deployment-config-name CodeDeployDefault.HalfAtATime --description "Deploy" --region us-east-1 --profile $PROFILE --output text
I am getting the following error
A client error (InstanceIdRequiredException) occurred when calling the GetDeploymentInstance operation: Instance ID is Missing.
Has anyone seen this error before?
InstanceIdRequiredException doesn't seem to be an exception that we throw when call create-deployment from CLI.
The exception seems to be thrown when you call get-deployment-instance, and instanceId is required. Here is the doc for reference: http://docs.aws.amazon.com/cli/latest/reference/deploy/get-deployment-instance.html