Skip to content

Bug: get_parameters_by_name lets botocore ClientError escape instead of GetParameterError #8597

Open

Description

@leandrodamascena

Expected Behaviour

Any failure of the GetParameters call is wrapped in GetParameterError in fail-fast mode, or reported in _errors in graceful mode. The docstring says "Raises GetParameterError upon any error", and get_parameter wraps every exception this way.

Current Behaviour

_get_parameters_by_name_from_batch (ssm.py:628-634) only handles InvalidKeyId and InternalServerError. Throttling or any other ClientError propagates raw in both modes.

Code snippet

from botocore.config import Config
from botocore.stub import Stubber
from aws_lambda_powertools.utilities.parameters import SSMProvider

provider = SSMProvider(boto_config=Config(region_name="us-east-1"))
stub = Stubber(provider.client)
stub.add_client_error("get_parameters", "ThrottlingException")
stub.activate()

provider.get_parameters_by_name({"/a": {}}, raise_on_error=False)  # botocore ClientError, expected {'_errors': ['/a']}
provider.get_parameters_by_name({"/a": {}})                        # botocore ClientError, expected GetParameterError

Possible Solution

Catch Exception around the call; re-raise as GetParameterError when raise_on_error=True, otherwise return the batch names as errors. Code that catches ClientError around this call today is coding against the bug, since every other function in the utility already wraps it.

Steps to Reproduce

Run the snippet above (it uses botocore.stub.Stubber, no AWS access needed).

Powertools for AWS Lambda (Python) version

latest

AWS Lambda function runtime

3.13

Packaging format used

PyPi

Debugging logs

Warning

This issue is ready to be picked up, by humans or by agents. If you want it, comment here first so we can assign it to you, and please take only one or two issues at a time so others can join in too. The reproduction above runs locally without AWS access. Thanks!

Activity

  1. Tanmay-Ts commented on Oct 18, 2026

    @Tanmay-Ts

    Hi @leandrodamascena, I'd like to take this one. Plan: wrap the botocore ClientError in GetParameterError (chained with from) in the get_parameters_by_name path, and add a functional test with a stubbed ClientError.

  2. leandrodamascena commented on Oct 18, 2026

    @leandrodamascena
    ContributorAuthor

    Pls go ahead @Tanmay-Ts

  3. added this to the 3.39.0 milestone on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomersparametersParameters utilitytriagePending triage from maintainers

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions