SSM AWS-RunPatchBaseline Script Failure `missing 1 required positional argument`

0

I have started seeing failures on Scanning for patching using patch manager on amazon linux 2022 and 2023. I'm seeing it on both x86 and arm deployments of AL2022/2023.

/usr/bin/python3
/usr/bin/yum
/usr/bin/dnf
Using python binary: 'python3'
Using Python Version: Python 3.9.16
04/13/2023 20:04:57 root [INFO]: Downloading payload from https://s3.dualstack.us-west-2.amazonaws.com/aws-ssm-us-west-2/patchbaselineoperations/crossaccount/payloads/patch-baseline-operations-cross-account-63.0.tar.gz
04/13/2023 20:04:58 root [INFO]: Attempting to import entrance file os_selector_cross_account
04/13/2023 20:04:58 root [INFO]: Running with snapshot id =  and operation = Scan
04/13/2023 20:04:59 root [INFO]: Instance Id: i-0b************
04/13/2023 20:04:59 root [INFO]: Region: us-west-2
04/13/2023 20:04:59 root [INFO]: Product: AmazonLinux2023
04/13/2023 20:04:59 root [INFO]: Patch Group: 
04/13/2023 20:04:59 root [INFO]: Operation type: Scan
04/13/2023 20:04:59 root [INFO]: Snapshot Id: 72267b53-9594-4369-8507-e89e45e479b1
04/13/2023 20:04:59 root [INFO]: Patch Baseline: {'accountId': '***********', 'baselineId': 'pb-0a624803d647da0ab', 'name': 'AWS-AmazonLinux2023DefaultPatchBaseline', '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': 1678728950.037, 'modifiedTime': 1678728950.037, 'description': 'Default Patch Baseline for Amazon Linux 2023 Provided by AWS.', 'operatingSystem': 'AMAZON_LINUX_2023', 'sources': []}
04/13/2023 20:04:59 root [INFO]: Reboot Option: RebootIfNeeded
04/13/2023 20:04:59 root [INFO]: Unable to initialize exit code reporting: No metrics ID from server
04/13/2023 20:04:59 root [INFO]: Loading patch snapshot from snapshot.json
04/13/2023 20:04:59 root [INFO]: {'patchBaseline': {'accountId': '*********', 'baselineId': 'pb-0a624803d647da0ab', 'name': 'AWS-AmazonLinux2023DefaultPatchBaseline', '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': 1678728950.037, 'modifiedTime': 1678728950.037, 'description': 'Default Patch Baseline for Amazon Linux 2023 Provided by AWS.', 'operatingSystem': 'AMAZON_LINUX_2023', 'sources': []}, 'product': 'AmazonLinux2023', 'patchGroup': '', 'instanceId': 'i-0b100e2ffed916511', 'region': 'us-west-2', 'operation': 'Scan', 'snapshotId': '72267b53-9594-4369-8507-e89e45e479b1', 'installOverrideList': '', 'rebootOption': 'RebootIfNeeded', 'associationId': '43b0b8d6-3828-4900-b0bb-4622ecf5b260', 'associationSeverity': 'UNSPECIFIED'}
04/13/2023 20:04:59 root [ERROR]: __init__() missing 1 required positional argument: 'error_code'
Traceback (most recent call last):
  File "/var/log/amazon/ssm/patch-baseline-operations/./main_entrance_cross_account.py", line 117, in <module>
    (patching_exit_code, inventory) = (get_execution_module(oper_sys, snapshot_object.product)).execute(snapshot_object, override_list)
  File "/var/log/amazon/ssm/patch-baseline-operations/common_main_entrance_methods.py", line 91, in get_execution_module
    raise PatchManagerError("Could not find module %s for %s" % (module_name, operating_system))
TypeError: __init__() missing 1 required positional argument: 'error_code'

I've removed account and instance ids from the error message.

posta un anno fa100 visualizzazioni
Nessuna risposta

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande