Horizon: Fails to launch due to python3-django package upgrade

Bug #2034379 reported by Alyson Deives Pereira
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
High
Agustin Carranza

Bug Description

Brief Description
-----------------
This change upgraded python3-django package to fix a CVE issue:
https://review.opendev.org/c/starlingx/tools/+/891933

Due to this upgrade, Horizon fails to launch with "ValueError: FileInput doesn't support uploading multiple files."
Starlingx dashboard source code must be updated to comply with updated django package.
Log indicate the issues occurs here:
https://opendev.org/starlingx/gui/src/branch/master/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/software_management/forms.py#L25

Severity
--------
Provide the severity of the defect.
<Critical: System/Feature is not usable due to the defect>

Steps to Reproduce
------------------
- Build and install latest ISO from master branch
- Configure and initialize system
- Observe via sm-customer.log that horizon fails to start

Expected Behavior
------------------
Horizon should start with no issues

Actual Behavior
----------------
Horizon does not start

Reproducibility
---------------
Reproducible

System Configuration
--------------------
AIO-SX

Branch/Pull Time/Commit
-----------------------
stx/master
Build ID: 2023-09-04_16-20-34

Last Pass
---------
Yes, before python3-django upgrade

Timestamp/Logs
--------------
Logs from /var/log/horizon/gunicorn.log

