Search This Blog

Tuesday, October 29, 2019

Amzaon Linux syslog error: CRIT amazon-ssm-agent: caused by: EC2MetadataError: failed to make EC2Metadata request

Recently got this error from syslog: CRIT amazon-ssm-agent: caused by: EC2MetadataError: failed to make EC2Metadata request It is a EC2 Instance not management by amazon-ssm.

AWS Systems Manager Agent (SSM Agent) is Amazon software that can be installed and configured on an Amazon EC2 instance, an on-premises server, or a virtual machine (VM). SSM Agent makes it possible for Systems Manager to update, manage, and configure these resources. The agent processes requests from the Systems Manager service in the AWS Cloud, and then runs them as specified in the request.

It is safe to drop the package amazon-ssm-agent.

First check and stop the status:
# systemctl status amazon-ssm-agent.service
● amazon-ssm-agent.service - amazon-ssm-agent
   Loaded: loaded (/usr/lib/systemd/system/amazon-ssm-agent.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-10-28 17:04:27 EDT; 1 day 3h ago
 Main PID: 3285 (amazon-ssm-agen)
   CGroup: /system.slice/amazon-ssm-agent.service
           └─3285 /usr/bin/amazon-ssm-agent

Oct 28 23:39:27 local amazon-ssm-agent[3285]: ...

# systemctl stop amazon-ssm-agent.service
Drop the package:
# yum erase amazon-ssm-agent
Loaded plugins: etckeeper, extras_suggestions, langpacks, priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package amazon-ssm-agent.x86_64 0:2.3.662.0-1.amzn2 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================
 Package                              Arch                       Version                                  Repository                       Size
================================================================================================================================================
Removing:
 amazon-ssm-agent                     x86_64                     2.3.662.0-1.amzn2                        @amzn2-core                      61 M

Transaction Summary
================================================================================================================================================
Remove  1 Package

Installed size: 61 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
etckeeper: pre transaction commit
  Erasing    : amazon-ssm-agent-2.3.662.0-1.amzn2.x86_64                                                                                    1/1
etckeeper: post transaction commit
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 597 bytes | 597.00 KiB/s, done.
Total 6 (delta 5), reused 0 (delta 0)
  Verifying  : amazon-ssm-agent-2.3.662.0-1.amzn2.x86_64                                                                                    1/1

Removed:
  amazon-ssm-agent.x86_64 0:2.3.662.0-1.amzn2

Complete!

No comments:

Post a Comment