Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments. They generate extra noise for issue followers and do not help prioritize the request.
Tell us about your request
The elastic beanstalk has the following bug: Once an EC2 instance is terminated, the log file of the container is duplicated. This results in all messages to appear twice in CloudWatch. The fix consists in removing one unnecessary line in a systemd unit file (see below).
Create an elastic beanstalk with AMI amazon/aws-elasticbeanstalk-amzn-2.0.20220719.64bit-eb_docker_amazon_linux_2-hvm-2022-08-02T21-04 (probably also for later versions) and platform version aws-elasticbeanstalk-amzn-2.0.20220719.64bit-eb_docker_amazon_linux_2-hvm-.
Deploy any docker image with the docker compose (!) method.
SSH into the machine (or use SSM).
Ensure that your application logs to /var/log/eb-docker/containers/eb-current-app/eb-stdouterr.log on the machine.
Run systemctl restart eb-docker-compose-log.service (systemctl stop will happen during termination of an instance but we use this command here to still have access to the EC2 instance).
Verify that the log messages has doubled now in the file /var/log/eb-docker/containers/eb-current-app/eb-stdouterr.log.
Reason for the bug:
The systemd unit file /etc/systemd/system/eb-docker-compose-log.service contains the line
which duplicates all log messages (and which will then be sent to CloudWatch).
Possible fix:
Simply remove the above mentioned line from the systemd unit file.
Are you currently working around this issue?
No.
Additional information:
The bug was already reproduced by AWS Support in the support case 11043729491. They suggested to write this ticket to track the progress of fixing it.
Community Note
Tell us about your request The elastic beanstalk has the following bug: Once an EC2 instance is terminated, the log file of the container is duplicated. This results in all messages to appear twice in CloudWatch. The fix consists in removing one unnecessary line in a systemd unit file (see below).
Is this request specific to an Elastic Beanstalk platform? Docker platform branch using the compose method.
Steps to reproduce:
amazon/aws-elasticbeanstalk-amzn-2.0.20220719.64bit-eb_docker_amazon_linux_2-hvm-2022-08-02T21-04
(probably also for later versions) and platform versionaws-elasticbeanstalk-amzn-2.0.20220719.64bit-eb_docker_amazon_linux_2-hvm-
./var/log/eb-docker/containers/eb-current-app/eb-stdouterr.log
on the machine.systemctl restart eb-docker-compose-log.service
(systemctl stop
will happen during termination of an instance but we use this command here to still have access to the EC2 instance)./var/log/eb-docker/containers/eb-current-app/eb-stdouterr.log
.Reason for the bug: The systemd unit file
/etc/systemd/system/eb-docker-compose-log.service
contains the linewhich duplicates all log messages (and which will then be sent to CloudWatch).
Possible fix: Simply remove the above mentioned line from the systemd unit file.
Are you currently working around this issue? No.
Additional information: The bug was already reproduced by AWS Support in the support case 11043729491. They suggested to write this ticket to track the progress of fixing it.