Bug 2119256

Summary: [Ceph-mgr] Module 'restful' has failed dependency: No module named 'dataclasses'
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Sunil Angadi <sangadi>
Component: Ceph-Mgr PluginsAssignee: Ken Dreyer (Red Hat) <kdreyer>
Ceph-Mgr Plugins sub component: restful QA Contact: Sunil Angadi <sangadi>
Status: CLOSED ERRATA Docs Contact: ceph-docs <ceph-docs>
Severity: urgent    
Priority: unspecified CC: adking, akraj, anarnold, gmeno, kdreyer, vashastr
Version: 5.3Keywords: AutomationBlocker
Target Milestone: ---   
Target Release: 5.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-werkzeug-2.0.3-3.el8cp Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-11 17:41:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 3 Ken Dreyer (Red Hat) 2022-08-22 16:50:07 UTC
This looks like it could be related to the werkzeug + dataclasses update in https://bugzilla.redhat.com/show_bug.cgi?id=2053446

Comment 4 Ken Dreyer (Red Hat) 2022-08-22 17:26:09 UTC
During the container build process, DNF installs python3-werkzeug-2.0.3 (for bug 2053446) but it does not pull in python3-dataclasses. Likewise, our CI composes have the new python3-werkzeug 2.0.3 package but they do not have the python3-dataclasses package. The problem is that the werkzeug RPM lacks the dataclasses package requirement here:

$ rpm -q --requires python3-werkzeug-2.0.3-1.el8cp.noarch
python(abi) = 3.6
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1

RPM is supposed to automatically add dataclasses to this list, since the package cannot function without it, as in this test:

>>> import werkzeug
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/werkzeug/__init__.py", line 2, in <module>
    from .test import Client as Client
  File "/usr/lib/python3.6/site-packages/werkzeug/test.py", line 30, in <module>
    from .sansio.multipart import Data
  File "/usr/lib/python3.6/site-packages/werkzeug/sansio/multipart.py", line 2, in <module>
    from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses'


My theory is that RHEL 8's python3-rpm-macros-3-41.el8 might not be able to parse this ":python_version" syntax in Werkzeug-2.0.3-py3.6.egg-info/requires.txt:

  [:python_version < "3.7"]
  dataclasses

At any rate, I've added an explicit Requires line to python-werkzeug-2.0.3-3: https://pkgs.devel.redhat.com/cgit/rpms/python-werkzeug/commit/?h=ceph-5.3-rhel-8&id=292f1b5a06ca530d6d2ceaf93e802f5440e7dd66

Comment 13 errata-xmlrpc 2023-01-11 17:41:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Red Hat Ceph Storage 5.3 security update and Bug Fix), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:0076