During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/env/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 135, in handle
self.handle_request`enter code here`(listener, req, client, addr)
File "/env/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 178, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/env/lib/python3.7/site-packages/django/core/handlers/wsgi.py", line 133, in __call__
response = self.get_response(request)
File "/env/lib/python3.7/site-packages/django/core/handlers/base.py", line 130, in get_response
response = self._middleware_chain(request)
File "/env/lib/python3.7/site-packages/django/core/handlers/exception.py", line 49, in inner
response = response_for_exception(request, exc)
File "/env/lib/python3.7/site-packages/django/core/handlers/exception.py", line 114, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/env/lib/python3.7/site-packages/django/core/handlers/exception.py", line 152, in handle_uncaught_exception
callback = resolver.resolve_error_handler(500)
File "/env/lib/python3.7/site-packages/django/urls/resolvers.py", line 615, in resolve_error_handler
callback = getattr(self.urlconf_module, 'handler%s' % view_type, None)
File "/env/lib/python3.7/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/env/lib/python3.7/site-packages/django/urls/resolvers.py", line 595, in urlconf_module
return import_module(self.urlconf_name)
File "/opt/python3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/vmagent/app/mysite/urls.py", line 38, in <module>
re_path(r'^rosetta/', include('rosetta.urls'))
File "/env/lib/python3.7/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "/opt/python3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/env/lib/python3.7/site-packages/rosetta/urls.py", line 4, in <module>
from . import views
File "/env/lib/python3.7/site-packages/rosetta/views.py", line 30, in <module>
from .translate_utils import TranslationException, translate
File "/env/lib/python3.7/site-packages/rosetta/translate_utils.py", line 4, in <module>
import requests
File "/env/lib/python3.7/site-packages/requests/__init__.py", line 43, in <module>
import urllib3
File "/env/lib/python3.7/site-packages/urllib3/__init__.py", line 42, in <module>
"urllib3 v2.0 only supports OpenSSL 1.1.1+, currently "
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2g 1 Mar 2016'. See: https://github.com/urllib3/urllib3/issues/2168
Above is my Google Kubernetes Engine Pod logs, I found many packages not support my dev project mostly install latest packages and use latest version of framework, When I deployment the project on GKE, I got these issue.
How to fix please? I don't want to delete and redo with for a compatible.
As your dev project is deployed in GKE and as per this GKE Official doc, Google kubernetes engine supports Python >= 3.7 and unsupported Python <= 3.6. So, As WombatPM suggested, you need to upgrade your python version to >= 3.7. This might help you resolve your issue. Notice: Python 2 is no longer supported by the community. We recommend that you migrate Python 2 apps to Python 3.
Also you want to create a new GKE Cluster by using docker file , can you refer to this Deploy an app to a GKE cluster and GKE Overview .
Instead of creating a new environment, you can also upgrade to the latest python version by using this command pipenv install --python 3.11
and also refer to this installation guide.