[2023-09-05 00:13:50 +0000] [20519] [INFO] Starting gunicorn 20.1.0
[2023-09-05 00:13:50 +0000] [20519] [INFO] Listening at: http://127.0.0.1:8008 (20519)
[2023-09-05 00:13:50 +0000] [20519] [INFO] Using worker: eventlet
[2023-09-05 00:13:50 +0000] [21363] [INFO] Booting worker with pid: 21363
[2023-09-05 00:13:51 +0000] [21363] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/usr/lib/python3/dist-packages/gunicorn/workers/geventlet.py", line 133, in init_process
    self.patch()
  File "/usr/lib/python3/dist-packages/gunicorn/workers/geventlet.py", line 124, in patch
    eventlet.monkey_patch()
  File "/usr/lib/python3/dist-packages/eventlet/patcher.py", line 274, in monkey_patch
    _green_existing_locks()
  File "/usr/lib/python3/dist-packages/eventlet/patcher.py", line 371, in _green_existing_locks
    if isinstance(obj, rlock_type):
  File "/usr/lib/python3/dist-packages/django/utils/functional.py", line 256, in inner
    self._setup()
  File "/usr/lib/python3/dist-packages/django/utils/functional.py", line 392, in _setup
    self._wrapped = self._setupfunc()
  File "/usr/lib/python3/dist-packages/horizon/base.py", line 845, in url_patterns
    return self._urls()[0]
  File "/usr/lib/python3/dist-packages/horizon/base.py", line 879, in _urls
    _wrapped_include(dash._decorated_urls)))
  File "/usr/lib/python3/dist-packages/horizon/base.py", line 554, in _decorated_urls
    _wrapped_include(panel._decorated_urls)))
  File "/usr/lib/python3/dist-packages/horizon/base.py", line 328, in _decorated_urls
    urlpatterns = self._get_default_urlpatterns()
  File "/usr/lib/python3/dist-packages/horizon/base.py", line 131, in _get_default_urlpatterns
    urls_mod = import_module('.urls', package_string)
  File "/usr/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 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/starlingx_dashboard/dashboards/admin/software_management/urls.py", line 9, in <module>
    from starlingx_dashboard.dashboards.admin.software_management.views import \
  File "/usr/lib/python3/dist-packages/starlingx_dashboard/dashboards/admin/software_management/views.py", line 21, in <module>
    from starlingx_dashboard.dashboards.admin.software_management.forms import \
  File "/usr/lib/python3/dist-packages/starlingx_dashboard/dashboards/admin/software_management/forms.py", line 20, in <module>
    class UploadPatchForm(forms.SelfHandlingForm):
  File "/usr/lib/python3/dist-packages/starlingx_dashboard/dashboards/admin/software_management/forms.py", line 23, in UploadPatchForm
    widget=forms.FileInput(attrs={
  File "/usr/lib/python3/dist-packages/django/forms/widgets.py", line 386, in __init__
    raise ValueError(
ValueError: FileInput doesn't support uploading multiple files.
[2023-09-05 00:13:51 +0000] [21363] [INFO] Worker exiting (pid: 21363)
[2023-09-05 00:13:51 +0000] [21374] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/usr/lib/python3/dist-packages/gunicorn/workers/geventlet.py", line 133, in init_process
    self.patch()
  File "/usr/lib/python3/dist-packages/gunicorn/workers/geventlet.py", line 124, in patch
    eventlet.monkey_patch()
  File "/usr/lib/python3/dist-packages/eventlet/patcher.py", line 274, in monkey_patch
    _green_existing_locks()
  File "/usr/lib/python3/dist-packages/eventlet/patcher.py", line 371, in _green_existing_locks
    if isinstance(obj, rlock_type):
  File "/usr/lib/python3/dist-packages/django/utils/functional.py", line 256, in inner
    self._setup()
  File "/usr/lib/python3/dist-packages/django/utils/functional.py", line 392, in _setup
    self._wrapped = self._setupfunc()
  File "/usr/lib/python3/dist-packages/horizon/base.py", line 845, in url_patterns
    return self._urls()[0]
  File "/usr/lib/python3/dist-packages/horizon/base.py", line 879, in _urls
    _wrapped_include(dash._decorated_urls)))
  File "/usr/lib/python3/dist-packages/horizon/base.py", line 554, in _decorated_urls
    _wrapped_include(panel._decorated_urls)))
  File "/usr/lib/python3/dist-packages/horizon/base.py", line 328, in _decorated_urls
    urlpatterns = self._get_default_urlpatterns()
  File "/usr/lib/python3/dist-packages/horizon/base.py", line 131, in _get_default_urlpatterns
    urls_mod = import_module('.urls', package_string)
  File "/usr/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 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/starlingx_dashboard/dashboards/admin/software_management/urls.py", line 9, in <module>
    from starlingx_dashboard.dashboards.admin.software_management.views import \
  File "/usr/lib/python3/dist-packages/starlingx_dashboard/dashboards/admin/software_management/views.py", line 21, in <module>
    from starlingx_dashboard.dashboards.admin.software_management.forms import \
  File "/usr/lib/python3/dist-packages/starlingx_dashboard/dashboards/admin/software_management/forms.py", line 20, in <module>
    class UploadPatchForm(forms.SelfHandlingForm):
  File "/usr/lib/python3/dist-packages/starlingx_dashboard/dashboards/admin/software_management/forms.py", line 23, in UploadPatchForm
    widget=forms.FileInput(attrs={
  File "/usr/lib/python3/dist-packages/django/forms/widgets.py", line 386, in __init__
    raise ValueError(
ValueError: FileInput doesn't support uploading multiple files.
[2023-09-05 00:13:51 +0000] [21374] [INFO] Worker exiting (pid: 21374)
[2023-09-05 00:13:51 +0000] [20519] [WARNING] Worker with pid 21374 was terminated due to signal 15
[2023-09-05 00:13:51 +0000] [20519] [INFO] Shutting down: Master
[2023-09-05 00:13:51 +0000] [20519] [INFO] Reason: Worker failed to boot.

Test Activity
-------------
Developer Testing

Workaround
----------
Rollback python3-django package to python3-django_2.2.28-1~deb11u1_all.deb

Revision history for this message
Alyson Deives Pereira (adeivesp) wrote :

Log from /var/log/sm-customer.log

| 2023-09-05T21:15:50.979 | 1541 | service-scn | horizon | enabling-throttle-failed | enabling-failed | throttle open to enable service
| 2023-09-05T21:16:04.995 | 1542 | service-scn | horizon | enabling-failed | enabled-active-failed | enable success
| 2023-09-05T21:16:07.649 | 1543 | service-scn | horizon | enabled-active-failed | disabled-failed | process (pid=482022) failed
| 2023-09-05T21:16:07.711 | 1544 | service-scn | horizon | disabled-failed | enabling-throttle-failed | enabled-active state requested

Revision history for this message
Agustin Carranza (acarranz) wrote :

This revert review has been merged to address this issue.
https://review.opendev.org/c/starlingx/tools/+/893960

Revision history for this message
Ghada Khalil (gkhalil) wrote (last edit ):
Changed in starlingx:
status: New → In Progress
Ghada Khalil (gkhalil)
tags: added: stx.9.0 stx.gui
Revision history for this message
Ghada Khalil (gkhalil) wrote :

The revert has been merged. Marking as Fix Released.

Changed in starlingx:
assignee: nobody → Agustin Carranza (acarranz)
importance: Undecided → High
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to gui (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/gui/+/894258

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.