I can notice that there is a patch baseline AWS-AmazonLinux2023DefaultPatchBaseline. However, when the task is run, some errors are returned and indicated that the OS basline does not match. It looks like something have to be done with Operating System of Baseline Override.
/usr/bin/python3
/usr/bin/yum
/usr/bin/dnf
Using python binary: 'python3'
Using Python Version: Python 3.9.16
04/20/2023 08:21:04 root [INFO]: Downloading payload from https://s3.dualstack.us-east-1.amazonaws.com/aws-ssm-us-east-1/patchbaselineoperations/linux/payloads/patch-baseline-operations-1.106.tar.gz
04/20/2023 08:21:05 root [INFO]: Attempting to import entrance file os_selector
04/20/2023 08:21:05 root [INFO]: Running with snapshot id = and operation = Install
04/20/2023 08:21:05 root [INFO]: Downloading Baseline Override from s3://aws-quicksetup-patchpolicy-xxxxxxxxxxx-snhqg/baseline_overrides.json
04/20/2023 08:21:05 botocore.credentials [INFO]: Found credentials in shared credentials file: /var/lib/amazon/ssm/credentials
04/20/2023 08:21:05 botocore.credentials [INFO]: Found credentials in shared credentials file: /var/lib/amazon/ssm/credentials
04/20/2023 08:21:06 root [ERROR]: An error occurred (ValidationException) when calling the GetDeployablePatchSnapshotForInstance operation: Operating System of Baseline Override was AMAZON_LINUX_2, expected AMAZON_LINUX_2023
Traceback (most recent call last):
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 126, in _get_snapshot_info
patch_snapshot = _get_snapshot_with_client(ssm_client, instance_id, snapshot_id, baseline_override)
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 428, in _get_snapshot_with_client
return ssm_client.get_deployable_patch_snapshot_for_instance(
File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 276, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 586, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the GetDeployablePatchSnapshotForInstance operation: Operating System of Baseline Override was AMAZON_LINUX_2, expected AMAZON_LINUX_2023
04/20/2023 08:21:06 root [INFO]: Unable to retrieve snapshot with default ssm client, retry with fallback ssm client
04/20/2023 08:21:06 botocore.credentials [INFO]: Found credentials in shared credentials file: /var/lib/amazon/ssm/credentials
04/20/2023 08:21:06 root [ERROR]: Error loading entrance module.
Traceback (most recent call last):
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 126, in _get_snapshot_info
patch_snapshot = _get_snapshot_with_client(ssm_client, instance_id, snapshot_id, baseline_override)
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 428, in _get_snapshot_with_client
return ssm_client.get_deployable_patch_snapshot_for_instance(
File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 276, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 586, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the GetDeployablePatchSnapshotForInstance operation: Operating System of Baseline Override was AMAZON_LINUX_2, expected AMAZON_LINUX_2023
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 102, in _get_snapshot_info_with_fallback_ssm_client
patch_snapshot = _get_snapshot_with_client(fallback_ssm_client, instance_id, snapshot_id, baseline_override)
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 428, in _get_snapshot_with_client
return ssm_client.get_deployable_patch_snapshot_for_instance(
File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 276, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 586, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the GetDeployablePatchSnapshotForInstance operation: Operating System of Baseline Override was AMAZON_LINUX_2, expected AMAZON_LINUX_2023
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/log/amazon/ssm/patch-baseline-operations/common_startup_entrance.py", line 203, in execute
exit( entrance_module.execute(*argv))
File "/var/log/amazon/ssm/patch-baseline-operations/os_selector.py", line 54, in execute
common_os_selector_methods.fetch_snapshot(operation_type, instance_id, region, reboot_option, document_step,
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 280, in fetch_snapshot
snapshot_info = _get_snapshot_info(instance_id, snapshot_id, region, baseline_override_dict)
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 136, in _get_snapshot_info
return _get_snapshot_info_with_fallback_ssm_client(instance_id, region, snapshot_id, baseline_override)
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 111, in _get_snapshot_info_with_fallback_ssm_client
raise PatchManagerError("Get Snapshot failed", ExitCodes.SNAPSHOT_API_ERROR, e)
patch_common.exceptions.PatchManagerError: ('Get Snapshot failed', 144)
Caused By: An error occurred (ValidationException) when calling the GetDeployablePatchSnapshotForInstance operation: Operating System of Baseline Override was AMAZON_LINUX_2, expected AMAZON_LINUX_2023
04/20/2023 08:21:06 root [ERROR]: ('Get Snapshot failed', 144)
Caused By: An error occurred (ValidationException) when calling the GetDeployablePatchSnapshotForInstance operation: Operating System of Baseline Override was AMAZON_LINUX_2, expected AMAZON_LINUX_2023
Traceback (most recent call last):
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 126, in _get_snapshot_info
patch_snapshot = _get_snapshot_with_client(ssm_client, instance_id, snapshot_id, baseline_override)
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 428, in _get_snapshot_with_client
return ssm_client.get_deployable_patch_snapshot_for_instance(
File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 276, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 586, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the GetDeployablePatchSnapshotForInstance operation: Operating System of Baseline Override was AMAZON_LINUX_2, expected AMAZON_LINUX_2023
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 102, in _get_snapshot_info_with_fallback_ssm_client
patch_snapshot = _get_snapshot_with_client(fallback_ssm_client, instance_id, snapshot_id, baseline_override)
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 428, in _get_snapshot_with_client
return ssm_client.get_deployable_patch_snapshot_for_instance(
File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 276, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 586, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the GetDeployablePatchSnapshotForInstance operation: Operating System of Baseline Override was AMAZON_LINUX_2, expected AMAZON_LINUX_2023
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/log/amazon/ssm/patch-baseline-operations/common_startup_entrance.py", line 203, in execute
exit( entrance_module.execute(*argv))
File "/var/log/amazon/ssm/patch-baseline-operations/os_selector.py", line 54, in execute
common_os_selector_methods.fetch_snapshot(operation_type, instance_id, region, reboot_option, document_step,
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 280, in fetch_snapshot
snapshot_info = _get_snapshot_info(instance_id, snapshot_id, region, baseline_override_dict)
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 136, in _get_snapshot_info
return _get_snapshot_info_with_fallback_ssm_client(instance_id, region, snapshot_id, baseline_override)
File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 111, in _get_snapshot_info_with_fallback_ssm_client
raise PatchManagerError("Get Snapshot failed", ExitCodes.SNAPSHOT_API_ERROR, e)
patch_common.exceptions.PatchManagerError: ('Get Snapshot failed', 144)
Caused By: An error occurred (ValidationException) when calling the GetDeployablePatchSnapshotForInstance operation: Operating System of Baseline Override was AMAZON_LINUX_2, expected AMAZON_LINUX_2023
I launched another instance today with the same settings. The issue has gone away. It looks like AWS has done somethings. I can find the key/value pair 'operatingSystem': 'AMAZON_LINUX_2023' from the baseline override.
04/25/2023 01:41:07 root [INFO]: Patch Baseline: {'accountId': 'xxxxxxxxxxx', 'baselineId': 'pb-0c4f8f1faeb89596e', 'name': 'Baseline Override', 'globalFilters': {'filters': [{'key': 'PRODUCT', 'values': ['*']}]}, 'approvalRules': {'rules': [{'filterGroup': {'filters': [{'key': 'CLASSIFICATION', 'values': ['Security']}, {'key': 'SEVERITY', 'values': ['Critical', 'Important']}]}, 'complianceLevel': 'UNSPECIFIED', 'enableNonSecurity': False, 'approveAfterDays': 7, 'approveUntilDate': None}, {'filterGroup': {'filters': [{'key': 'CLASSIFICATION', 'values': ['Bugfix']}]}, 'complianceLevel': 'UNSPECIFIED', 'enableNonSecurity': False, 'approveAfterDays': 7, 'approveUntilDate': None}]}, 'approvedPatches': [], 'approvedPatchesComplianceLevel': 'UNSPECIFIED', 'approvedPatchesEnableNonSecurity': False, 'rejectedPatches': [], 'rejectedPatchesAction': 'ALLOW_AS_DEPENDENCY', 'createdTime': 1682386867.215, 'modifiedTime': 1682386867.215, 'description': None, 'operatingSystem': 'AMAZON_LINUX_2023', 'sources': []}