Bug 2350435 - cephadm missing python3-jinja2 dependency
Summary: cephadm missing python3-jinja2 dependency
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ceph
Version: 41
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kaleb KEITHLEY
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-03-06 19:41 UTC by Scott Shambarger
Modified: 2025-03-10 01:15 UTC (History)
7 users (show)

Fixed In Version: ceph-19.2.1-2.fc41
Clone Of:
Environment:
Last Closed: 2025-03-10 01:15:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Scott Shambarger 2025-03-06 19:41:38 UTC
If I install and run cephadm, I receive the following error:

Traceback (most recent call last): 
(removed, as irrelevant...)
ModuleNotFoundError: No module named 'jinja2'

I traced the problem back to the RPM spec patch 0036-src-cephadm-build.py.patch (introduced in commit 8c24c69) which modifies cephadm/build.py:
 - self.install_dependencies = True
 + self.install_dependencies = False

... however, ceph.spec still has:
 %bcond_without cephadm_bundling
which results in python3-jinja2 not being included as a dependency.

The correct solution (I believe) is to remove the patch and update ceph.spec with:
 %bcond_with cephadm_bundling
as that will have the same effect as the patch, but still include the non-bundled dependency.


Reproducible: Always

Comment 1 Kaleb KEITHLEY 2025-03-06 20:39:41 UTC
Your suggested changes to the .spec file are not consistent with the upstream ceph.spec.in in the ceph sources. I try to keep the Fedora dist-git ceph.spec as close to the upstream ceph.spec.in as possible

Perhaps the 0036-src-cephadm-build.py.patch is a mistake? Or maybe python3-jinja2 should be an explicit Requires: for the cephadm subpackage?

%bcond_with and %bcond_without are misleading and can be confusing.  %bcond_with foo surprisingly actually means *without* foo.  We do want cephadm bundled (as a subpackage) so we need to keep the '%bcond_without cephadm_bundling'

Comment 2 Scott Shambarger 2025-03-06 20:48:29 UTC
My understanding is Fedora likes to depend, not bundle (hence the %bcond_with change)... but if the desire is to "bundle dependencies in the package", then yes just remove the patch and keep the" %bond_without cephadm_bundling" as is :)

BTW, I noticed that in addition to python3-jinja2, cephadm also requires python3-pyyaml which isn't in the cepmadm Requires...

Comment 3 Kaleb KEITHLEY 2025-03-07 00:28:02 UTC
(In reply to Scott Shambarger from comment #2)
> My understanding is Fedora likes to depend, not bundle (hence the
> %bcond_with change)... but if the desire is to "bundle dependencies in the
> package", then yes just remove the patch and keep the" %bond_without
> cephadm_bundling" as is :)
> 

cephadm isn't a third party package, nor is it a a git submodule in the ceph source, and it's not really "bundled" in ceph in the usual sense that Fedora uses. Unlike a lot of other things in the ceph tree. (I have been packaging ceph and other packages in Fedora for quite a few years now, and I am familiar with Fedora's preferences wrt bundling. ;-))

What you're seeing is/are the remnants from a few years back when cephadm was temporarily "unbundled" from ceph and packaged separatedly (in the CentOS Storage SIG packages) because it was broken and the cephadm devs wanted to be able to make fixes and release new cephadm builds more frequently than the rest of the ceph releases. When they were building the unbundled cephadm they didn't want a the conflicting, broken version in the ceph core.

And the patch is actually necessary. Without it the build will try and download the Jinja2 sources so that it can build it as a bundled dependency. That doesn't work because builds in the Fedora build system are done in mock, which disables the network. And as you note, Fedora doesn't like bundled dependencies which this would be.

I suspect we should just add python-jinja2 as a Requires. (And python-pyyaml.)

Comment 4 Scott Shambarger 2025-03-07 00:50:23 UTC
> I suspect we should just add python-jinja2 as a Requires. (And python-pyyaml.)

I agree... my point above regarding "%bcond_with cephadm_bundling" was just an alternative to the patch... the condition (if defaulted "off") does the following:
  1. rpm.spec
    - adds "Requires: python3-jinja2" to cephadm
    - defines: -DCEPHADM_BUNDLED_DEPENDENCIES=none for build
  2. cephadm/CMakeLists.txt
    - sets build.py arg: --bundled-dependencies=${CEPHADM_BUNDLED_DEPENDENCIES}
  3. cephadm/build.py:
    - uses cli_args.bundled_dependencies in Config.__init__(), if "none" sets "self.install_dependencies = False"

... and as that's exactly what the patch does; so it's just a non-patch way to do the same thing...

Comment 5 Fedora Update System 2025-03-08 01:01:29 UTC
FEDORA-2025-a6a02a8cdb (ceph-19.2.1-2.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-a6a02a8cdb

Comment 6 Scott Shambarger 2025-03-08 04:42:23 UTC
Tried the install and it correctly requires python3-jinja2 and python3-pyyaml!

Comment 7 Fedora Update System 2025-03-09 02:04:43 UTC
FEDORA-2025-a6a02a8cdb has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-a6a02a8cdb`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-a6a02a8cdb

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2025-03-10 01:15:13 UTC
FEDORA-2025-a6a02a8cdb (ceph-19.2.1-2.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.