Troubleshooting AWS Systems Manager Cloud Extensions
Find solutions to common issues with AWS Systems Manager Cloud Extensions, such as installation, profile loading, connection, and authentication errors.
Topics
Installation issues
Lambda extension not loading
Symptom: The Cloud Extensions runtime doesn't appear in the logs of your Lambda function after you add the layer.
Check the layer ARN:
Confirm that you used the ARN for the architecture of your function:
# For x86_64 functions aws ssm get-parameter \ --name /aws/service/aws-cloudextensions/lambda-extension/amd64/latest \ --query 'Parameter.Value' --output text # For arm64 functions aws ssm get-parameter \ --name /aws/service/aws-cloudextensions/lambda-extension/arm64/latest \ --query 'Parameter.Value' --output text
Verify that your function uses the layer:
aws lambda get-function-configuration \ --function-name my-function \ --query 'Layers'
Check the function logs:
aws logs tail /aws/lambda/my-function --follow
Look for startup messages from the runtime that show that it loaded the profile.
If you see no Cloud Extensions log lines, the layer might not be part of the function version that you invoked. Deploy the function again after you attach the layer.
Container runtime not starting
Symptom: The Cloud Extensions runtime doesn't start in a containerized environment.
Verify the image:
docker pull public.ecr.aws/aws-cloudextensions/cloudextensions-runtime:latest
Check the container logs:
docker logscontainer-id
Common causes:
-
AWS credentials not available in the container
The runtime uses the AWS credentials that the container has. Check that your container platform provides credentials to the container, and that the credentials allow the
cloudextensions:SyncStateaction. For more information, see Permissions for the runtime. -
Network connectivity
Verify that the container can reach AWS endpoints:
curl -I https://ssm.us-east-1.amazonaws.com
API errors
When a Cloud Extensions API call fails, the error type tells you the cause. The following sections describe each error type.
ValidationException
HTTP status: 400
The request has a parameter value that isn't valid, or the service can't parse the request. The error includes a reason and, when available, a list of errors that identify each problem:
-
FIELD_VALIDATION_FAILED – One or more input fields failed validation. Each item in
errorsis either a field constraint or a semantic error. A field constraint names the field, the value, and the constraint that the value violated. A semantic error describes the problem and names the item that the problem applies to. -
CANNOT_PARSE – The service couldn't parse the request body, or the body doesn't have the shape that the operation expects. Check that your JSON is valid.
-
UNKNOWN_OPERATION – The operation doesn't exist. Check the operation name and the version of your CLI or SDK.
Common validation problems:
-
A profile name that breaks the naming rules: 2 to 32 characters, a lowercase letter first, and only lowercase letters, numbers, hyphens, and underscores
-
A version selector that doesn't follow the selector format, such as
latest -
A value in
--settingsthat doesn't satisfy the setting definitions of the extension -
A capability path in
--approvethat the extension doesn't declare (UNKNOWN_CAPABILITY), or an--approvelist that leaves out a required capability (REQUIRED_CAPABILITY_REQUIRES_APPROVAL) -
A request that sets a base path (
BASE_PATH_LOCKED) -
More than 50 tags, or more than 100 capability paths in the
--approveoption
To see the setting definitions and the declared capabilities of an extension, run the get-extension command.
ResourceNotFoundException
HTTP status: 404
The resource doesn't exist, or you don't have permission to access the resource. The error includes the type of the resource and the identifier that you used.
-
Check the identifier. You can use the ID or the name of a profile or an extension.
-
Check that you use the correct AWS account and AWS Region.
-
Check that your IAM policy allows the action on the resource.
ConflictException
HTTP status: 409
The request conflicts with the current state of a resource. The conflict field of the error explains the conflict:
-
duplicateValue – A field has a value that already exists. Examples are a profile name that another profile in your account already uses, and an extension that the profile already has an entry for. To change an existing entry, use the
update-profile-entrycommand. -
resourceState – The state of the resource doesn't allow the operation.
-
dependencyState – A dependency of the resource blocks the operation.
ServiceQuotaExceededException
HTTP status: 402
The request exceeds a quota for your account. The error includes the resource type, the resource ID, a service code, and a quota code. Use the service code and the quota code to look up the quota in Service Quotas. By default, an account can have 25 profiles. This quota isn't adjustable.
ThrottlingException
HTTP status: 429
You sent too many requests. Retry the request after the number of seconds in the Retry-After response header. Use exponential backoff with jitter in your retry logic.
InternalServerException
HTTP status: 500
The service failed to process the request. Retry the request after the number of seconds in the Retry-After response header. If the error persists, contact Support.
Profile issues
Profile not loading
Symptom: The runtime starts but doesn't load the expected profile.
Check that the profile exists:
aws cloudextensions list-profiles aws cloudextensions get-profile --identifier my-application
Common causes:
-
The runtime loads a different profile
The runtime loads the profile that you name with the
--profileoption or, in Lambda, with theAWS_CLOUDEXTENSIONS_PROFILEenvironment variable. Check the profile name in the runtime logs. In Lambda, set theAWS_CLOUDEXTENSIONS_PROFILEenvironment variable to the profile that you want. In a container, pass--profilein the command of the container.profile-name -
IAM permissions missing
Verify that the credentials of the runtime allow the
cloudextensions:SyncStateaction on all resources. For more information, see Permissions for the runtime. -
The profile has no entries
A profile with no profile entries loads no extensions. List the entries:
aws cloudextensions list-profile-entries --profile-identifier my-application -
The profile doesn't exist
The runtime keeps running with nothing loaded if it can't find the profile that you name. The runtime logs the error
initial profile retrieval failed, and calls to an extension return HTTP 502 with the reasonPROFILE_NOT_FOUND. Check that theAWS_CLOUDEXTENSIONS_PROFILEenvironment variable of a Lambda function, or the--profileoption of a container, names a profile that exists in your account:aws cloudextensions list-profiles
Profile changes not applying
Symptom: You add, change, or remove a profile entry, but the changes don't take effect.
Check the poll interval:
The runtime checks for updates every 45 seconds by default. Wait at least one poll cycle. Then check the runtime logs for messages that show that the runtime retrieved the profile and loaded the extensions.
Load the profile again:
In Lambda, a new execution environment loads the current profile when it starts. In a container, restart the container.
Check the profile entry:
aws cloudextensions get-profile-entry \ --profile-identifier my-application \ --identifierprofile-entry-id
Check the versionPolicy, effectiveSettings, and approved fields.
Extension issues
Extension not starting
Symptom: A profile entry exists, but the extension doesn't start or doesn't appear in the HTTP routes.
Check the runtime logs:
Look in the runtime logs for messages that show that the runtime loaded the extension. A warning about a hash mismatch, or an error that the runtime failed to load the extension, points to the cause.
Common causes:
-
The extension isn't in the profile
Verify that the profile has an entry for the extension:
aws cloudextensions list-profile-entries \ --profile-identifier my-application \ --extension-name parameterstore -
You didn't approve a capability
List the capabilities that the extension declares, and compare them with the capabilities that you approved:
aws cloudextensions get-extension \ --identifier aws:parameterstore \ --query 'configuration.capabilities' aws cloudextensions get-profile-entry \ --profile-identifier my-application \ --identifierprofile-entry-id\ --query 'approved'Approve the missing capabilities:
aws cloudextensions update-profile-entry \ --profile-identifier my-application \ --identifierprofile-entry-id\ --approvecapability-path -
A required setting has no value
An extension can require you to provide values for some settings. Compare the settings that the extension declares with the effective settings of the entry:
aws cloudextensions get-extension \ --identifier aws:parameterstore \ --query 'configuration.settings' aws cloudextensions get-profile-entry \ --profile-identifier my-application \ --identifierprofile-entry-id\ --query 'effectiveSettings' -
The execution role is missing or incorrect
Check the
inheritedandexecutionRolefields of the profile entry. Verify that the role exists and that its trust policy allows the role that the runtime runs as to assume the role. -
The hash of an extension doesn't match
The runtime checks the SHA-256 hash of each extension artifact against the hash in the profile state. When the hashes don't match, the runtime logs
cached extension hash mismatch; refetchingand downloads the extension again. If the hash still doesn't match, the runtime doesn't load that version. A running earlier version keeps running. If no earlier version runs, the extension stays unloaded, and calls to the extension fail. The runtime tries again at its later profile checks. Repeated mismatches indicate one of the following causes:-
A corrupted extension download. Restart the runtime to retry.
-
Network tampering. Check the network path to AWS.
-
An extension can't call an AWS service
Symptom: An extension fails with an access denied error when it calls an AWS service.
An extension call succeeds only when all of the following are true:
-
The extension declares an AWS service capability for the operation, and you approved the capability.
-
The execution role of the extension has IAM permissions for the operation.
-
The trust policy of the execution role allows the role that the runtime runs as to assume the role.
Check the capabilities that you approved:
aws cloudextensions get-profile-entry \ --profile-identifier my-application \ --identifierprofile-entry-id\ --query 'approved'
Check the execution role:
aws iam get-role --role-name CloudExtensionsExecutionRole aws iam list-attached-role-policies --role-name CloudExtensionsExecutionRole
Requests time out
Symptom: Requests to extensions time out or take longer than expected.
Check the cache metrics:
Check the cache metrics of the extension. For the metrics, see CloudWatch metrics. A rise in the response time can follow a change to a setting, to an extension version, or to the load on your application. Check the logs of the extension in CloudWatch Logs for the time of the rise.
Test network connectivity:
curl -I https://ssm.us-east-1.amazonaws.com nslookup ssm.us-east-1.amazonaws.com
Connection issues
Can't connect to the extension endpoint
Symptom: Your application can't reach the extension at http://localhost:5333.
Verify that the runtime is running:
Check the runtime logs for a message that shows that the runtime is serving requests.
Test the endpoint:
If authentication is off, test with curl:
# Parameter Store extension curl "http://localhost:5333/parameterstore/parameter/value?name=/myapp/config/setting"
An unknown path returns an error response from the runtime, which confirms that the runtime is listening.
Common causes:
-
The runtime isn't running – Check the logs for startup errors.
-
Wrong port – In Lambda, the runtime listens on
localhostport 5333. Check that your application calls that port. -
A different network namespace – A process in a different network namespace can't reach the endpoint.
Requests fail authentication
Symptom: The runtime rejects requests from your application.
By default, clients must sign requests with SigV4, using the credentials of the runtime. Check the following:
-
Authentication setting – View the authentication setting of the profile:
aws cloudextensions get-profile --identifier my-application --query 'extensionDefaults.interfaceDefaults.http.authentication' -
Unsigned requests – When the authentication is
runtimeCredentialsorextensionKey, a request that you don't sign fails. To test withcurl, set the authentication tonone. -
Credentials in the client – With
runtimeCredentials, confirm that the client signs requests with the credentials of the Lambda function or the container. WithextensionKey, confirm that the client uses the access key ID that starts withCXEKand the matching secret key. -
Secret key – Confirm that the client uses the current secret key. After a rotation, the runtime accepts the current and the previous versions of a Secrets Manager secret. When a request uses a key that the runtime doesn't have, the runtime reads the secret again, at most once a minute.
-
Region and service name – Sign for the AWS Region that you run in, with the signing name of the extension. The error message names the expected service name.
For more information, see Authentication.
Performance issues
Too many calls to the remote service
Symptom: The extension makes more calls to the remote service than you expect.
Check the settings of the extension:
aws cloudextensions get-profile-entry \ --profile-identifier my-application \ --identifierprofile-entry-id\ --query 'effectiveSettings'
Common causes:
-
The cache time to live (TTL) is too short – If the extension has a TTL setting, increase the value with
--settingsinupdate-profile-entry. -
The cache is too small – If the extension declares a cache size setting, increase the value.
-
The application requests many unique resources – Review the access patterns of your application. Prefetch the resources that your application reads most, if the extension has a prefetch setting.
To see which settings an extension declares, run the following command:
aws cloudextensions get-extension \ --identifier aws:parameterstore \ --query 'configuration.settings'
High memory usage
Symptom: The Cloud Extensions runtime uses a large amount of memory.
Common causes:
-
A large cache – Reduce the cache settings of the extensions that cache data.
-
Too many extensions – List the profile entries and remove extensions that you don't use:
aws cloudextensions list-profile-entries --profile-identifier my-application -
A memory leak – Restart the runtime and monitor memory use. If memory continues to grow, collect diagnostic information and contact Support.
Update issues
For problems with extension versions, see Troubleshooting.
Diagnostic data collection
When you contact Support, collect the following information:
Runtime version:
# Lambda aws lambda get-function-configuration \ --function-name my-function \ --query 'Layers' # Containers docker images public.ecr.aws/aws-cloudextensions/cloudextensions-runtime
Logs:
# Lambda logs aws logs tail /aws/lambda/my-function --since 1h > lambda-logs.txt # Container logs docker logscontainer-id> container-logs.txt
To get more detail in Lambda, set the AWS_CLOUDEXTENSIONS_LOG_LEVEL environment variable to debug.
Profile and profile entry configuration:
aws cloudextensions get-profile --identifier my-application > profile.json aws cloudextensions list-profile-entries --profile-identifier my-application > profile-entries.json aws cloudextensions get-profile-entry \ --profile-identifier my-application \ --identifierprofile-entry-id> profile-entry.json
Remove secrets from the output before you share the files.
Getting help
If you can't resolve an issue:
-
Check the Cloud Extensions documentation – Review the topics for your issue.
-
Support – Open a support case with the diagnostic data that you collected in the preceding section.
-
AWS re:Post – Post questions to the AWS community at https://repost.aws/
.
When you open a support case, include:
-
A detailed description of the issue
-
Steps to reproduce the issue
-
Logs and diagnostic data
-
The profile and profile entry configuration
-
A timeline of when the issue started