

# 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](#cloud-extensions-troubleshooting-installation-issues)
+ [API errors](#cloud-extensions-troubleshooting-api-errors)
+ [Profile issues](#cloud-extensions-troubleshooting-profile-issues)
+ [Extension issues](#cloud-extensions-troubleshooting-extension-issues)
+ [Connection issues](#cloud-extensions-troubleshooting-connection-issues)
+ [Performance issues](#cloud-extensions-troubleshooting-performance-issues)
+ [Update issues](#cloud-extensions-troubleshooting-update-issues)
+ [Diagnostic data collection](#cloud-extensions-troubleshooting-diagnostic-data-collection)
+ [Getting help](#cloud-extensions-troubleshooting-getting-help)
+ [Next steps](#cloud-extensions-troubleshooting-next-steps)

## Installation issues
<a name="cloud-extensions-troubleshooting-installation-issues"></a>

### Lambda extension not loading
<a name="cloud-extensions-troubleshooting-lambda-extension-not-loading"></a>

**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:

```bash
# 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:

```bash
aws lambda get-function-configuration \
  --function-name my-function \
  --query 'Layers'
```

**Check the function logs:**

```bash
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
<a name="cloud-extensions-troubleshooting-container-runtime-not-starting"></a>

**Symptom:** The Cloud Extensions runtime doesn't start in a containerized environment.

**Verify the image:**

```bash
docker pull public.ecr.aws/aws-cloudextensions/cloudextensions-runtime:latest
```

**Check the container logs:**

```bash
docker logs {{container-id}}
```

**Common causes:**

1. **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:SyncState` action. For more information, see [Permissions for the runtime](cloud-extensions-security.md#cloud-extensions-security-permissions-for-the-runtime).

1. **Network connectivity**

   Verify that the container can reach AWS endpoints:

   ```bash
   curl -I https://ssm.us-east-1.amazonaws.com
   ```

## API errors
<a name="cloud-extensions-troubleshooting-api-errors"></a>

When a Cloud Extensions API call fails, the error type tells you the cause. The following sections describe each error type.

### ValidationException
<a name="cloud-extensions-troubleshooting-validationexception"></a>

**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 `errors` is 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 `--settings` that doesn't satisfy the setting definitions of the extension
+ A capability path in `--approve` that the extension doesn't declare (`UNKNOWN_CAPABILITY`), or an `--approve` list 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 `--approve` option

To see the setting definitions and the declared capabilities of an extension, run the `get-extension` command.

### ResourceNotFoundException
<a name="cloud-extensions-troubleshooting-resourcenotfoundexception"></a>

**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.

1. Check the identifier. You can use the ID or the name of a profile or an extension.

1. Check that you use the correct AWS account and AWS Region.

1. Check that your IAM policy allows the action on the resource.

### ConflictException
<a name="cloud-extensions-troubleshooting-conflictexception"></a>

**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-entry` command.
+ **resourceState** – The state of the resource doesn't allow the operation.
+ **dependencyState** – A dependency of the resource blocks the operation.

### ServiceQuotaExceededException
<a name="cloud-extensions-troubleshooting-servicequotaexceededexception"></a>

**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
<a name="cloud-extensions-troubleshooting-throttlingexception"></a>

**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
<a name="cloud-extensions-troubleshooting-internalserverexception"></a>

**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
<a name="cloud-extensions-troubleshooting-profile-issues"></a>

### Profile not loading
<a name="cloud-extensions-troubleshooting-profile-not-loading"></a>

**Symptom:** The runtime starts but doesn't load the expected profile.

**Check that the profile exists:**

```bash
aws cloudextensions list-profiles
aws cloudextensions get-profile --identifier my-application
```

**Common causes:**

1. **The runtime loads a different profile**

   The runtime loads the profile that you name with the `--profile` option or, in Lambda, with the `AWS_CLOUDEXTENSIONS_PROFILE` environment variable. Check the profile name in the runtime logs. In Lambda, set the `AWS_CLOUDEXTENSIONS_PROFILE` environment variable to the profile that you want. In a container, pass `--profile {{profile-name}}` in the command of the container.

1. **IAM permissions missing**

   Verify that the credentials of the runtime allow the `cloudextensions:SyncState` action on all resources. For more information, see [Permissions for the runtime](cloud-extensions-security.md#cloud-extensions-security-permissions-for-the-runtime).

1. **The profile has no entries**

   A profile with no profile entries loads no extensions. List the entries:

   ```bash
   aws cloudextensions list-profile-entries --profile-identifier my-application
   ```

1. **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 reason `PROFILE_NOT_FOUND`. Check that the `AWS_CLOUDEXTENSIONS_PROFILE` environment variable of a Lambda function, or the `--profile` option of a container, names a profile that exists in your account:

   ```bash
   aws cloudextensions list-profiles
   ```

### Profile changes not applying
<a name="cloud-extensions-troubleshooting-profile-changes-not-applying"></a>

**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:**

```bash
aws cloudextensions get-profile-entry \
  --profile-identifier my-application \
  --identifier {{profile-entry-id}}
```

Check the `versionPolicy`, `effectiveSettings`, and `approved` fields.

## Extension issues
<a name="cloud-extensions-troubleshooting-extension-issues"></a>

### Extension not starting
<a name="cloud-extensions-troubleshooting-extension-not-starting"></a>

**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:**

1. **The extension isn't in the profile**

   Verify that the profile has an entry for the extension:

   ```bash
   aws cloudextensions list-profile-entries \
     --profile-identifier my-application \
     --extension-name parameterstore
   ```

1. **You didn't approve a capability**

   List the capabilities that the extension declares, and compare them with the capabilities that you approved:

   ```bash
   aws cloudextensions get-extension \
     --identifier aws:parameterstore \
     --query 'configuration.capabilities'
   aws cloudextensions get-profile-entry \
     --profile-identifier my-application \
     --identifier {{profile-entry-id}} \
     --query 'approved'
   ```

   Approve the missing capabilities:

   ```bash
   aws cloudextensions update-profile-entry \
     --profile-identifier my-application \
     --identifier {{profile-entry-id}} \
     --approve {{capability-path}}
   ```

1. **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:

   ```bash
   aws cloudextensions get-extension \
     --identifier aws:parameterstore \
     --query 'configuration.settings'
   aws cloudextensions get-profile-entry \
     --profile-identifier my-application \
     --identifier {{profile-entry-id}} \
     --query 'effectiveSettings'
   ```

1. **The execution role is missing or incorrect**

   Check the `inherited` and `executionRole` fields 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.

1. **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; refetching` and 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
<a name="cloud-extensions-troubleshooting-an-extension-cant-call-an-aws-service"></a>

**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:**

```bash
aws cloudextensions get-profile-entry \
  --profile-identifier my-application \
  --identifier {{profile-entry-id}} \
  --query 'approved'
```

**Check the execution role:**

```bash
aws iam get-role --role-name CloudExtensionsExecutionRole
aws iam list-attached-role-policies --role-name CloudExtensionsExecutionRole
```

### Requests time out
<a name="cloud-extensions-troubleshooting-requests-time-out"></a>

**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](cloud-extensions-monitoring.md#cloud-extensions-monitoring-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:**

```bash
curl -I https://ssm.us-east-1.amazonaws.com
nslookup ssm.us-east-1.amazonaws.com
```

## Connection issues
<a name="cloud-extensions-troubleshooting-connection-issues"></a>

### Can't connect to the extension endpoint
<a name="cloud-extensions-troubleshooting-cant-connect-to-the-extension-endpoint"></a>

**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`:

```bash
# 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:**

1. **The runtime isn't running** – Check the logs for startup errors.

1. **Wrong port** – In Lambda, the runtime listens on `localhost` port 5333. Check that your application calls that port.

1. **A different network namespace** – A process in a different network namespace can't reach the endpoint.

### Requests fail authentication
<a name="cloud-extensions-troubleshooting-requests-fail-authentication"></a>

**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:

1. **Authentication setting** – View the authentication setting of the profile:

   ```bash
   aws cloudextensions get-profile --identifier my-application --query 'extensionDefaults.interfaceDefaults.http.authentication'
   ```

1. **Unsigned requests** – When the authentication is `runtimeCredentials` or `extensionKey`, a request that you don't sign fails. To test with `curl`, set the authentication to `none`.

1. **Credentials in the client** – With `runtimeCredentials`, confirm that the client signs requests with the credentials of the Lambda function or the container. With `extensionKey`, confirm that the client uses the access key ID that starts with `CXEK` and the matching secret key.

1. **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.

1. **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](cloud-extensions-security.md#cloud-extensions-security-authentication).

## Performance issues
<a name="cloud-extensions-troubleshooting-performance-issues"></a>

### Too many calls to the remote service
<a name="cloud-extensions-troubleshooting-too-many-calls-to-the-remote-service"></a>

**Symptom:** The extension makes more calls to the remote service than you expect.

**Check the settings of the extension:**

```bash
aws cloudextensions get-profile-entry \
  --profile-identifier my-application \
  --identifier {{profile-entry-id}} \
  --query 'effectiveSettings'
```

**Common causes:**

1. **The cache time to live (TTL) is too short** – If the extension has a TTL setting, increase the value with `--settings` in `update-profile-entry`.

1. **The cache is too small** – If the extension declares a cache size setting, increase the value.

1. **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:

```bash
aws cloudextensions get-extension \
  --identifier aws:parameterstore \
  --query 'configuration.settings'
```

### High memory usage
<a name="cloud-extensions-troubleshooting-high-memory-usage"></a>

**Symptom:** The Cloud Extensions runtime uses a large amount of memory.

**Common causes:**

1. **A large cache** – Reduce the cache settings of the extensions that cache data.

1. **Too many extensions** – List the profile entries and remove extensions that you don't use:

   ```bash
   aws cloudextensions list-profile-entries --profile-identifier my-application
   ```

1. **A memory leak** – Restart the runtime and monitor memory use. If memory continues to grow, collect diagnostic information and contact Support.

## Update issues
<a name="cloud-extensions-troubleshooting-update-issues"></a>

For problems with extension versions, see [Troubleshooting](cloud-extensions-updates.md#cloud-extensions-updates-troubleshooting).

## Diagnostic data collection
<a name="cloud-extensions-troubleshooting-diagnostic-data-collection"></a>

When you contact Support, collect the following information:

**Runtime version:**

```bash
# Lambda
aws lambda get-function-configuration \
  --function-name my-function \
  --query 'Layers'
# Containers
docker images public.ecr.aws/aws-cloudextensions/cloudextensions-runtime
```

**Logs:**

```bash
# Lambda logs
aws logs tail /aws/lambda/my-function --since 1h > lambda-logs.txt
# Container logs
docker logs {{container-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:**

```bash
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 \
  --identifier {{profile-entry-id}} > profile-entry.json
```

Remove secrets from the output before you share the files.

## Getting help
<a name="cloud-extensions-troubleshooting-getting-help"></a>

If you can't resolve an issue:

1. **Check the Cloud Extensions documentation** – Review the topics for your issue.

1. **Support** – Open a support case with the diagnostic data that you collected in the preceding section.

1. **AWS re:Post** – Post questions to the AWS community at [https://repost.aws/](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

## Next steps
<a name="cloud-extensions-troubleshooting-next-steps"></a>
+ [Monitoring AWS Systems Manager Cloud Extensions](cloud-extensions-monitoring.md)
+ [Security in AWS Systems Manager Cloud Extensions](cloud-extensions-security.md)
+ [Managing AWS Systems Manager Cloud Extensions updates](cloud-extensions-updates.md)