aws / amazon-ssm-agent

An agent to enable remote management of your EC2 instances, on-premises servers, or virtual machines (VMs).
https://aws.amazon.com/systems-manager/
Apache License 2.0
1.06k stars 324 forks source link

Snap Version Update for Ubuntu 24.04 #581

Open sino1641 opened 3 months ago

sino1641 commented 3 months ago

Hi Team, I am using the official Ubuntu 24.04 AMI with ssm agent 3.3.131.0 pre-installed with snap. But it comes with an error:

snap.amazon-ssm-agent.amazon-ssm-agent.service - Service for snap application amazon-ssm-agent.amazon-ssm-agent
     Loaded: loaded (/etc/systemd/system/snap.amazon-ssm-agent.amazon-ssm-agent.service; enabled; preset: enabled)
     Active: active (running) since   3min 39s ago
   Main PID: 1256 (amazon-ssm-agen)
      Tasks: 17 (limit: 4609)
     Memory: 21.3M (peak: 23.9M)
        CPU: 399ms
     CGroup: /system.slice/snap.amazon-ssm-agent.amazon-ssm-agent.service
             ├─1256 /snap/amazon-ssm-agent/7993/amazon-ssm-agent
             └─1278 /snap/amazon-ssm-agent/7993/ssm-agent-worker

amazon-ssm-agent.amazon-ssm-agent[1256]: INFO [EC2Identity] Checking disk for registration info
amazon-ssm-agent.amazon-ssm-agent[1256]: INFO [EC2Identity] No registration info found for ec2 instance, attempting registration
amazon-ssm-agent.amazon-ssm-agent[1256]: INFO [EC2Identity] Found registration keys
amazon-ssm-agent.amazon-ssm-agent[1256]: INFO [EC2Identity] Checking write access before registering
amazon-ssm-agent.amazon-ssm-agent[1256]: INFO [EC2Identity] Registering EC2 instance with Systems Manager
amazon-ssm-agent.amazon-ssm-agent[1256]: ERROR [Registrar] failed to register identity: error calling RegisterManagedInstance API: ValidationException: Feature not enabled
amazon-ssm-agent.amazon-ssm-agent[1256]:         status code: 400, request id: 
amazon-ssm-agent.amazon-ssm-agent[1256]: INFO [Registrar] sleeping for 2.533333333333333 minutes before retrying registration

I also tried updating to the candidate version 3.3.551.0 but with the same error.

After contacting AWS Support, they advised me to use deb installation 3.3.551.0-1 and everything works fine. Given the scenario, it seems an update on Snap is needed for seamless experience on Ubuntu 24.04 EC2 instances.

alanfwilliams commented 3 months ago

How did you do the deb installation? I'm struggling to get the agent to work.

sino1641 commented 3 months ago

How did you do the deb installation? I'm struggling to get the agent to work.

Hi, Please check this: https://docs.amazonaws.cn/en_us/systems-manager/latest/userguide/agent-install-deb.html#quick-install-debian

sino1641 commented 3 months ago

Also, is there any official support here? Or do we need to feedback on the official forum?

Aperocky commented 1 month ago

Attempted to reproduce with the AMI ami-0866a3c8686eaeeba, but could not reproduce:

2024-10-22 19:33:56 INFO [amazon-ssm-agent] amazon-ssm-agent - v3.3.131.0
2024-10-22 19:33:56 INFO [amazon-ssm-agent] OS: linux, Arch: amd64
2024-10-22 19:33:56 INFO [amazon-ssm-agent] Starting Core Agent
2024-10-22 19:33:56 INFO [amazon-ssm-agent] Registrar detected. Attempting registration
2024-10-22 19:33:56 INFO [Registrar] Starting registrar module
2024-10-22 19:33:56 INFO [EC2Identity] Checking disk for registration info
2024-10-22 19:33:56 INFO [EC2Identity] No registration info found for ec2 instance, attempting registration
2024-10-22 19:33:56 INFO [EC2Identity] Generating registration keypair
2024-10-22 19:33:57 INFO [EC2Identity] Checking write access before registering
2024-10-22 19:33:57 INFO [EC2Identity] Registering EC2 instance with Systems Manager
2024-10-22 19:33:57 INFO [EC2Identity] EC2 registration was successful.

Suspecting instance profile related issue when you see that registration is not successful, instead of Agent software issue. Did you look into changing the instance profile?