Skip to content

ElasticBeanstalk fail to upload the code "Yum does not have awslogs available for installation"

0

Hello, I've created an Elasticbeanstalc application (Amazon Linux 2023/4.2.4) with a load balancer to use an SSL certificate. When I upload the code manually the deployment has no problems at all and it's completed successfully. But when I use the GitLab pipeline with the following script for the deployment it fails.

#Copy target jar into bucket
- aws s3 cp ./target/$ARTIFACT s3://$S3_BUCKET/$ARTIFACT
#Create a new version of the artifact in the s3 bucket
- aws elasticbeanstalk create-application-version --application-name $AWS_APPLICATION_NAME --version-label $CI_PIPELINE_IID --source-bundle S3Bucket=$S3_BUCKET, S3Key=$ARTIFACT_LONG_NAME
#Update environment
- aws elasticbeanstalk update-environment --application-name $AWS_APPLICATION_NAME --environment-name $AWS_PRODUCTION_ENVIRONMENT_NAME --version-label $CI_PIPELINE_IID

The error from cfn-init.log is: [ERROR] Error encountered during build of application: Yum does not have awslogs available for installation Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/cfnbootstrap/construction.py", line 579, in run_config CloudFormationCarpenter(config, self._auth_config, self.strict_mode).build(worklog) File "/usr/lib/python3.9/site-packages/cfnbootstrap/construction.py", line 244, in build changes['packages'][manager] = CloudFormationCarpenter._packageToolsmanager.apply(packages, File "/usr/lib/python3.9/site-packages/cfnbootstrap/rpm_tools.py", line 76, in apply raise ToolError("Yum does not have %s available for installation" % pkg_spec) cfnbootstrap.construction_errors.ToolError: Yum does not have awslogs available for installation [ERROR] -----------------------BUILD FAILED!------------------------

Thanks in advance.

asked 2 years ago859 views
2 Answers
1

Hello.

It is thought that the error occurs because "awslogs" is not included in Amazon Linux2023.
Are you trying to install "awslogs" by installing a package?
https://docs.aws.amazon.com/linux/al2023/release-notes/all-packages-AL2023.4.html

EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago
0

Hello,

The older aws logs-only agent is deprecated and is no longer supported in AL 2023

Packages not supported in AL 2023: https://docs.aws.amazon.com/linux/al2023/release-notes/removed-AL2023.4-AL2.html

You can refer this thread in stack overflow to fix this issue: https://stackoverflow.com/questions/77390043/how-to-stream-custom-logs-to-cloudwatch-from-al2023-instances

EXPERT
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.