RDS not-found handlers raise TypeError: `'DBSnapshotNotFound' in e`
Author: maximmasiutinCreated Sep 3, 2026Updated Sep 3, 2026
Labelsbugpotential
Version 5.14.0, and the same code is on master, in ScoutSuite/providers/aws/facade/rds.py: _get_and_set_snapshot_attributes and _get_and_set_instance_tags.
Both handlers test 'DBSnapshotNotFound' in e / 'DBInstanceNotFound' in e on the exception object, which raises:
TypeError: argument of type 'DBSnapshotNotFoundFault' is not iterableThe trigger was an automated RDS snapshot rotated away between describe_db_snapshots and describe_db_snapshot_attributes during a long scan. The snapshot is left without Attributes, fetch_all() for snapshots fails with KeyError: 'Attributes', and the run exits 200.
The fix is to test str(e) instead of e. A pull request follows.
The error that I got is the following:
Task exception was never retrieved
future: <Task finished name='Task-5729' coro=<RDSFacade._get_and_set_snapshot_attributes() done, defined at /home/github-runner/_work/infosec/infosec/.venv/lib/python3.11/site-packages/ScoutSuite/providers/aws/facade/rds.py:110> exception=TypeError("argument of type 'DBSnapshotNotFoundFault' is not iterable")>
Traceback (most recent call last):
File "/home/github-runner/_work/infosec/infosec/.venv/lib/python3.11/site-packages/ScoutSuite/providers/aws/facade/rds.py", line 113, in _get_and_set_snapshot_attributes
attributes = await run_concurrently(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/github-runner/_work/infosec/infosec/.venv/lib/python3.11/site-packages/ScoutSuite/providers/utils.py", line 27, in run_concurrently
return await run_function_concurrently(function)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/github-runner/_work/_tool/Python/3.11.16/x64/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/github-runner/_work/infosec/infosec/.venv/lib/python3.11/site-packages/ScoutSuite/providers/aws/facade/rds.py", line 114, in <lambda>
lambda: client.describe_db_snapshot_attributes(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/github-runner/_work/infosec/infosec/.venv/lib/python3.11/site-packages/botocore/client.py", line 606, in _api_call
return self._make_api_call(operation_name, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/github-runner/_work/infosec/infosec/.venv/lib/python3.11/site-packages/botocore/context.py", line 123, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/github-runner/_work/infosec/infosec/.venv/lib/python3.11/site-packages/botocore/client.py", line 1094, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.errorfactory.DBSnapshotNotFoundFault: An error occurred (DBSnapshotNotFound) when calling the DescribeDBSnapshotAttributes operation: DBSnapshot not found: rds:mysql-priceline-hybrid-prod-readreplica-2026-09-01-11-16
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/github-runner/_work/infosec/infosec/.venv/lib/python3.11/site-packages/ScoutSuite/providers/aws/facade/rds.py", line 119, in _get_and_set_snapshot_attributes
if 'DBSnapshotNotFound' in e:
^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'DBSnapshotNotFoundFault' is not iterableSource: nccgroup/ScoutSuite