Bug 1950585

Summary: Couldn't open file /var/lib/dnf/plugins/local/repodata/repomd.xml
Product: [Fedora] Fedora Reporter: Chris Murphy <bugzilla>
Component: dnf-plugins-extrasAssignee: rpm-software-management
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: dmach, jkadlcik, jmracek, mblaha, pkratoch, rpm-software-management, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-19 06:21:32 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:

Description Chris Murphy 2021-04-17 02:47:41 UTC
Description of problem:

Discovered this great idea
https://fedoramagazine.org/use-the-dnf-local-plugin-to-speed-up-your-home-lab/

No matter, what I try, I can't get it to work on F33 or F34.


Version-Release number of selected component (if applicable):
python3-dnf-plugin-local-4.0.18-1.fc33.noarch
python3-dnf-plugin-local-4.0.19-1.fc34.noarch

How reproducible:
Always


Steps to Reproduce:
1. sudo dnf update
2.
3.

Actual results:

$ sudo dnf update                                                                                                               
_dnf_local                                                                                                                                   0.0  B/s |   0  B     00:00     
Errors during downloading metadata for repository '_dnf_local':                                                                                                              
  - Curl error (37): Couldn't read a file:// file for file:///var/lib/dnf/plugins/local/repodata/repomd.xml [Couldn't open file /var/lib/dnf/plugins/local/repodata/repomd.xm
l]                                                                                                                                                                           
Error: Failed to download metadata for repo '_dnf_local': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried                            

If I answer Y to go ahead and update, the RPMs still go in /var/cache/dnf, where they are also then deleted after the updated.


Expected results:

Well, I expect it should create a repomd.xml file and also the RPM's should go in the repodir I've specified rather than in /var/cache/dnf and also they shouldn't be deleted.


Additional info:


Article also says "The plugin will create the directory, if necessary, despite the initial errors." except that it doesn't. The errors persist, the directory I've specified isn't created.

If I create the path and file:

$ sudo dnf update                                                                                                                                          
_dnf_local                                                                                                                                   0.0  B/s |   0  B     00:00     
Error: Failed to download metadata for repo '_dnf_local': repomd.xml parser error: Parse error at line: 1 (Extra content at the end of the document                          
)                                                                                                                                                                            
Ignoring repositories: _dnf_local

Comment 1 Chris Murphy 2021-04-17 02:51:54 UTC
[chris@fnuc ~]$ sudo dnf update -vvvv                                                                                                                                        
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, local, needs-restarting, playground, repoclosure, r
epodiff, repograph, repomanage, reposync, system-upgrade                                                                                                                     
DNF version: 4.6.1                                                                                                                                                           
cachedir: /var/cache/dnf                                                                                                                                                     
User-Agent: constructed: 'libdnf (Fedora 33; server; Linux.x86_64)'                                                                                                          
repo: downloading from remote: _dnf_local                                                                                                                                    
error: Curl error (37): Couldn't read a file:// file for file:///var/lib/dnf/plugins/local/repodata/repomd.xml [Couldn't open file /var/lib/dnf/plugins/local/repodata/repomd
.xml] (file:///var/lib/dnf/plugins/local/repodata/repomd.xml).                                                                                                               
_dnf_local                                                                                                                                   0.0  B/s |   0  B     00:00     
Errors during downloading metadata for repository '_dnf_local':                                                                                                              
  - Curl error (37): Couldn't read a file:// file for file:///var/lib/dnf/plugins/local/repodata/repomd.xml [Couldn't open file /var/lib/dnf/plugins/local/repodata/repomd.xm
l]                                                                                                                                                                           
Error: Failed to download metadata for repo '_dnf_local': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried                            
repo: using cache for: fedora-cisco-openh264                                                                                                                                 
fedora-cisco-openh264: using metadata from Tue 25 Aug 2020 01:10:34 PM MDT.                                                                                                  
repo: using cache for: updates                                                                                                                                               
updates: using metadata from Fri 16 Apr 2021 08:22:28 AM MDT.                                                                                                                
repo: using cache for: fedora                                                                                                                                                
fedora: using metadata from Mon 19 Oct 2020 05:27:19 PM MDT.                                                                                                                 
Ignoring repositories: _dnf_local                                                                                                                                            
Last metadata expiration check: 0:15:32 ago on Fri 16 Apr 2021 08:35:09 PM MDT.

Comment 2 Chris Murphy 2021-04-18 18:33:37 UTC
These are installed:
createrepo_c-libs-0.16.1-1.fc33.x86_64
createrepo_c-0.16.1-1.fc33.x86_64

$ cat /etc/dnf/plugins/local.conf 
[main]
enabled = true
# Path to the local repository.
repodir = /srv/scratch/dnfrepodir/

$ sudo mkdir /srv/scratch/dnfrepodir/
$ sudo createrepo /srv/scratch/dnfrepodir/

Now the reported error message doesn't happen, and /srv/scratch/dnfrepodir/repodata/repomd.xml exists along with a bunch of sqlite.bz2 files. However, upon:

$ sudo dnf update --downloadonly

All the RPMs are still placed in /var/cache/dnf/updates-0e22a1f5a0a34771/packages/ rather than in /srv/scratch/dnfrepodir/

So I'm still not sure it's working as expected.

Comment 3 Chris Murphy 2021-04-19 06:21:32 UTC
User error. The primary issue is a misunderstanding. The rpms aren't copied to the repodir until after they've been successfully installed.