Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command start_cloudwatch_agent failed #74

Open
rombat opened this issue Aug 5, 2022 · 2 comments
Open

Command start_cloudwatch_agent failed #74

rombat opened this issue Aug 5, 2022 · 2 comments

Comments

@rombat
Copy link

rombat commented Aug 5, 2022

Hi
I keep on having this error and I can't find how to fix it:

eb-engine.log

2022/08/05 07:31:35.220810 [INFO] Executing instruction: GetToggleForceRotate
2022/08/05 07:31:35.220814 [INFO] Checking if logs need forced rotation
2022/08/05 07:31:35.220832 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:eu-west-1:373913685911:stack/awseb-e-8biyafh8zx-stack/2d2ddbc0-c631-11ec-82c6-0ab720d385df -r AWSEBAutoScalingGroup --region eu-west-1
2022/08/05 07:31:35.634737 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:eu-west-1:373913685911:stack/awseb-e-8biyafh8zx-stack/2d2ddbc0-c631-11ec-82c6-0ab720d385df -r AWSEBBeanstalkMetadata --region eu-west-1
2022/08/05 07:31:35.926535 [INFO] Procfile not found. Generating default rsyslog config
2022/08/05 07:31:35.928038 [INFO] Running command /bin/sh -c systemctl restart rsyslog.service
2022/08/05 07:31:35.948521 [INFO] Executing instruction: PostBuildEbExtension
2022/08/05 07:31:35.948556 [INFO] Starting executing the config set Infra-EmbeddedPostBuild.
2022/08/05 07:31:35.948570 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-init -s arn:aws:cloudformation:eu-west-1:373913685911:stack/awseb-e-8biyafh8zx-stack/2d2ddbc0-c631-11ec-82c6-0ab720d385df -r AWSEBAutoScalingGroup --region eu-west-1 --configsets Infra-EmbeddedPostBuild
2022/08/05 07:31:44.421555 [INFO] Error occurred during build: Command start_cloudwatch_agent failed

2022/08/05 07:31:44.422076 [ERROR] An error occurred during execution of command [app-deploy] - [PostBuildEbExtension]. Stop running the command. Error: Container commands build failed. Please refer to /var/log/cfn-init.log for more details. 

cfn-init.log

2022-08-05 07:31:44,395 [ERROR] Command start_cloudwatch_agent (/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/laravel_logs.json) failed
2022-08-05 07:31:44,395 [ERROR] Error encountered during build of postbuild_1_quadratus_stripe: Command start_cloudwatch_agent failed
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 576, in run_config
    CloudFormationCarpenter(config, self._auth_config).build(worklog)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 276, in build
    self._config.commands)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py", line 127, in apply
    raise ToolError(u"Command %s failed" % name)
cfnbootstrap.construction_errors.ToolError: Command start_cloudwatch_agent failed
2022-08-05 07:31:44,396 [ERROR] -----------------------BUILD FAILED!------------------------
2022-08-05 07:31:44,396 [ERROR] Unhandled exception during build: Command start_cloudwatch_agent failed
Traceback (most recent call last):
  File "/opt/aws/bin/cfn-init", line 176, in <module>
    worklog.build(metadata, configSets)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 137, in build
    Contractor(metadata).build(configSets, self)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 564, in build
    self.run_config(config, worklog)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 576, in run_config
    CloudFormationCarpenter(config, self._auth_config).build(worklog)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 276, in build
    self._config.commands)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py", line 127, in apply
    raise ToolError(u"Command %s failed" % name)
cfnbootstrap.construction_errors.ToolError: Command start_cloudwatch_agent failed

If anyone has any idea, that would be appreciated. Thanks in advance

@Frtrillo
Copy link

Frtrillo commented Sep 26, 2022

Have same issue, its because the .ebextension 02_logs_cloudwatch_imds2.config isn't creating the file:
/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/laravel_logs.json or is creating it and getting deleted after deploy
If I create the file manually it works

@Frtrillo
Copy link

Frtrillo commented Sep 26, 2022

Have same issue, its because the .ebextension 02_logs_cloudwatch_imds2.config isn't creating the file: /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/laravel_logs.json or is creating it and getting deleted after deploy If I create the file manually it works

Fixed in PR #79

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

No branches or pull requests

2 participants