I'm running some AWS lambda serverless functions (Python 3.9) that make use of the python jira library. The jira module started throwing an error on import in the lambda environment yesterday (see error below); it still imports and runs just fine in python 3.9 in my workstation.
It looks to me like the error may be linked to jira's dependency on the requests library, with which AWS has an interesting history. I use urllib3 instead of requests wherever possible, but if this is the cause then I'm not sure how to work around this dependency.
Can anyone comment on whether this is likely to be the source of the error? Any suggestions on how to troubleshoot and/or work around this?
Traceback (most recent call last):
File "/var/lang/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/var/task/sqsQueueHandler.py", line 13, in <module>
from core.jira_client import jira_client
File "/opt/python/core/jira_client.py", line 1, in <module>
from jira import JIRA # https://jira.readthedocs.io/
File "/var/task/jira/__init__.py", line 11, in <module>
from jira.client import (
File "/var/task/jira/client.py", line 43, in <module>
import requests
File "/var/task/requests/__init__.py", line 45, in <module>
from .exceptions import RequestsDependencyWarning
File "/var/task/requests/exceptions.py", line 9, in <module>
from .compat import JSONDecodeError as CompatJSONDecodeError
File "/var/task/requests/compat.py", line 13, in <module>
import charset_normalizer as chardet
File "/var/task/charset_normalizer/__init__.py", line 24, in <module>
from .api import from_bytes, from_fp, from_path, is_binary
File "/var/task/charset_normalizer/api.py", line 5, in <module>
from .cd import (
File "/var/task/charset_normalizer/cd.py", line 7, in <module>
from .constant import (
File "/var/task/charset_normalizer/constant.py", line 399, in <module>
list(set(aliases._values())) + IANA_NO_ALIASES,
Edit: for context, there were no recent changes to the script 'jira_client.py' where the import function is now failing