oracle / oci-designer-toolkit

OCI designer toolKIT (OKIT) is a set of tools for enabling design, deploy and visualise OCI environments through a graphical web based interface.
Universal Permissive License v1.0
260 stars 122 forks source link

Error starting gunicorn.service on VM Running Oracle Linux 8.9 #631

Closed DanielBatesJ closed 1 day ago

DanielBatesJ commented 3 months ago

Hello, I am working through setting up OKIT on a new Oracle Linux 8.9-2024.02.26-0 VM on Oracle Cloud Infrastructure.

I am following the Native Oracle Linux install instructions running as root (OKIT installed in root directory), with the OCI CLI configured and tested (config & keys stored in root).

After following all of the steps listed in the instructions (using http), checking the status sudo systemctl status gunicorn.service initially shows as active and running, but after a few seconds, the process exits due to a failure in some Python code farther up the chain.

Mar 26 21:06:24 okitdemo gunicorn[9276]:   File "/usr/local/lib/python3.6/site-packages/git/__init__.py", line 8, in <module>
Mar 26 21:06:24 okitdemo gunicorn[9276]:     from git.exc import *                       # @NoMove @IgnorePep8
Mar 26 21:06:24 okitdemo gunicorn[9276]:   File "/usr/local/lib/python3.6/site-packages/git/exc.py", line 10, in <module>
Mar 26 21:06:24 okitdemo gunicorn[9276]:     from git.compat import safe_decode
Mar 26 21:06:24 okitdemo gunicorn[9276]:   File "/usr/local/lib/python3.6/site-packages/git/compat.py", line 32, in <module>
Mar 26 21:06:24 okitdemo gunicorn[9276]:     from git.types import TBD
Mar 26 21:06:24 okitdemo gunicorn[9276]:   File "/usr/local/lib/python3.6/site-packages/git/types.py", line 12, in <module>
Mar 26 21:06:24 okitdemo gunicorn[9276]:     from typing_extensions import Final, Literal, SupportsIndex
Mar 26 21:06:24 okitdemo gunicorn[9276]: ImportError: cannot import name 'SupportsIndex'
Mar 26 21:06:24 okitdemo gunicorn[9276]: [2024-03-26 21:06:24 +0000] [9276] [INFO] Worker exiting (pid: 9276)
[root@okitdemo ~]# sudo systemctl status gunicorn.service
● gunicorn.service - gunicorn daemon
   Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2024-03-26 21:06:25 GMT; 771ms ago
  Process: 9269 ExecStart=/usr/local/bin/gunicorn okitweb.wsgi:app --config /okit/config/gunicorn_http.py (code=exited, status=3)
 Main PID: 9269 (code=exited, status=3)

Mar 26 21:06:24 okitdemo gunicorn[9276]: ImportError: cannot import name 'SupportsIndex'
Mar 26 21:06:24 okitdemo gunicorn[9276]: [2024-03-26 21:06:24 +0000] [9276] [INFO] Worker exiting (pid: 9276)
Mar 26 21:06:25 okitdemo gunicorn[9269]: [2024-03-26 21:06:25 +0000] [9269] [ERROR] Worker (pid:9274) exited with code 3
Mar 26 21:06:25 okitdemo gunicorn[9269]: [2024-03-26 21:06:25 +0000] [9269] [ERROR] Worker (pid:9276) was sent SIGTERM!
Mar 26 21:06:25 okitdemo gunicorn[9269]: [2024-03-26 21:06:25 +0000] [9269] [ERROR] Worker (pid:9272) was sent SIGTERM!
Mar 26 21:06:25 okitdemo gunicorn[9269]: [2024-03-26 21:06:25 +0000] [9269] [ERROR] Worker (pid:9273) was sent SIGTERM!
Mar 26 21:06:25 okitdemo gunicorn[9269]: [2024-03-26 21:06:25 +0000] [9269] [ERROR] Shutting down: Master
Mar 26 21:06:25 okitdemo gunicorn[9269]: [2024-03-26 21:06:25 +0000] [9269] [ERROR] Reason: Worker failed to boot.
Mar 26 21:06:25 okitdemo systemd[1]: gunicorn.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
Mar 26 21:06:25 okitdemo systemd[1]: gunicorn.service: Failed with result 'exit-code'.

In /usr/local/lib/python3.6/site-packages/git/types.py

import os
import sys
from typing import Union, Any

if sys.version_info[:2] >= (3, 8):
    from typing import Final, Literal, SupportsIndex  # noqa: F401
else:
    from typing_extensions import Final, Literal, SupportsIndex

if sys.version_info[:2] < (3, 9):
    # Python >= 3.6, < 3.9
    PathLike = Union[str, os.PathLike]
elif sys.version_info[:2] >= (3, 9):
    # os.PathLike only becomes subscriptable from Python 3.9 onwards
    PathLike = Union[str, 'os.PathLike[str]']  # forward ref as pylance complains unless editing with py3.9+

TBD = Any

Lit_config_levels = Literal['system', 'global', 'user', 'repository']

python --version = Python 3.6.8

It seems the file is already checking for Python Versioning for this library, and only fails on the last import for 'SupportsIndex', not any of the previous from the same typing_extensions.

I can't seem to get a good idea of where to go from here, I've rebooted the instance, and that had no impact. Any help / guidance on this would be appreciated.

Thank you

toxophilist commented 3 months ago

@DanielBatesJ Can you try updating to a later release of python.

jlirette1 commented 2 months ago

I am having the exact same issue. I upgraded python as suggested above and got the same result.

toxophilist commented 2 months ago

@jlirette1 What version of python have you upgraded to. Looks like SupportsIndex was only added in 3.8. Also you'll need to make sure that your upgraded version of python marked as the default.

jlirette1 commented 2 months ago

Marking as default fixed my problem. Thanks