Skip to content

Error: "Unable to gain necessary access for possible kernel updates" when running AWS-RunPatchBaseline document via Systems Manager

0

Hi, I'm trying to run the AWS-RunPatchBaseline SSM document to apply updates on my EC2 instance, but I'm getting the following error in the Run Command output:

Unable to gain necessary access for possible kernel updates, code: 1

Environment: OS: Amazon Linux 2 SSM Agent: Installed with 3.3.2656.0 version IAM Role: AmazonSSMManagedInstanceCore is attached Instance State: Managed and reachable by SSM How can I resolve this and ensure that kernel patches are applied successfully?

2 Answers
4

It may related to Kernel Headers or Tools missing, SSM agent permissions and agent version.

EXPERT
answered a year ago
  • How can I correct this error. My weekly maintainence widow is getting failed due this .

-5

The Unable to gain necessary access for possible kernel updates, code: 1. seems to be just a warning and could be ignored. It should not cause any issue to the patching operation.

This issue has been discussed in the GitHub issues for the aws/amazon-ssm-agent repository:

The behavior of the AWS-RunPatchBaseline document is similar to running "yum update-minimal --security --bugfix" (for RHEL / Amazon Linux). During the execution, one of the helper scripts attempts to set the SELinux context of another main script to that of the yum binary. If SELinux is disabled and there are no contexts set for yum, the chcon (command to change SELinux context) command will fail, resulting in the above warning message in the Run Command output.

Recommendation:

The warning message can be safely ignored, as it does not affect the patching operation itself. If you would like to investigate further, you could provide the complete output of the AWS-RunPatchBaseline document, which may help to troubleshoot the issue in more detail.

AWS
EXPERT
answered a year 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.