aws patch manager baseline issue

0

when I apply patches I get this erros which I bold mark

/usr/bin/python3 /usr/bin/apt-get Reading package lists... Building dependency tree... Reading state information... python3-apt is already the newest version (2.0.1ubuntu0.20.04.1). 0 upgraded, 0 newly installed, 0 to remove and 41 not upgraded. Using python binary: 'python3' Using Python Version: Python 3.9.16 03/21/2023 06:13:45 root [INFO]: Downloading payload from https://s3.dualstack.ap-south-1.amazonaws.com/aws-ssm-ap-south-1/patchbaselineox/payloads/patch-baseline-operations-1.105.tar.gz 03/21/2023 06:13:46 root [INFO]: Attempting to import entrance file os_selector 03/21/2023 06:13:46 root [INFO]: Running with snapshot id = and operation = Scan 03/21/2023 06:13:46 botocore.credentials [INFO]: Found credentials in shared credentials file: ~/.aws/credentials 03/21/2023 06:13:46 root [ERROR]: An error occurred (AccessDeniedException) when calling the GetDeployablePatchSnapshotForInstance operation: Instance Id i-009dab947dec531ad doesn't match the credentials 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 434, 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 (AccessDeniedException) when calling the GetDeployablePatchSnapshotForInstance operation: Instance Id i-009vbhjkab94bnmad doesn't match the credentials 03/21/2023 06:13:46 root [INFO]: Unable to retrieve snapshot with default ssm client, retry with fallback ssm client 03/21/2023 06:13:46 botocore.credentials [INFO]: Found credentials in shared credentials file: ~/.aws/credentials 03/21/2023 06:13:46 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 434, 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 (AccessDeniedException) when calling the GetDeployablePatchSnapshotForInstance operation: Instance Id i-009dab9ghjkl531ad doesn't match the credentials

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 434, 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 (AccessDeniedException) when calling the GetDeployablePatchSnapshotForInstance operation: Instance Id i-009dab947dec531ad doesn't match the credentials

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 108, in _get_snapshot_info_with_fallback_ssm_client raise PatchManagerError("GetDeployableSnapshotForInstance had access denied and no metadata credentials were available", patch_common.exceptions.PatchManagerError: ('GetDeployableSnapshotForInstance had access denied and no metadata credentials were available', 145) 03/21/2023 06:13:46 root [ERROR]: ('GetDeployableSnapshotForInstance had access denied and no metadata credentials were available', 145) 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 434, 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 (AccessDeniedException) when calling the GetDeployablePatchSnapshotForInstance operation: Instance Id i-009dab947dec531ad doesn't match the credentials

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 434, 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 (AccessDeniedException) when calling the GetDeployablePatchSnapshotForInstance operation: Instance Id i-009dab947dec531ad doesn't match the credentials

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 108, in _get_snapshot_info_with_fallback_ssm_client raise PatchManagerError("GetDeployableSnapshotForInstance had access denied and no metadata credentials were available", patch_common.exceptions.PatchManagerError: ('GetDeployableSnapshotForInstance had access denied and no metadata credentials were available', 145) 03/21/2023 06:13:46 root [ERROR]: write() argument must be str, not None Traceback (most recent call last): File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 126, in _get_snapshot_info File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 434, in _get_snapshot_with_client File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 276, in _api_call File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 586, in _make_api_call botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the GetDeployablePatchSnapshotForInstance operation: Instance Id i-009dab947dec531ad doesn't match the credentials

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 File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 434, in _get_snapshot_with_client File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 276, in _api_call File "/var/log/amazon/ssm/patch-baseline-operations/botocore/client.py", line 586, in _make_api_call botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the GetDeployablePatchSnapshotForInstance operation: Instance Id i-009dab947dec531ad doesn't match the credentials

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 File "/var/log/amazon/ssm/patch-baseline-operations/os_selector.py", line 54, in execute File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 280, in fetch_snapshot File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 136, in _get_snapshot_info File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 108, in _get_snapshot_info_with_fallback_ssm_client patch_common.exceptions.PatchManagerError: ('GetDeployableSnapshotForInstance had access denied and no metadata credentials were available', 145)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "<stdin>", line 181, in <module> File "/var/log/amazon/ssm/patch-baseline-operations/common_startup_entrance.py", line 210, in execute File "/var/log/amazon/ssm/patch-baseline-operations/common_startup_entrance.py", line 149, in abort TypeError: write() argument must be str, not None

Ram
asked a year ago503 views
1 Answer
0

I find soluction mv .aws/credentials file in other folder like bewlow command mv .aws/credentials /tmp

Ram
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions