Bug 1779104

Summary: PackageKit: loading of MD_TYPE_PRIMARY has failed.
Product: [Fedora] Fedora Reporter: Dmitry Monakhov <monakhv>
Component: libdnfAssignee: amatej
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: 31CC: alciregi, amatej, andrew.awscli, claudionor.raymundo, colotunbabay2010, groobson, james, jfdefay, jmracek, jrohel, mad_fer_it, mblaha, pcfe, pkratoch, rpm-software-management, viraptor
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libdnf-0.54.2-1.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-18 15:49:01 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:
Attachments:
Description Flags
*.repo files
none
repomd for the failing cache
none
packagekit-direct output none

Description Dmitry Monakhov 2019-12-03 10:19:49 UTC
Description of problem:
PackageKit Daemon does not work.
I can update packages using dnf command. But can do the same using PackageKit.

Version-Release number of selected component (if applicable):
libdnf-0.37.2-2.fc31.x86_64
dnf-4.2.15-2.fc31.noarch
PackageKit-1.1.12-11.fc31.x86_64

How reproducible:
Always.

Steps to Reproduce:
1.pkcon -v refresh force

Fatal error: loading of MD_TYPE_PRIMARY has failed.

Actual results:
Fatal error: loading of MD_TYPE_PRIMARY has failed.


Expected results:

Update packages

Comment 1 Dmitry Monakhov 2019-12-09 12:04:48 UTC
Updated packages do not resolve the problem.

libdnf-0.39.1-1.fc31.x86_64
dnf-4.2.17-1.fc31.noarch

Comment 2 Daniel Mach 2019-12-16 12:27:35 UTC
*** Bug 1781047 has been marked as a duplicate of this bug. ***

Comment 3 Jaroslav Mracek 2020-01-16 15:32:46 UTC
Please are you able to update your system by dnf 'dnf upgrade --refresh' and still not able to use `pkcon -v refresh force`?

Please could you also provide output from `dnf repoinfo`?

I suggest that one of your repositories in /etc/yum.repos.d/ has incorrect metadata without primary data type. Can you disable some of repositories and try again  `pkcon -v refresh force`?

Disabling repository can be performed in .repo files in /etc/yum.repos.d/ by setting `enabled=False` and `enabled_metadata=False`.

Comment 4 Dmitry Monakhov 2020-01-24 07:02:20 UTC
'dnf upgrade --refresh' did not resolve the issue.

' dnf repolist' output:
repo id                                                                         repo name
fedora                                                                          Fedora 31 - x86_64
fedora-modular                                                                  Fedora Modular 31 - x86_64
rpmfusion-free                                                                  RPM Fusion for Fedora 31 - Free
rpmfusion-free-updates                                                          RPM Fusion for Fedora 31 - Free - Updates
rpmfusion-nonfree                                                               RPM Fusion for Fedora 31 - Nonfree
rpmfusion-nonfree-updates                                                       RPM Fusion for Fedora 31 - Nonfree - Updates
updates                                                                         Fedora 31 - x86_64 - Updates
updates-modular                                                                 Fedora Modular 31 - x86_64 - Updates



[root@monakhv ~]# dnf repoinfo
Last metadata expiration check: 0:18:16 ago on Fri 24 Jan 2020 09:42:47 AM MSK.

Repo-id            : fedora
Repo-name          : Fedora 31 - x86_64
Repo-revision      : 1571871168
Repo-updated       : Thu 24 Oct 2019 01:52:47 AM MSK
Repo-pkgs          : 56,361
Repo-available-pkgs: 55,860
Repo-size          : 71 G
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=fedora-31&arch=x86_64
  Updated          : Fri 24 Jan 2020 09:42:43 AM MSK
Repo-baseurl       : https://mirror.linux-ia64.org/fedora/linux/releases/31/Everything/x86_64/os/ (133 more)
Repo-expire        : 604,800 second(s) (last: Fri 24 Jan 2020 09:42:43 AM MSK)
Repo-filename      : /etc/yum.repos.d/fedora.repo

Repo-id            : fedora-modular
Repo-name          : Fedora Modular 31 - x86_64
Repo-revision      : 1571871190
Repo-updated       : Thu 24 Oct 2019 01:53:13 AM MSK
Repo-pkgs          : 2,403
Repo-available-pkgs: 546
Repo-size          : 2.3 G
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=fedora-modular-31&arch=x86_64
  Updated          : Fri 24 Jan 2020 09:42:42 AM MSK
Repo-baseurl       : http://mirror.linux-ia64.org/fedora/linux/releases/31/Modular/x86_64/os/ (134 more)
Repo-expire        : 172,800 second(s) (last: Fri 24 Jan 2020 09:42:42 AM MSK)
Repo-filename      : /etc/yum.repos.d/fedora-modular.repo

Repo-id            : rpmfusion-free
Repo-name          : RPM Fusion for Fedora 31 - Free
Repo-revision      : 1571739692
Repo-tags          : binary-x86_64
Repo-updated       : Tue 22 Oct 2019 01:21:36 PM MSK
Repo-pkgs          : 588
Repo-available-pkgs: 588
Repo-size          : 1.0 G
Repo-metalink      : https://mirrors.rpmfusion.org/metalink?repo=free-fedora-31&arch=x86_64
  Updated          : Fri 24 Jan 2020 09:42:46 AM MSK
Repo-baseurl       : http://mirror.yandex.ru/fedora/rpmfusion/free/fedora/releases/31/Everything/x86_64/os/ (52 more)
Repo-expire        : 1,209,600 second(s) (last: Fri 24 Jan 2020 09:42:46 AM MSK)
Repo-filename      : /etc/yum.repos.d/rpmfusion-free.repo

Repo-id            : rpmfusion-free-updates
Repo-name          : RPM Fusion for Fedora 31 - Free - Updates
Repo-revision      : 1579777826
Repo-tags          : binary-x86_64
Repo-updated       : Thu 23 Jan 2020 02:10:28 PM MSK
Repo-pkgs          : 188
Repo-available-pkgs: 188
Repo-size          : 556 M
Repo-metalink      : https://mirrors.rpmfusion.org/metalink?repo=free-fedora-updates-released-31&arch=x86_64
  Updated          : Fri 24 Jan 2020 09:42:45 AM MSK
Repo-baseurl       : ftp://mirror.yandex.ru/fedora/rpmfusion/free/fedora/updates/31/x86_64/ (50 more)
Repo-expire        : 172,800 second(s) (last: Fri 24 Jan 2020 09:42:45 AM MSK)
Repo-filename      : /etc/yum.repos.d/rpmfusion-free-updates.repo

Repo-id            : rpmfusion-nonfree
Repo-name          : RPM Fusion for Fedora 31 - Nonfree
Repo-revision      : 1571741026
Repo-tags          : binary-x86_64
Repo-updated       : Tue 22 Oct 2019 01:43:47 PM MSK
Repo-pkgs          : 218
Repo-available-pkgs: 218
Repo-size          : 1.1 G
Repo-metalink      : https://mirrors.rpmfusion.org/metalink?repo=nonfree-fedora-31&arch=x86_64
  Updated          : Fri 24 Jan 2020 09:42:47 AM MSK
Repo-baseurl       : ftp://mirror.yandex.ru/fedora/rpmfusion/nonfree/fedora/releases/31/Everything/x86_64/os/ (52 more)
Repo-expire        : 1,209,600 second(s) (last: Fri 24 Jan 2020 09:42:47 AM MSK)
Repo-filename      : /etc/yum.repos.d/rpmfusion-nonfree.repo

Repo-id            : rpmfusion-nonfree-updates
Repo-name          : RPM Fusion for Fedora 31 - Nonfree - Updates
Repo-revision      : 1579778942
Repo-tags          : binary-x86_64
Repo-updated       : Thu 23 Jan 2020 02:29:02 PM MSK
Repo-pkgs          : 65
Repo-available-pkgs: 65
Repo-size          : 420 M
Repo-metalink      : https://mirrors.rpmfusion.org/metalink?repo=nonfree-fedora-updates-released-31&arch=x86_64
  Updated          : Fri 24 Jan 2020 09:42:46 AM MSK
Repo-baseurl       : rsync://mirror.yandex.ru/fedora/rpmfusion/nonfree/fedora/updates/31/x86_64/ (50 more)
Repo-expire        : 172,800 second(s) (last: Fri 24 Jan 2020 09:42:46 AM MSK)
Repo-filename      : /etc/yum.repos.d/rpmfusion-nonfree-updates.repo

Repo-id            : updates
Repo-name          : Fedora 31 - x86_64 - Updates
Repo-revision      : 1579567009
Repo-updated       : Tue 21 Jan 2020 04:02:46 AM MSK
Repo-pkgs          : 15,972
Repo-available-pkgs: 15,896
Repo-size          : 25 G
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=updates-released-f31&arch=x86_64
  Updated          : Fri 24 Jan 2020 09:42:43 AM MSK
Repo-baseurl       : rsync://mirror.yandex.ru/fedora/linux/updates/31/Everything/x86_64/ (110 more)
Repo-expire        : 21,600 second(s) (last: Fri 24 Jan 2020 09:42:43 AM MSK)
Repo-filename      : /etc/yum.repos.d/fedora-updates.repo

Repo-id            : updates-modular
Repo-name          : Fedora Modular 31 - x86_64 - Updates
Repo-revision      : 1579657876
Repo-updated       : Wed 22 Jan 2020 04:52:50 AM MSK
Repo-pkgs          : 2,454
Repo-available-pkgs: 506
Repo-size          : 2.4 G
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=updates-released-modular-f31&arch=x86_64
  Updated          : Fri 24 Jan 2020 09:42:42 AM MSK
Repo-baseurl       : http://mirror.linux-ia64.org/fedora/linux/updates/31/Modular/x86_64/ (135 more)
Repo-expire        : 21,600 second(s) (last: Fri 24 Jan 2020 09:42:42 AM MSK)
Repo-filename      : /etc/yum.repos.d/fedora-updates-modular.repo
Total packages: 78,249

Comment 5 Jaroslav Mracek 2020-01-27 09:25:46 UTC
> 'dnf upgrade --refresh' did not resolve the issue.

Please what does it mean?
'dnf upgrade --refresh' crash by the same way, or dnf perform well but it doesn't resolve the issue with PackageKit? Or something else?


Please could you also investigate /var/cache/PackageKit/31/metadata/<repositories_id>repodata/repomd.xml?


I suggest that one of repomd.xml files has no <data type="primary"> informations.

Please could you confirm my suggestion?

