By using AWS re:Post, you agree to the Terms of Use

Error loading patching payloadfailed to run commands: exit status 156

0

I'm trying to automate Patching on Ubuntu EC2 instances with Patch Manager and I'm getting this error while trying to execute the command document "AWS-RunPatchBaseline":

Error loading patching payloadfailed to run commands: exit status 156

Error log:

/usr/bin/python3
/usr/bin/python
/usr/bin/apt-get
Reading package lists...
Building dependency tree...
Reading state information...
python3-apt is already the newest version (2.3.0ubuntu2.1).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Using python binary: 'python'
Using Python Version: Python 3.10.4
/usr/bin/curl
/usr/bin/wget
08/02/2022 04:25:05 root [INFO]: Downloading payload from https://s3.dualstack.ap-southeast-2.amazonaws.com/aws-ssm-ap-southeast-2/patchbaselineoperations/linux/payloads/patch-baseline-operations-1.90.tar.gz
08/02/2022 04:25:06 root [INFO]: Attempting to import entrance file os_selector
08/02/2022 04:25:06 root [ERROR]: Error loading entrance module.
Traceback (most recent call last):
  File "/var/log/amazon/ssm/patch-baseline-operations/common_startup_entrance.py", line 164, in execute
    entrance_module = __import__(module_name)
  File "/var/log/amazon/ssm/patch-baseline-operations/os_selector.py", line 11, in <module>
    import common_os_selector_methods
  File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 11, in <module>
    from patch_common.baseline_override import load_baseline_override
  File "/var/log/amazon/ssm/patch-baseline-operations/patch_common/baseline_override.py", line 6, in <module>
    from patch_common.downloader import download_file, load_json_file, is_access_denied
  File "/var/log/amazon/ssm/patch-baseline-operations/patch_common/downloader.py", line 1, in <module>
    import boto3
  File "/var/log/amazon/ssm/patch-baseline-operations/boto3/__init__.py", line 16, in <module>
    from boto3.session import Session
  File "/var/log/amazon/ssm/patch-baseline-operations/boto3/session.py", line 17, in <module>
    import botocore.session
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/session.py", line 29, in <module>
    import botocore.configloader
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/configloader.py", line 19, in <module>
    from botocore.compat import six
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/compat.py", line 25, in <module>
    from botocore.exceptions import MD5UnavailableError
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/exceptions.py", line 15, in <module>
    from botocore.vendored import requests
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/utils.py", line 26, in <module>
    from .compat import parse_http_list as _parse_list_header
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/compat.py", line 7, in <module>
    from .packages import chardet
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/packages/__init__.py", line 3, in <module>
    from . import urllib3
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/packages/urllib3/__init__.py", line 10, in <module>
    from .connectionpool import (
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/packages/urllib3/connectionpool.py", line 38, in <module>
    from .response import HTTPResponse
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/packages/urllib3/response.py", line 9, in <module>
    from ._collections import HTTPHeaderDict
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/packages/urllib3/_collections.py", line 1, in <module>
    from collections import Mapping, MutableMapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
08/02/2022 04:25:06 root [ERROR]: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
Traceback (most recent call last):
  File "/var/log/amazon/ssm/patch-baseline-operations/common_startup_entrance.py", line 164, in execute
    entrance_module = __import__(module_name)
  File "/var/log/amazon/ssm/patch-baseline-operations/os_selector.py", line 11, in <module>
    import common_os_selector_methods
  File "/var/log/amazon/ssm/patch-baseline-operations/common_os_selector_methods.py", line 11, in <module>
    from patch_common.baseline_override import load_baseline_override
  File "/var/log/amazon/ssm/patch-baseline-operations/patch_common/baseline_override.py", line 6, in <module>
    from patch_common.downloader import download_file, load_json_file, is_access_denied
  File "/var/log/amazon/ssm/patch-baseline-operations/patch_common/downloader.py", line 1, in <module>
    import boto3
  File "/var/log/amazon/ssm/patch-baseline-operations/boto3/__init__.py", line 16, in <module>
    from boto3.session import Session
  File "/var/log/amazon/ssm/patch-baseline-operations/boto3/session.py", line 17, in <module>
    import botocore.session
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/session.py", line 29, in <module>
    import botocore.configloader
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/configloader.py", line 19, in <module>
    from botocore.compat import six
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/compat.py", line 25, in <module>
    from botocore.exceptions import MD5UnavailableError
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/exceptions.py", line 15, in <module>
    from botocore.vendored import requests
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/utils.py", line 26, in <module>
    from .compat import parse_http_list as _parse_list_header
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/compat.py", line 7, in <module>
    from .packages import chardet
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/packages/__init__.py", line 3, in <module>
    from . import urllib3
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/packages/urllib3/__init__.py", line 10, in <module>
    from .connectionpool import (
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/packages/urllib3/connectionpool.py", line 38, in <module>
    from .response import HTTPResponse
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/packages/urllib3/response.py", line 9, in <module>
    from ._collections import HTTPHeaderDict
  File "/var/log/amazon/ssm/patch-baseline-operations/botocore/vendored/requests/packages/urllib3/_collections.py", line 1, in <module>
    from collections import Mapping, MutableMapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

Could someone help me with this one?

Instance Details:

PRETTY_NAME="Ubuntu 22.04.1 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.1 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy

1 Answers
1

Hello,

Looking at the Python version (Python 3.10.4) in the error logs, that target instance appears to be running Ubuntu 22.04, which is not yet supported by Patch Manager. For the list of supported operating systems, please refer to Supported operating systems in Patch Manager prerequisites documentation.

https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-prerequisites.html

I've now created a feature request for Ubuntu 22.04 support in Patch Manager.

answered 6 days 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