Bug 2231548

Summary: Errors on command line / dnf log when python3-dnf-plugins-core installed
Product: [Fedora] Fedora Reporter: Adam Williamson <awilliam>
Component: PackageKitAssignee: Richard Hughes <rhughes>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 39CC: gnome-sig, rdieter, rhughes
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adam Williamson 2023-08-11 19:47:53 UTC
PackageKit contains the notify_packagekit.py DNF plugin, which does `from dnfpluginscore import _`, but it has no dependency on python3-dnf-plugins-core . So you can get in a situation where you have PackageKit installed but not python3-dnf-plugins-core , and then you get errors like this on any dnf install:

2023-08-11T08:11:26-0400 ERROR Failed loading plugin "notify_packagekit": No module named 'dnfpluginscore'
2023-08-11T08:11:26-0400 SUBDEBUG 
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/dnf/plugin.py", line 214, in _import_modules
    module = importlib.import_module(name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1293, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1266, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1237, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 841, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 400, in _call_with_frames_removed
  File "/usr/lib/python3.12/site-packages/dnf-plugins/notify_packagekit.py", line 27, in <module>
    from dnfpluginscore import _
ModuleNotFoundError: No module named 'dnfpluginscore'

Reproducible: Always

Steps to Reproduce:
1. Install PackageKit without python3-dnf-plugins-core
2. Install a package with dnf
Actual Results:  
Error is displayed and/or logged

Expected Results:  
No error

Comment 1 Fedora Release Engineering 2023-08-16 08:14:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.