Comment 6 Dmitry Monakhov 2020-01-27 11:54:05 UTC
(In reply to Jaroslav Mracek from comment #5)
> > 'dnf upgrade --refresh' did not resolve the issue.
> 
> Please what does it mean?
> 'dnf upgrade --refresh' crash by the same way, or dnf perform well but it
> doesn't resolve the issue with PackageKit? Or something else?


`dnf upgrade --refresh ` works very well without any problem!
However it does not change the result of 'pkcon -v refresh force'

> 
> 
> Please could you also investigate
> /var/cache/PackageKit/31/metadata/<repositories_id>repodata/repomd.xml?
> 
> 
> I suggest that one of repomd.xml files has no <data type="primary">
> informations.
> 
> Please could you confirm my suggestion?

I can not confirm it.
Please find below my investigation.

read all file "repomd.xml" into variable rep
[root@monakhv metadata]# cd /var/cache/PackageKit/31/metadata
[root@monakhv metadata]# rep=`find . -name  "repomd.xml" `

Find all primary words into the files 
[root@monakhv metadata]# for r in $rep ; do echo $r;  grep  primary $r ; echo ; done
./fedora-31-x86_64/repodata/repomd.xml
  <data type="primary">
    <location href="repodata/87aea7fb189357f558fad367a3882383cb8804a6e666b2ad655b4321a75069f7-primary.xml.gz"/>
  <data type="primary_db">
    <location href="repodata/c88adc42550adc4c8481edd0b5aa73904e8a189cc93bb9867a3319fe8753ee4e-primary.sqlite.xz"/>
  <data type="primary_zck">
    <location href="repodata/5dd866cf6ce0e21f428b6c5bf4eabee65719b72c8cc279393125e79b34fdae31-primary.xml.zck"/>

./google-chrome-31-x86_64/repodata/repomd.xml
<data type="primary">
  <location href="repodata/primary.xml.gz"/>

./fedora-modular-31-x86_64/repodata/repomd.xml
  <data type="primary">
    <location href="repodata/b3741575ff87ae2b55d7ff60555bfd1f3caf6e044c950c91a9ea0ef057833815-primary.xml.gz"/>
  <data type="primary_db">
    <location href="repodata/fe1351897687dbf27584d40f0bf7e9aed8f015b3bc07de2d178d9c14cb06f29a-primary.sqlite.xz"/>
  <data type="primary_zck">
    <location href="repodata/585e6b410ed840737587803da3c61d8e7276bda225b6facc1ed0a6cc5603cf08-primary.xml.zck"/>

./fedora-cisco-openh264-31-x86_64/repodata/repomd.xml
  <data type="primary">
    <location href="repodata/3dada59a0fc1e0a339ea1545f1453d1446943cb7d5e7dd39ad55bc7e6f1eb0e8-primary.xml.gz"/>
  <data type="primary_db">
    <location href="repodata/c1f02bc908eb52044c99ee49eadde0121a7ba4b9daf49e508787e6561a8522fa-primary.sqlite.xz"/>

./updates-31-x86_64/repodata/repomd.xml
  <data type="primary">
    <location href="repodata/27dacb15ac9cd8baa1e76f72aac4f5359c6a1695036dfba771ef25bd902f3e6c-primary.xml.gz"/>
  <data type="primary_db">
    <location href="repodata/5dcf6729dd4cc7ebd0cb8167409e20caaec610dcc5cf5f9ee48dd13056cec424-primary.sqlite.bz2"/>
  <data type="primary_zck">
    <location href="repodata/1d7e510a3182fcfe07800671cd194b48e59c1c5c09eeba306e1f945f4e5a1086-primary.xml.zck"/>

./rpmfusion-free-31-x86_64/repodata/repomd.xml
<data type="primary">
  <location href="repodata/7d359ca7a4d66290fc5767ca4f11ec65514cce7cf7582ee568f79e8215145620-primary.xml.gz"/>
<data type="primary_db">
  <location href="repodata/a0a65432f9fd3b06910e1fc96d355b8be20d383fbde76b2f94fd73b8ba480029-primary.sqlite.xz"/>

./adobe-linux-x86_64-31-x86_64/repodata/repomd.xml
<data type="primary">
  <location href="repodata/76f5b750f952ea4b3f085f2b7e1b230c14c97f7abc7d5c5e8b6242a3cd2f6d00-primary.xml.gz"/>
<data type="primary_db">
  <location href="repodata/ed08e6da79b615805e06c77e64f621c80fb84a71429c6849a4ee16fae092ae68-primary.sqlite.bz2"/>

./rpmfusion-nonfree-updates-31-x86_64/repodata/repomd.xml
<data type="primary">
  <location href="repodata/0a5dec96614c424b608f3dd08d80e89dfd9729b1ac03885c6e0eec1f3beaa884-primary.xml.gz"/>
<data type="primary_db">
  <location href="repodata/2c9647cf0da4c17d0ded6c654e5704a881a87155abefd7692786e9a8a3a1293d-primary.sqlite.xz"/>

./rpmfusion-nonfree-31-x86_64/repodata/repomd.xml
<data type="primary">
  <location href="repodata/feb74872025056442b66aca1575f40f12a3b196abf42ca5f7bdd1d2d7b9d3ed9-primary.xml.gz"/>
<data type="primary_db">
  <location href="repodata/22875713b3ad3222311266be202889e0f1b16412e40f49129db776abf9ee9581-primary.sqlite.xz"/>

./rpmfusion-free-updates-31-x86_64/repodata/repomd.xml
<data type="primary">
  <location href="repodata/f00e4bee46c7963980106044b495f1e6c6595485566df436fde46caabc3d18fa-primary.xml.gz"/>
<data type="primary_db">
  <location href="repodata/ba20f2558132c1d20110cf22d580073d703ccf41767ef13a36e396a176af67a9-primary.sqlite.xz"/>

./updates-modular-31-x86_64/repodata/repomd.xml
  <data type="primary">
    <location href="repodata/3c63a0d4989ee05246733561e2fe2c2b356e72e0414302a97ac768b52f70a2e9-primary.xml.gz"/>
  <data type="primary_zck">
    <location href="repodata/eb6181e5ba66613c8d179b6dc133a8d84f776305f586f1fd3b51c9edb66672d0-primary.xml.zck"/>

Comment 7 Jaroslav Mracek 2020-01-30 10:33:00 UTC
Thank you very much for data.

The data provided looks fine.

I can also suggest that file described in data type="primary" is not available or corrupted. (corrupted cache)


DNF and pkcon uses same configuration in /etc/yum.repos.d/ but their code that handles caching differs.

But pkcon shares more code with microdnf.

Could you also try as a root:
dnf install microdnf
microdnf install acpi   # acpi is a simple file that can be then removed by 'dnf remove acpi'. Please could you also provide an output . Thanks

If microdnf works fine () please try remove PackageKit cache as a root and then reboot.
sudo rm /var/cache/PackageKit/* -rf
reboot


If pkcon will work after reboot the cache was somehow corrupted.

Comment 8 Dmitry Monakhov 2020-01-31 14:13:53 UTC
'microdnf install acpi ' produces the same error as `pkcon -v refresh force`

sudo rm /var/cache/PackageKit/* -rf
does not resolve the issue

Comment 9 Jaroslav Mracek 2020-02-04 11:08:01 UTC
May I ask you for complete output from 'microdnf install acpi'?

Please could you provide all files from "/etc/yum.repos.d/*.repo"?

Thanks a lot.

Comment 10 Dmitry Monakhov 2020-02-05 06:50:46 UTC
This is microdnf output.

[root@monakhv ~]# export LANG=C
[root@monakhv ~]# microdnf install acpi
Downloading metadata...
error: loading of MD_TYPE_PRIMARY has failed.
[root@monakhv ~]# 


Repo files are into attachement.

Comment 11 Dmitry Monakhov 2020-02-05 06:51:52 UTC
Created attachment 1657751 [details]
*.repo files

Comment 12 viraptor@gmail.com 2020-02-13 05:44:56 UTC
Same issue here, and I patched libdnf to return the id of the repo along with the error. Got: "Fatal error: loading of MD_TYPE_PRIMARY has failed in updates-modular."

I'll attach the repomd file for that repo.

Comment 13 viraptor@gmail.com 2020-02-13 05:45:54 UTC
Created attachment 1662873 [details]
repomd for the failing cache

Comment 14 viraptor@gmail.com 2020-02-13 06:40:14 UTC
The primary is indeed ignored, even though it's present in the file. After putting in some debug prints in Repo::Impl::getMetadataPath:

    for(auto it = metadataPaths.begin(); it != metadataPaths.end(); ++it) {
        std::cout << "path to check in " << conf->name().getValue() << ": " << it->first << ", " << it->second << std::endl;
    }

I get:

Failing repo - only has primary_zck:

Feb 13 17:31:39 chai packagekitd[61929]: path to check in updates-modular: filelists_zck, /var/cache/PackageKit/31/metadata/updates-modular-31-x86_64/repodata/88cdb1f0f4cb3d3fe1e911acf3a6ea1610da7bc31489891d93c6f8f2b6677949-f>
Feb 13 17:31:39 chai packagekitd[61929]: path to check in updates-modular: modules, /var/cache/PackageKit/31/metadata/updates-modular-31-x86_64/repodata/6f75cd36f69e3afbda0d3c9fc54d7924ee9600da8531bd4bee8af21432dec80d-modules>
Feb 13 17:31:39 chai packagekitd[61929]: path to check in updates-modular: primary_zck, /var/cache/PackageKit/31/metadata/updates-modular-31-x86_64/repodata/006f661f0a6b0a0ca82ff365918143c1a64ef102e920c55841a192b113b6580f-pri>
Feb 13 17:31:39 chai packagekitd[61929]: path to check in updates-modular: updateinfo_zck, /var/cache/PackageKit/31/metadata/updates-modular-31-x86_64/repodata/cfa5880d0b3ec1ae7f6841de07760d702a72733680acbf0e8c13bdd06721accf->
Feb 13 17:31:39 chai packagekitd[61929]: path to check in updates-modular: filelists_zck, /var/cache/PackageKit/31/metadata/updates-modular-31-x86_64/repodata/88cdb1f0f4cb3d3fe1e911acf3a6ea1610da7bc31489891d93c6f8f2b6677949-f>
Feb 13 17:31:39 chai packagekitd[61929]: path to check in updates-modular: modules, /var/cache/PackageKit/31/metadata/updates-modular-31-x86_64/repodata/6f75cd36f69e3afbda0d3c9fc54d7924ee9600da8531bd4bee8af21432dec80d-modules>
Feb 13 17:31:39 chai packagekitd[61929]: path to check in updates-modular: primary_zck, /var/cache/PackageKit/31/metadata/updates-modular-31-x86_64/repodata/006f661f0a6b0a0ca82ff365918143c1a64ef102e920c55841a192b113b6580f-pri>
Feb 13 17:31:39 chai packagekitd[61929]: path to check in updates-modular: updateinfo_zck, /var/cache/PackageKit/31/metadata/updates-modular-31-x86_64/repodata/cfa5880d0b3ec1ae7f6841de07760d702a72733680acbf0e8c13bdd06721accf->

Ok repo - has primary:

Feb 13 17:31:41 chai packagekitd[61929]: path to check in rpmfusion-nonfree: filelists, /var/cache/PackageKit/31/metadata/rpmfusion-nonfree-31-x86_64/repodata/d84faec2cf344cf150470e79845a2408db81099fb0087794e77edc59b9479371-f>
Feb 13 17:31:41 chai packagekitd[61929]: path to check in rpmfusion-nonfree: group, /var/cache/PackageKit/31/metadata/rpmfusion-nonfree-31-x86_64/repodata/025b28992f4b94e17e5c062c4ba5fe35e64abdb01849193547fe081f86a7b549-comps>
Feb 13 17:31:41 chai packagekitd[61929]: path to check in rpmfusion-nonfree: primary, /var/cache/PackageKit/31/metadata/rpmfusion-nonfree-31-x86_64/repodata/feb74872025056442b66aca1575f40f12a3b196abf42ca5f7bdd1d2d7b9d3ed9-pri>
Feb 13 17:31:41 chai packagekitd[61929]: path to check in rpmfusion-nonfree: filelists, /var/cache/PackageKit/31/metadata/rpmfusion-nonfree-31-x86_64/repodata/d84faec2cf344cf150470e79845a2408db81099fb0087794e77edc59b9479371-f>
Feb 13 17:31:41 chai packagekitd[61929]: path to check in rpmfusion-nonfree: group, /var/cache/PackageKit/31/metadata/rpmfusion-nonfree-31-x86_64/repodata/025b28992f4b94e17e5c062c4ba5fe35e64abdb01849193547fe081f86a7b549-comps>
Feb 13 17:31:41 chai packagekitd[61929]: path to check in rpmfusion-nonfree: primary, /var/cache/PackageKit/31/metadata/rpmfusion-nonfree-31-x86_64/repodata/feb74872025056442b66aca1575f40f12a3b196abf42ca5f7bdd1d2d7b9d3ed9-pri>

As visible in the repomd.xml for updates-modular, I've got both entries available:

  <data type="primary">
    <checksum type="sha256">937e2d51a42615a106ee413287cd6d50db64c846e3590f440b844cbf162c058c</checksum>
    <open-checksum type="sha256">fe74799dfcacf9926e111e85994687f1a7d841e01dce6e10b68c6dd69ebfef49</open-checksum>
    <location href="repodata/937e2d51a42615a106ee413287cd6d50db64c846e3590f440b844cbf162c058c-primary.xml.gz"/>
    <timestamp>1581299858</timestamp>
    <size>554532</size>
    <open-size>6951957</open-size>
  </data>
  ...
  <data type="primary_zck">
    <checksum type="sha256">006f661f0a6b0a0ca82ff365918143c1a64ef102e920c55841a192b113b6580f</checksum>
    <open-checksum type="sha256">fe74799dfcacf9926e111e85994687f1a7d841e01dce6e10b68c6dd69ebfef49</open-checksum>
    <header-checksum type="sha256">6255cb1aa33c773e04174be647208349348fb18d6cfe0f75cb51f123eb5bbebe</header-checksum>
    <location href="repodata/006f661f0a6b0a0ca82ff365918143c1a64ef102e920c55841a192b113b6580f-primary.xml.zck"/>
    <timestamp>1581299858</timestamp>
    <size>1059137</size>
    <open-size>6951957</open-size>
    <header-size>48833</header-size>
  </data>

But the -primary.xml.gz file does not actually exist:

$ ls -1 /var/cache/PackageKit/31/metadata/updates-modular-31-x86_64/repodata/
006f661f0a6b0a0ca82ff365918143c1a64ef102e920c55841a192b113b6580f-primary.xml.zck
6f75cd36f69e3afbda0d3c9fc54d7924ee9600da8531bd4bee8af21432dec80d-modules.yaml.gz
88cdb1f0f4cb3d3fe1e911acf3a6ea1610da7bc31489891d93c6f8f2b6677949-filelists.xml.zck
cfa5880d0b3ec1ae7f6841de07760d702a72733680acbf0e8c13bdd06721accf-updateinfo.xml.zck
repomd.xml

I'm debugging this pretty much blind, so if I should look at anything else instead, please let me know.

Comment 15 viraptor@gmail.com 2020-02-13 07:00:29 UTC
Seems like packagekitd forces the zchunk off somewhere. If I replace the zchunk check at https://github.com/rpm-software-management/libdnf/blob/0.43.1/libdnf/repo/Repo.cpp#L202 with "if (true) {" things "just work" again. As far as I can tell, the updates-modular repo was checked just fine and the updates were installed afterwards.

Comment 16 groobson 2020-03-30 11:21:40 UTC
Hi,
I was facing the same problem with pkcon for about 8 months.

Finally I resolved it by commenting out 'zchunk=False' from both:
/etc/yum.conf
/etc/dnf/dnf.conf

Then I did 'pkcon -v refresh force' and everything is ok now.

Comment 17 247 2020-06-07 09:08:04 UTC
hi everybody, i'm following this because i'm having the same exact problem, plus the fact that gnome software is not working anymore due to this and zchunk=False did not help me...

Comment 18 James McDonald 2020-06-11 06:21:10 UTC
Not sure I should post this here as I'm seeing this on Fedora 32

I am getting "Fatal error: loading of MD_TYPE_PRIMARY has failed."

sudo dnf update --refresh
Dropbox Repository                              5.4 kB/s | 2.9 kB     00:00    
Fedora 32 openh264 (From Cisco) - x86_64        1.1 kB/s | 986  B     00:00    
Fedora Modular 32 - x86_64                      4.2 kB/s | 3.6 kB     00:00    
Fedora Modular 32 - x86_64 - Updates            3.3 kB/s | 3.0 kB     00:00    
Fedora 32 - x86_64 - Updates                    4.0 kB/s | 3.6 kB     00:00    
Fedora 32 - x86_64                              3.7 kB/s | 3.6 kB     00:00    
google-chrome                                   6.1 kB/s | 1.3 kB     00:00    
insync repo                                     4.4 kB/s | 2.9 kB     00:00    
MySQL 8.0 Community Server                       73 kB/s | 2.5 kB     00:00    
MySQL Connectors Community                       61 kB/s | 2.5 kB     00:00    
MySQL Tools Community                            65 kB/s | 2.5 kB     00:00    
Visual Studio Code                              5.8 kB/s | 3.0 kB     00:00    
Dependencies resolved.
Nothing to do.
Complete!

But I need to have zchunk=False added to /etc/dnf/dnf.conf other wise I get

sudo dnf update --refresh
Dropbox Repository                              5.2 kB/s | 2.9 kB     00:00    
Fedora 32 openh264 (From Cisco) - x86_64        1.0 kB/s | 986  B     00:00    
Fedora Modular 32 - x86_64                      2.2 MB/s | 4.9 MB     00:02    
Fedora Modular 32 - x86_64 - Updates            112 kB/s | 153 kB     00:01    
Errors during downloading metadata for repository 'updates-modular':
  - Curl error (23): Failed writing received data to disk/application for http://ftp.iinet.net.au/pub/fedora/linux/updates/32/Modular/x86_64/repodata/66dbb91529aa0aadc449337de261491614cc0027f0fa84e52e8cd6c31acb2143-filelists.xml.zck [Failed writing body (0 != 249)]
  - Curl error (23): Failed writing received data to disk/application for http://ftp.iinet.net.au/pub/fedora/linux/updates/32/Modular/x86_64/repodata/46b2ce94f20b0cbb3835f2660ace68099822d9d54470d0f8132c381031c45e8d-primary.xml.zck [Failed writing body (0 != 249)]
Error: Failed to download metadata for repo 'updates-modular': Yum repo downloading error: Downloading error(s): repodata/46b2ce94f20b0cbb3835f2660ace68099822d9d54470d0f8132c381031c45e8d-primary.xml.zck - Download failed: Curl error (23): Failed writing received data to disk/application for http://ftp.iinet.net.au/pub/fedora/linux/updates/32/Modular/x86_64/repodata/46b2ce94f20b0cbb3835f2660ace68099822d9d54470d0f8132c381031c45e8d-primary.xml.zck [Failed writing body (0 != 249)]; repodata/66dbb91529aa0aadc449337de261491614cc0027f0fa84e52e8cd6c31acb2143-filelists.xml.zck - Download failed: Curl error (23): Failed writing received data to disk/application for http://ftp.iinet.net.au/pub/fedora/linux/updates/32/Modular/x86_64/repodata/66dbb91529aa0aadc449337de261491614cc0027f0fa84e52e8cd6c31acb2143-filelists.xml.zck [Failed writing body (0 != 249)]

With or without zchunk=False and pkcon I get

sudo pkcon -v refresh force
16:12:33	PackageKit          Verbose debugging enabled (on console 1)
16:12:33	PackageKit          filter=(null), filters=0
16:12:33	PackageKit          adding state 0x55da221a7ca0
16:12:33	PackageKit          role now refresh-cache
Refreshing cache              [                         ] (0%)  16:12:33	PackageKit          notify::connected
                              [=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Querying                      [=========================]         
Finished                      [                         ] (0%)  16:13:15	PackageKit          remove state 0x55da221a7ca0
                              [=========================]         
Fatal error: loading of MD_TYPE_PRIMARY has failed.

Also of note is when I put an incorrect command into my terminal i get

[jm@tgn-ws01-tgn-home restore]$ jkd
bash: jkd: command not found...
Failed to search for file: loading of MD_TYPE_PRIMARY has failed.

These are the repositories I'm using

dnf repoinfo 
Fedora Modular 32 - x86_64 - Updates            3.5 kB/s | 3.0 kB     00:00    
Fedora 32 - x86_64 - Updates                    4.1 kB/s | 3.6 kB     00:00    
insync repo                                     2.9 kB/s | 2.9 kB     00:01    
Repo-id            : Dropbox
Repo-name          : Dropbox Repository
Repo-revision      : 1583364791
Repo-updated       : Thu 05 Mar 2020 10:33:11
Repo-pkgs          : 4
Repo-available-pkgs: 4
Repo-size          : 279 k
Repo-baseurl       : http://linux.dropbox.com/fedora/31/
Repo-expire        : 172,800 second(s) (last: Wed 10 Jun 2020 10:30:05)
Repo-filename      : /etc/yum.repos.d/dropbox.repo

Repo-id            : code
Repo-name          : Visual Studio Code
Repo-revision      : 1591727924
Repo-updated       : Wed 10 Jun 2020 04:38:44
Repo-pkgs          : 255
Repo-available-pkgs: 255
Repo-size          : 20 G
Repo-baseurl       : https://packages.microsoft.com/yumrepos/vscode
Repo-expire        : 172,800 second(s) (last: Wed 10 Jun 2020 10:30:42)
Repo-filename      : /etc/yum.repos.d/vscode.repo

Repo-id            : fedora
Repo-name          : Fedora 32 - x86_64
Repo-revision      : 1587594156
Repo-updated       : Thu 23 Apr 2020 08:22:36
Repo-pkgs          : 55,327
Repo-available-pkgs: 55,327
Repo-size          : 73 G
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=fedora-32&arch=x86_64
  Updated          : Wed 10 Jun 2020 10:30:22
Repo-baseurl       : rsync://ftp.iinet.net.au/redhat-fedora/releases/32/Everything/x86_64/os/
                   : (16 more)
Repo-expire        : 604,800 second(s) (last: Wed 10 Jun 2020 10:30:22)
Repo-filename      : /etc/yum.repos.d/fedora.repo

Repo-id            : fedora-cisco-openh264
Repo-name          : Fedora 32 openh264 (From Cisco) - x86_64
Repo-revision      : 1584475845
Repo-updated       : Wed 18 Mar 2020 07:10:45
Repo-pkgs          : 8
Repo-available-pkgs: 8
Repo-size          : 1.8 M
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=fedora-cisco-openh264-32&arch=x86_64
  Updated          : Wed 10 Jun 2020 10:30:06
Repo-baseurl       : https://codecs.fedoraproject.org/openh264/32/x86_64/ (0
                   : more)
Repo-expire        : 1,209,600 second(s) (last: Wed 10 Jun 2020 10:30:06)
Repo-filename      : /etc/yum.repos.d/fedora-cisco-openh264.repo

Repo-id            : fedora-modular
Repo-name          : Fedora Modular 32 - x86_64
Repo-revision      : 1587589390
Repo-updated       : Thu 23 Apr 2020 07:03:13
Repo-pkgs          : 2,407
Repo-available-pkgs: 0
Repo-size          : 2.7 G
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=fedora-modular-32&arch=x86_64
  Updated          : Wed 10 Jun 2020 10:30:08
Repo-baseurl       : rsync://ftp.iinet.net.au/redhat-fedora/releases/32/Modular/x86_64/os/
                   : (16 more)
Repo-expire        : 172,800 second(s) (last: Wed 10 Jun 2020 10:30:08)
Repo-filename      : /etc/yum.repos.d/fedora-modular.repo

Repo-id            : google-chrome
Repo-name          : google-chrome
Repo-revision      : 1591378205
Repo-updated       : Sat 06 Jun 2020 03:30:06
Repo-pkgs          : 3
Repo-available-pkgs: 3
Repo-size          : 198 M
Repo-baseurl       : http://dl.google.com/linux/chrome/rpm/stable/x86_64
Repo-expire        : 172,800 second(s) (last: Wed 10 Jun 2020 10:30:23)
Repo-filename      : /etc/yum.repos.d/google-chrome.repo

Repo-id            : insync
Repo-name          : insync repo
Repo-revision      : 1591161380
Repo-updated       : Wed 03 Jun 2020 15:16:21
Repo-pkgs          : 12
Repo-available-pkgs: 12
Repo-size          : 935 M
Repo-baseurl       : http://yum.insync.io/fedora/32/
Repo-expire        : 7,200 second(s) (last: Thu 01 Jan 1970 10:00:00)
Repo-filename      : /etc/yum.repos.d/insync.repo

Repo-id            : mysql-connectors-community
Repo-name          : MySQL Connectors Community
Repo-revision      : 1587877234
Repo-updated       : Sun 26 Apr 2020 15:00:36
Repo-pkgs          : 14
Repo-available-pkgs: 14
Repo-size          : 39 M
Repo-baseurl       : http://repo.mysql.com/yum/mysql-connectors-community/fc/32/x86_64/
Repo-expire        : 172,800 second(s) (last: Wed 10 Jun 2020 10:30:39)
Repo-filename      : /etc/yum.repos.d/mysql-community.repo

Repo-id            : mysql-tools-community
Repo-name          : MySQL Tools Community
Repo-revision      : 1587722434
Repo-updated       : Fri 24 Apr 2020 20:00:36
Repo-pkgs          : 7
Repo-available-pkgs: 7
Repo-size          : 264 M
Repo-baseurl       : http://repo.mysql.com/yum/mysql-tools-community/fc/32/x86_64/
Repo-expire        : 172,800 second(s) (last: Wed 10 Jun 2020 10:30:39)
Repo-filename      : /etc/yum.repos.d/mysql-community.repo

Repo-id            : mysql80-community
Repo-name          : MySQL 8.0 Community Server
Repo-revision      : 1587879626
Repo-updated       : Sun 26 Apr 2020 15:40:34
Repo-pkgs          : 17
Repo-available-pkgs: 17
Repo-size          : 607 M
Repo-baseurl       : http://repo.mysql.com/yum/mysql-8.0-community/fc/32/x86_64/
Repo-expire        : 172,800 second(s) (last: Wed 10 Jun 2020 10:30:39)
Repo-filename      : /etc/yum.repos.d/mysql-community.repo

Repo-id            : updates
Repo-name          : Fedora 32 - x86_64 - Updates
Repo-revision      : 1591553208
Repo-updated       : Mon 08 Jun 2020 04:20:54
Repo-pkgs          : 8,041
Repo-available-pkgs: 8,041
Repo-size          : 17 G
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=updates-released-f32&arch=x86_64
  Updated          : Thu 01 Jan 1970 10:00:00
Repo-baseurl       : http://ftp.iinet.net.au/pub/fedora/linux/updates/32/Everything/x86_64/
                   : (13 more)
Repo-expire        : 21,600 second(s) (last: Thu 01 Jan 1970 10:00:00)
Repo-filename      : /etc/yum.repos.d/fedora-updates.repo

Repo-id            : updates-modular
Repo-name          : Fedora Modular 32 - x86_64 - Updates
Repo-revision      : 1591329863
Repo-updated       : Fri 05 Jun 2020 14:14:06
Repo-pkgs          : 2,411
Repo-available-pkgs: 0
Repo-size          : 2.7 G
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=updates-released-modular-f32&arch=x86_64
  Updated          : Thu 01 Jan 1970 10:00:00
Repo-baseurl       : http://ftp.iinet.net.au/pub/fedora/linux/updates/32/Modular/x86_64/
                   : (13 more)
Repo-expire        : 21,600 second(s) (last: Thu 01 Jan 1970 10:00:00)
Repo-filename      : /etc/yum.repos.d/fedora-updates-modular.repo
Total packages: 68,506

Comment 19 247 2020-06-11 14:17:53 UTC
I'm on f32 too, but unfortunately the zchunk false did not solve my error...

Comment 20 James McDonald 2020-06-11 23:30:17 UTC
(In reply to 247 from comment #19)
> I'm on f32 too, but unfortunately the zchunk false did not solve my error...

Yes I think there are two different issues. 

One is the curl error issue work-a-round using zchunk=False

and the other is the "Fatal error: loading of MD_TYPE_PRIMARY has failed." issue

Comment 21 247 2020-06-14 10:06:33 UTC
yes, one is a zchunk error, and at least in my case is due to the fact, i have some proxy in my connection set by my provider (i use a 4g network) that zchunk can't handle, and it's solved by zchunk=False
the other one (the md type primary, is completely another issue that seems to affect packagekit

by the way, i even discovered that now gnome software can't install rpms anymore due to unsupported format, been thining about doing a fresh install if none solves the issue...

Comment 22 Dmitry Monakhov 2020-06-17 06:28:55 UTC
Upgrade to f32 do not resolve the issue.

Comment 23 247 2020-06-18 11:51:10 UTC
so, i have opened a thread on ask fedora and someone over there is kindly trying to help me, in regard to this problem, we've done lot of tests and maybe the results of packagekit-direct will be interesting to read for someone more experienced on here, so i'll attach the file here...

Comment 24 247 2020-06-18 11:51:39 UTC
Created attachment 1697948 [details]
packagekit-direct output

Comment 25 Alessio 2020-06-19 14:48:24 UTC
Hello.
I performed some test.
All works when I'm connected to the internet using the ADSL or other networks.
If I use my mobile phone using USB tethering, I am able to reproduce this issue.

I have a fully updated Fedora 32 installation.
If I issue pkcon -v refresh force, using the mobile line I get
Fatal error: loading of MD_TYPE_PRIMARY has failed.

If I issue pkcon -v refresh force, using the ADSL line it works.

Comment 26 Alessio 2020-06-20 15:14:05 UTC
Hello again. It could look totally random, but.
Using the mobile connection, issuing pkcon -v refresh force, I always get an error related to the fedora repository or to the fedora-updates one.

The error sometimes is 
"Fatal error: loading of MD_TYPE_PRIMARY has failed." 
And sometimes it is 
"Fatal error: cannot update repo 'fedora': Yum repo downloading error: Downloading error(s): repodata/b7e1566c87075299c4a199737b341e7d15fbf1a4d49c4c2cbe43368437b02c47-comps-Everything.x86_64.xml.zck - Download failed: Curl error (23): Failed writing received data to disk/application for http://fedora.mirror.garr.it/fedora/linux/releases/32/Everything/x86_64/os/repodata/b7e1566c87075299c4a199737b341e7d15fbf1a4d49c4c2cbe43368437b02c47-comps-Everything.x86_64.xml.zck [Failed writing body (0 != 1388)]; Last error: Curl error (23): Failed writing received data to disk/application for http://fedora.mirror.garr.it/fedora/linux/releases/32/Everything/x86_64/os/repodata/b7e1566c87075299c4a199737b341e7d15fbf1a4d49c4c2cbe43368437b02c47-comps-Everything.x86_64.xml.zck [Failed writing body (0 != 1388)]"

This happens if, in the /etc/yum.repos.d/fedora.repo file (and in the fedora-updates.repo one, with the proper url) I use 
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
or
baseurl=http://fedora.mirror.garr.it/fedora/linux/releases/$releasever/Everything/$basearch/os/

But if I use 
baseurl=https://dl.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
then I don't get any error.

Isn't it weird?

Comment 27 247 2020-06-23 11:23:20 UTC
yes it is, especially considering this does not work for me

anyway i clearly can say this is a regression, cause i did not have this problem till about one month ago...

Comment 28 Alessio 2020-06-23 16:52:08 UTC
I don't know if it is a regression in the packages. Because installing the packages in the fedora repository (downgrading them), the behaviour is the same for me.
libdnf-0.45.0-3.fc32.x86_64
PackageKit-1.1.13-2.fc32.x86_64

Comment 29 Alessio 2020-06-24 06:46:50 UTC
I have another observation.
As said, if I use the mobile connection and in the fedora.repo file I put 
baseurl=http://fedora.mirror.garr.it/fedora/linux/releases/$releasever/Everything/$basearch/os/
I can hit this issue.
But, if I use the same mirror, but using https, it works...
I tried multiple times.

Comment 30 Alessio 2020-06-29 12:44:19 UTC
I built the libdnf package with WITH_ZCHUNK=OFF in the spec file.
Obviously the .zck files are not downloaded when refreshing the repository; and all works as expected.

So the point is: why packagekit (or libdnf or whatever) continue to dowload the zck files even if the zchunk=False is set in dnf.conf?

Please have a look to BZ#1830512 too.

Comment 31 Alessio 2020-06-29 12:47:05 UTC
> Please have a look to BZ#1830512 too.

And expecially to BZ#1851841

Comment 32 amatej 2020-07-14 15:59:33 UTC
Here is a PR that should fix this issue: https://github.com/rpm-software-management/libdnf/pull/998
And tests: https://github.com/rpm-software-management/ci-dnf-stack/pull/864

The code mentions microdnf instead of packagekit but they use libdnf in the same way so the fix applies to both.

Comment 33 Fedora Update System 2020-10-08 11:59:01 UTC
FEDORA-2020-b40fc174b5 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-b40fc174b5

Comment 34 Fedora Update System 2020-10-08 12:00:01 UTC
FEDORA-2020-5d9f0ce2b3 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-5d9f0ce2b3

Comment 35 Fedora Update System 2020-10-08 22:19:32 UTC
FEDORA-2020-b40fc174b5 has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-b40fc174b5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b40fc174b5

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

Comment 36 Fedora Update System 2020-10-12 21:15:38 UTC
FEDORA-2020-b40fc174b5 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-b40fc174b5

Comment 37 Fedora Update System 2020-10-12 21:23:15 UTC
FEDORA-2020-5d9f0ce2b3 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-5d9f0ce2b3

Comment 38 Fedora Update System 2020-10-12 22:45:03 UTC
FEDORA-2020-b40fc174b5 has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-b40fc174b5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b40fc174b5

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

Comment 39 Fedora Update System 2020-10-13 20:17:59 UTC
FEDORA-2020-5d9f0ce2b3 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-5d9f0ce2b3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-5d9f0ce2b3

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

Comment 40 Fedora Update System 2020-10-18 15:49:01 UTC
FEDORA-2020-5d9f0ce2b3 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 41 Fedora Update System 2020-10-19 16:53:14 UTC
FEDORA-2020-b40fc174b5 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-b40fc174b5

Comment 42 Fedora Update System 2020-10-20 14:22:36 UTC
FEDORA-2020-b40fc174b5 has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-b40fc174b5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b40fc174b5

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

Comment 43 Fedora Update System 2020-10-27 01:20:36 UTC
FEDORA-2020-b40fc174b5 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.