thoth-station / amun-api

Thoth's execution engine for inspecting quality, performance, and usability of software and software stacks in a cluster.
https://thoth-station.ninja/
GNU General Public License v3.0
8 stars 13 forks source link

Amun API fails to start due to dependency issues #669

Closed fridex closed 2 years ago

fridex commented 2 years ago

Describe the bug

---> Serving application with gunicorn (amun.entrypoint:app) with default settings ...
[2022-04-06 08:29:45 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2022-04-06 08:29:45 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
[2022-04-06 08:29:45 +0000] [1] [INFO] Using worker: sync
[2022-04-06 08:29:45 +0000] [22] [INFO] Booting worker with pid: 22
[2022-04-06 08:29:46 +0000] [22] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/util.py", line 359, in import_app
    mod = importlib.import_module(module)
  File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/app-root/src/amun/entrypoint.py", line 27, in <module>
    import connexion
  File "/opt/app-root/lib64/python3.8/site-packages/connexion/__init__.py", line 14, in <module>
    from .apis import AbstractAPI  # NOQA
  File "/opt/app-root/lib64/python3.8/site-packages/connexion/apis/__init__.py", line 16, in <module>
    from .abstract import AbstractAPI  # NOQA
  File "/opt/app-root/lib64/python3.8/site-packages/connexion/apis/abstract.py", line 21, in <module>
    from ..spec import Specification
  File "/opt/app-root/lib64/python3.8/site-packages/connexion/spec.py", line 13, in <module>
    import jinja2
  File "/opt/app-root/lib64/python3.8/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/opt/app-root/lib64/python3.8/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/opt/app-root/lib64/python3.8/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/opt/app-root/lib64/python3.8/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/opt/app-root/lib64/python3.8/site-packages/markupsafe/__init__.py)

To Reproduce Steps to reproduce the behavior:

  1. Go to ocp4-stage deployment
  2. Check amun-api boot log
  3. See error

Expected behavior

Amun API should start.

mayaCostantini commented 2 years ago

We already had this issue documented in a prescription: https://github.com/thoth-station/prescriptions/pull/19748 We need to downgrade markupsafe to <2.1.0 as done in user-api: https://github.com/thoth-station/user-api/pull/1681

fridex commented 2 years ago

+1, tried thamos advise in the repo, but we don't have these prescriptions in prod yet. We need to do a release. Anywa, I will open a PR to manually adjust requirements in Pipfile. Thanks!