

# Troubleshooting the Parameter Store extension in AWS Systems Manager Cloud Extensions

Find solutions to common problems with the Parameter Store extension, such as stale values, throttling, access errors, and rejected requests.

**Topics**
+ [Your application reads an old value](#cloud-extensions-ext-parameter-store-troubleshooting-your-application-reads-an-old-value)
+ [The extension returns ThrottlingException errors](#cloud-extensions-ext-parameter-store-troubleshooting-the-extension-returns-throttlingexception-errors)
+ [A parameter that you created isn't found](#cloud-extensions-ext-parameter-store-troubleshooting-a-parameter-that-you-created-isnt-found)
+ [Access denied or decryption failures](#cloud-extensions-ext-parameter-store-troubleshooting-access-denied-or-decryption-failures)
+ [You get the encrypted value of a SecureString](#cloud-extensions-ext-parameter-store-troubleshooting-you-get-the-encrypted-value-of-a-securestring)
+ [GetParameters lists a parameter in InvalidParameters](#cloud-extensions-ext-parameter-store-troubleshooting-getparameters-lists-a-parameter-in-invalidparameters)
+ [The extension returns InternalFailure or a credentials error](#cloud-extensions-ext-parameter-store-troubleshooting-the-extension-returns-internalfailure-or-a-credentials-error)
+ [The runtime returns AccessDeniedException](#cloud-extensions-ext-parameter-store-troubleshooting-the-runtime-returns-accessdeniedexception)
+ [The runtime returns UNKNOWN\_OPERATION](#cloud-extensions-ext-parameter-store-troubleshooting-the-runtime-returns-unknown_operation)
+ [The runtime returns BadGatewayException](#cloud-extensions-ext-parameter-store-troubleshooting-the-runtime-returns-badgatewayexception)
+ [The runtime returns ServiceUnavailable](#cloud-extensions-ext-parameter-store-troubleshooting-the-runtime-returns-serviceunavailable)

## Your application reads an old value
<a name="cloud-extensions-ext-parameter-store-troubleshooting-your-application-reads-an-old-value"></a>

**Symptom:** A parameter changed in Parameter Store, but your application still reads the old value.

The extension serves a cached value until the cache time to live (TTL) expires. Check the **Cache TTL** setting, and lower the value if your application needs newer values sooner:

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

A value of 0 makes the extension check Parameter Store on every read.

## The extension returns ThrottlingException errors
<a name="cloud-extensions-ext-parameter-store-troubleshooting-the-extension-returns-throttlingexception-errors"></a>

**Symptom:** Requests to the extension fail with `400 ThrottlingException`.

If Parameter Store throttles the calls of the extension, raise the **Cache TTL** setting or use GetParameters to read several parameters in one call. If the runtime throttles the requests, the extension might be near its memory limit. Lower the **Cache size** setting. If your parameters are large or have long names, set the size to 3,000 or less. For Secrets Manager references of up to 64 KB, set the size to 600 or less.

## A parameter that you created isn't found
<a name="cloud-extensions-ext-parameter-store-troubleshooting-a-parameter-that-you-created-isnt-found"></a>

**Symptom:** The extension reports that a parameter doesn't exist, although you created the parameter.

The extension caches a not-found result for one TTL. Wait for the TTL to expire, or lower the **Cache TTL** setting.

## Access denied or decryption failures
<a name="cloud-extensions-ext-parameter-store-troubleshooting-access-denied-or-decryption-failures"></a>

**Symptom:** Errors when the extension retrieves a parameter, or when it retrieves a SecureString parameter.

Check that the IAM execution role allows `ssm:GetParameter` and `ssm:GetParameters` on the parameter in the Region of the runtime. For SecureString parameters, check that the role allows `kms:Decrypt` on the AWS Key Management Service (AWS KMS) key:

```json
{
  "Effect": "Allow",
  "Action": "kms:Decrypt",
  "Resource": "arn:aws:kms:region:account-id:key/key-id"
}
```

For GetParameter, the extension caches access denied and unusable KMS key results for one TTL. After you fix the permissions, wait for the TTL to expire. GetParameters doesn't cache these results. It lists a SecureString whose KMS key is unusable in `InvalidParameters`, and it calls Parameter Store again on the next request.

## You get the encrypted value of a SecureString
<a name="cloud-extensions-ext-parameter-store-troubleshooting-you-get-the-encrypted-value-of-a-securestring"></a>

**Symptom:** The value that the extension returns for a SecureString is encrypted.

Set `WithDecryption` to `true` in the request, for example with `--with-decryption` in the AWS CLI.

## GetParameters lists a parameter in InvalidParameters
<a name="cloud-extensions-ext-parameter-store-troubleshooting-getparameters-lists-a-parameter-in-invalidparameters"></a>

**Symptom:** GetParameters returns `200 OK`, but a name is in `InvalidParameters` instead of `Parameters`.

The parameter, or the version or label that you asked for, doesn't exist in the Region of the runtime or in that account. Or the KMS key of the SecureString is disabled. Check the name in the request.

## The extension returns InternalFailure or a credentials error
<a name="cloud-extensions-ext-parameter-store-troubleshooting-the-extension-returns-internalfailure-or-a-credentials-error"></a>

**Symptom:** The extension returns `500 InternalFailure` with the message `Error connecting to the service`, or an error such as `ExpiredTokenException` or `UnrecognizedClientException`.

The extension can't get or use its credentials. Check the IAM execution role and its trust policy. The log of the extension has the cause.

## The runtime returns AccessDeniedException
<a name="cloud-extensions-ext-parameter-store-troubleshooting-the-runtime-returns-accessdeniedexception"></a>

**Symptom:** Every request fails with `400 AccessDeniedException`, and the `cloudextensions-error-reason` header is `MISSING_AUTHENTICATION` or `SIGNATURE_MISMATCH`.

The runtime didn't accept the signature of the request. Sign the request for the service `ssm` with the extension key of the profile as the credentials. Check the access key ID and the secret key. If the header is missing, Parameter Store refused the role of the extension. For more information, see [Access denied or decryption failures](#cloud-extensions-ext-parameter-store-troubleshooting-access-denied-or-decryption-failures).

## The runtime returns UNKNOWN\_OPERATION
<a name="cloud-extensions-ext-parameter-store-troubleshooting-the-runtime-returns-unknown_operation"></a>

**Symptom:** The runtime returns `400 ValidationException` with the reason `UNKNOWN_OPERATION` and the message `No operation matches the request`.

The request isn't a `POST` of `GetParameter` or `GetParameters` to the endpoint of the extension. Check the following:
+ The request names a served operation in `X-Amz-Target`: `AmazonSSM.GetParameter` or `AmazonSSM.GetParameters`. The extension doesn't serve other operations, such as `GetParametersByPath`.
+ The request is a `POST` to `http://localhost:5333/parameterstore`. The extension no longer serves the `GET` routes `/parameterstore/parameter/value`, `/parameterstore/parameter`, and `/parameterstore/parameters`.
+ The profile includes the extension.

## The runtime returns BadGatewayException
<a name="cloud-extensions-ext-parameter-store-troubleshooting-the-runtime-returns-badgatewayexception"></a>

**Symptom:** The runtime returns `502 BadGatewayException`.

The extension timed out or couldn't connect to Parameter Store, and it had no cached value for the parameter. Retry the request. If the error persists, check the network path from the runtime to the Parameter Store endpoint of the Region. Also check the log of the extension for the cause.

## The runtime returns ServiceUnavailable
<a name="cloud-extensions-ext-parameter-store-troubleshooting-the-runtime-returns-serviceunavailable"></a>

**Symptom:** The runtime returns `503 ServiceUnavailable`.

The extension is still loading, or it failed to load. Retry after the time in the `Retry-After` header, and check the log of the runtime.