Bug 13038

Summary: [2.4.4RC1][Package Management][Getting Error Message "Failed to synchronize cache for repo 'repository'"]
Product: [Runtime] Package Management Issues Reporter: pankaj yadav <pankaj-y>
Component: package-management-issuesAssignee: Ross Burton <ross.burton>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: Undecided CC: meta.mr.watcher, meta.watcher, richard.purdie
Version: 2.4.5   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description pankaj yadav 2018-11-22 07:12:45 UTC
Steps to reproduce :
Step 1: Bitbake a core-image-minimal image with the current release of Yocto Project (rocko in this case), make sure the following variables are set in build/conf/local.conf.
PACKAGE_CLASSES = "package_rpm"
IMAGE_INSTALL_append = "dnf openssh"
MACHINE = "qemux86-64"
EXTRA_IMAGE_FEATURES = "debug-tweaks package-management"
Step 2: runqemu with the resulting image, make sure the tap device shows an ip. ssh from your laptop to the target.
Step 3: Setup your server so that it can service the packages to the target.
$ cd (TMPDIR)/deploy/rpm
python -m SimpleHTTPServer
Step 4: Configure the repositories on the target system by:
[For Rocko release] On target system, edit /etc/dnf/dnf.conf:
[main]
gpgcheck=0
[repository]
name=myrepo
baseurl=http://192.168.7.1:8000
enabled=1
installonly_limit=3
clean_requirements_on_remove=True
Step 5: fetch the repository on target:
$ dnf makecache

Please find result of step 5 :
root@qemux86-64:~# dnf makecache
Failed to synchronize cache for repo 'repository', disabling.
Metadata cache created.
root@qemux86-64:~#

Regression : 
Issue is reproducible with 2.4.3RC2
Comment 1 Ross Burton 2018-11-22 13:22:30 UTC
Did you run bitbake package-index?
Comment 2 pankaj yadav 2018-11-23 01:40:48 UTC
I have run bitbake package-index in step 8 as mentioned below :
Step 6: bitbake minicom on host.
Step 7: bitbake core-image-minimal 
Step 8: bitbake package-index
Step 9: Restart the SimpleHTTPServer
Step 10: fetch the repository and generate the update on target system.
$ dnf makecache
$ dnf update
$ dnf install minicom
Comment 3 Richard Purdie 2018-11-23 11:42:37 UTC
You need to run "bitbake package-index" before running the makecache command on target so this error isn't surprising.

Also, isn't this test automated? I'm not sure why we'd need to manually test this?
Comment 4 Ross Burton 2018-11-23 12:04:51 UTC
This should be automated with the selftest runtime_test.test_testimage_dnf.  Latest master run:

2018-11-22 00:24:35,992 - oe-selftest - INFO - RESULTS - runtime_test.TestImage.test_testimage_dnf - Testcase 1883: PASSED (539.97s)
Comment 5 pankaj yadav 2018-11-29 04:05:45 UTC
Running "bitbake package-index" before running the "dnf makecache" command on target, resolves this error.
Hence closing this ticket.