Bug 1807238 - Did you really mean to hard code a path in Generate completion path?
Summary: Did you really mean to hard code a path in Generate completion path?
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 37
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-25 21:49 UTC by Michael H. Warfield
Modified: 2023-08-23 09:46 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-08-23 09:46:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Michael H. Warfield 2020-02-25 21:49:00 UTC
Description of problem:

An error during an update caused subsequent runs of dnf to emit a database error during "Completion plugin: Generating completion cache" about an sqlite error...

None of the dbf "clean" options would clear the error.

Problem was tracked down to a hard coded path in - /usr/lib/python3.7/site-packages/dnf-plugins/generate_completion_cache.py

        self.cache_file = "/var/cache/dnf/packages.db"

It ignores any cache parameters in dnf.conf and any options for setting the cache parameter on the commandline (--setopts=).  I understand this is for bash completion code but is this what you really intended?  When it breaks, it makes noisy errors that are difficult to diagnose and none of the recommended clean recommendations (dnf clean, rpm --rebuild, etc) have any affect.  I had to chase the code down to find the source of the error and turned this up.  All I had to do is remove that fine and rerun "dnf update" but this doesn't seem to be documented anywhere.

For the record, I'm using an alternate cache directory on an overlayfs file system for shared caching in a clustered environment.  I found this on a couple of machines that had crashed and had a devil of a time finding it.

Version-Release number of selected component (if applicable):

Current Fedora 31: python3-dnf-plugins-core-4.0.13-1.fc31.noarch

How reproducible:

Very

Steps to Reproduce:
1. Corrupt /var/cache/dnf/packages.db by tools of choice.
2. Run DNF update and view error.
3.

Actual results:

Error generated.

Expected results:

Fix DB


Additional info:

Comment 2 Michael H. Warfield 2020-03-02 18:34:57 UTC
May be related or may not be...  Three of my various x86_64 systems (none of the armv7l or aarm64 systems, yet) are now reporting this error in Generate completion cache...

Completion plugin: Generating completion cache...
Completion plugin: Can't write completion cache: database is locked
--> Starting dependency resolution
--> Finished dependency resolution

Other, several, x86_64 systems are not reporting this error even though they share all share a common cache repository on NFS (in a different specified directory with overlayfs mounts).

Looking at the local repositories on each system there the hard coded path points, I can't see any sort of pidlock or file lock.

Problem on these three systems are consistent and persistent whether I use my overlayfs front end to dnf or go straight to dnf (standard local /var/cache/dnf).

Problem on these three systems persist across system reboots.

Problem is also largely cosmetic and doesn't negatively impact a dnf update per se but documented operations don't seem to fix it.

Again, removing the hard coded /var/cache/dnf/packages.db file resolves the problem in both my overlayfs case and the straight to local dnf case.

Comment 3 Ben Cotton 2020-11-03 17:21:11 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ben Cotton 2021-02-09 16:23:05 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 5 Ben Cotton 2022-05-12 16:29:40 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 6 Ben Cotton 2022-08-09 13:36:41 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.

Comment 7 Jaroslav Mracek 2023-08-23 09:46:45 UTC
The bug is fixed in DNF5 where cache is not generated. DNF5 is available in Fedora 38 and will replace DNF (Fedora 41). Because dnf is close to EOL we do not have a plan to fix the issue.


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