Md type primary error when updating from gnome software

You mean while using the dnf command, right?
But isn’t zchunck disabled?

yes, it is, just checked…

Btw I suspect that zchunk is involved in the MD_TYPE_PRIMARY has failed error.
Again, I don’t have enough knowledge on this topic, but if you look at the content of this URL https://fedora.mirror.garr.it/fedora/linux/releases/32/Everything/x86_64/os/repodata/, there are files called like something-primary.xml. zck , as well as in the destination directories /var/cache/PackageKit/32/metadata

Just to track the issue, could you show the content of /etc/dnf/dnf.conf
And what kind of error related to zchunk you get?

Oh boy! As far as I can see, even if the repositories are disabled, it seems that pkcon -v refresh force refresh them as well.

This is an interesting command to launch:
sudo /usr/libexec/packagekit-direct -v refresh-force

It gives more information about PackageKit cache refresh operations.

this is the dnf conf file

> [main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=False
skip_if_unavailable=True
zchunk=False

this is the zchunk error

> Skipping refresh of fedora: 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 != 2776)]; 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 != 2776)]

and this is the result of sudo /usr/libexec/packagekit-direct -v refresh-force

> 13:14:25	PackageKit          Verbose debugging enabled (on console 1)
13:14:25	PackageKit          Trying to load : dnf
13:14:25	PackageKit          dlopening '/usr/lib64/packagekit-backend/libpk_backend_dnf.so'
13:14:25	PackageKit-DNF      Using libdnf 0.47.0
13:14:25	PackageKit-DNF      Using librepo 1.11.3
13:14:25	PackageKit          cache-age changed to 4294967295
Status: running
Status: wait
13:14:25	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
Done: 1%
13:14:26	PackageKit-DNF      Deleting contents of rpmfusion-nonfree-steam as forced
13:14:26	PackageKit-DNF      got state loading-cache with hint (null)
13:14:26	PackageKit-DNF      repo rpmfusion-nonfree-steam not okay [repodata rpmfusion-nonfree-steam was not complete: Cannot open /var/cache/PackageKit/32/metadata/rpmfusion-nonfree-steam-32-x86_64/repodata/repomd.xml: File o directory non esistente], refreshing
13:14:26	PackageKit-DNF      got state download-repository with hint (null)
Status: download-repository
Done: 7%
13:14:26	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
Done: 8%
13:14:27	PackageKit-DNF      got state loading-cache with hint (null)
Done: 9%
13:14:27	PackageKit-DNF      Deleting contents of rpmfusion-nonfree-updates as forced
13:14:27	PackageKit-DNF      got state loading-cache with hint (null)
13:14:27	PackageKit-DNF      repo rpmfusion-nonfree-updates not okay [repodata rpmfusion-nonfree-updates was not complete: Cannot open /var/cache/PackageKit/32/metadata/rpmfusion-nonfree-updates-32-x86_64/repodata/repomd.xml: File o directory non esistente], refreshing
13:14:27	PackageKit-DNF      got state download-repository with hint (null)
Status: download-repository
Done: 16%
13:14:28	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
Done: 17%
13:14:30	PackageKit-DNF      got state loading-cache with hint (null)
13:14:30	PackageKit-DNF      Done: 18%
Deleting contents of copr:copr.fedorainfracloud.org:gnumdk:eolie as forced
13:14:30	PackageKit-DNF      got state loading-cache with hint (null)
13:14:30	PackageKit-DNF      repo copr:copr.fedorainfracloud.org:gnumdk:eolie not okay [repodata copr:copr.fedorainfracloud.org:gnumdk:eolie was not complete: Cannot open /var/cache/PackageKit/32/metadata/copr:copr.fedorainfracloud.org:gnumdk:eolie-32-x86_64/repodata/repomd.xml: File o directory non esistente], refreshing
13:14:30	PackageKit-DNF      got state download-repository with hint (null)
Status: download-repository
13:14:31	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
Done: 25%
13:14:32	PackageKit-DNF      got state loading-cache with hint (null)
Done: 26%
13:14:32	PackageKit-DNF      Deleting contents of rpmfusion-nonfree as forced
13:14:32	PackageKit-DNF      got state loading-cache with hint (null)
13:14:32	PackageKit-DNF      repo rpmfusion-nonfree not okay [repodata rpmfusion-nonfree was not complete: Cannot open /var/cache/PackageKit/32/metadata/rpmfusion-nonfree-32-x86_64/repodata/repomd.xml: File o directory non esistente], refreshing
13:14:32	PackageKit-DNF      got state download-repository with hint (null)
Status: download-repository
Done: 32%
13:14:32	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
Done: 34%
13:14:33	PackageKit-DNF      got state loading-cache with hint (null)
13:14:33	PackageKit-DNF      Deleting contents of copr:copr.fedorainfracloud.org:gnumdk:lollypop as forced
Done: 35%
13:14:33	PackageKit-DNF      got state loading-cache with hint (null)
13:14:33	PackageKit-DNF      repo copr:copr.fedorainfracloud.org:gnumdk:lollypop not okay [repodata copr:copr.fedorainfracloud.org:gnumdk:lollypop was not complete: Cannot open /var/cache/PackageKit/32/metadata/copr:copr.fedorainfracloud.org:gnumdk:lollypop-32-x86_64/repodata/repomd.xml: File o directory non esistente], refreshing
13:14:33	PackageKit-DNF      got state download-repository with hint (null)
Status: download-repository
13:14:34	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
Done: 43%
13:14:34	PackageKit-DNF      got state loading-cache with hint (null)
13:14:34	PackageKit-DNF      Deleting contents of rpmfusion-free-updates as forced
13:14:34	PackageKit-DNF      got state loading-cache with hint (null)
13:14:34	PackageKit-DNF      repo rpmfusion-free-updates not okay [repodata rpmfusion-free-updates was not complete: Cannot open /var/cache/PackageKit/32/metadata/rpmfusion-free-updates-32-x86_64/repodata/repomd.xml: File o directory non esistente], refreshing
13:14:34	PackageKit-DNF      got state download-repository with hint (null)
Status: download-repository
Done: 50%
13:14:35	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
Done: 52%
13:14:36	PackageKit-DNF      got state loading-cache with hint (null)
13:14:36	PackageKit-DNF      Deleting contents of phracek-PyCharm as forced
13:14:36	PackageKit-DNF      got state loading-cache with hint (null)
13:14:36	PackageKit-DNF      repo phracek-PyCharm not okay [repodata phracek-PyCharm was not complete: Cannot open /var/cache/PackageKit/32/metadata/phracek-PyCharm-32-x86_64/repodata/repomd.xml: File o directory non esistente], refreshing
13:14:36	PackageKit-DNF      got state download-repository with hint (null)
Status: download-repository
13:14:37	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
Done: 60%
13:14:38	PackageKit-DNF      got state loading-cache with hint (null)
13:14:38	PackageKit-DNF      Deleting contents of google-chrome as forced
13:14:38	PackageKit-DNF      got state loading-cache with hint (null)
13:14:38	PackageKit-DNF      repo google-chrome not okay [repodata google-chrome was not complete: Cannot open /var/cache/PackageKit/32/metadata/google-chrome-32-x86_64/repodata/repomd.xml: File o directory non esistente], refreshing
13:14:38	PackageKit-DNF      got state download-repository with hint (null)
Status: download-repository
13:14:38	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
Done: 69%
13:14:38	PackageKit-DNF      got state loading-cache with hint (null)
13:14:38	PackageKit-DNF      Deleting contents of fedora as forced
13:14:38	PackageKit-DNF      got state loading-cache with hint (null)
13:14:38	PackageKit-DNF      repo fedora not okay [repodata fedora was not complete: Cannot open /var/cache/PackageKit/32/metadata/fedora-32-x86_64/repodata/repomd.xml: File o directory non esistente], refreshing
13:14:38	PackageKit-DNF      got state download-repository with hint (null)
Status: download-repository
Done: 70%
Done: 71%
Done: 72%
Done: 73%
Done: 74%
Done: 75%
Done: 76%
Done: 77%
13:14:39	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
13:16:08	PackageKit-DNF      Skipping refresh of fedora: 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 != 2776)]; 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 != 2776)]
13:16:08	PackageKit-DNF      Deleting contents of rpmfusion-nonfree-nvidia-driver as forced
13:16:08	PackageKit-DNF      got state loading-cache with hint (null)
13:16:08	PackageKit-DNF      repo rpmfusion-nonfree-nvidia-driver not okay [repodata rpmfusion-nonfree-nvidia-driver was not complete: Cannot open /var/cache/PackageKit/32/metadata/rpmfusion-nonfree-nvidia-driver-32-x86_64/repodata/repomd.xml: File o directory non esistente], refreshing
Done: 78%
13:16:08	PackageKit-DNF      got state download-repository with hint (null)
Status: download-repository
Done: 84%
13:16:09	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
Done: 86%
13:16:10	PackageKit-DNF      got state loading-cache with hint (null)
13:16:10	PackageKit-DNF      Deleting contents of updates as forced
13:16:10	PackageKit-DNF      got state loading-cache with hint (null)
13:16:10	PackageKit-DNF      repo updates not okay [repodata updates was not complete: Cannot open /var/cache/PackageKit/32/metadata/updates-32-x86_64/repodata/repomd.xml: File o directory non esistente], refreshing
Done: 87%
13:16:10	PackageKit-DNF      got state download-repository with hint (null)
Status: download-repository
Done: 89%
Done: 92%
Done: 93%
Done: 94%
13:16:11	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
Done: 95%
13:16:43	PackageKit-DNF      got state loading-cache with hint (null)
Done: 96%
13:16:43	PackageKit-DNF      got state query with hint (null)
Status: query
13:16:43	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
13:16:43	PackageKit-DNF      got state download-repository with hint (null)
Status: download-repository
13:16:44	PackageKit-DNF      got state loading-cache with hint (null)
Status: loading-cache
Error: cannot-fetch-sources	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 != 659)]; 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 != 659)]
Status: finished
Exit code: failed
1 Like

I think that it could be interesting to add the packagekit-direct result to the bug report.

done, hope someone will have a look at it…

Again out of curiosity, if you perform the download with curl

cd ~/Downloads
curl -O http://fedora.mirror.garr.it/fedora/linux/releases/32/Everything/x86_64/os/repodata/b7e1566c87075299c4a199737b341e7d15fbf1a4d49c4c2cbe43368437b02c47-comps-Everything.x86_64.xml.zck

Does it work? (I bet yes)

yes does it work without problem

I have another, maybe stupid, question: what about disk space?
df -h

plenty…well sort of

File system Dim. Usati Dispon. Uso% Montato su
devtmpfs 1,9G 0 1,9G 0% /dev
tmpfs 2,0G 36M 1,9G 2% /dev/shm
tmpfs 2,0G 1,6M 1,9G 1% /run
/dev/sda2 108G 9,9G 93G 10% /
tmpfs 2,0G 100K 2,0G 1% /tmp
/dev/sdb2 145G 78G 61G 57% /home
/dev/sda1 976M 275M 635M 31% /boot
tmpfs 390M 124K 390M 1% /run/user/1000

I was performing some test.
I used my mobile phone via usb tethering in order to connect my PC to the internet.
I don’t get the loading of MD_TYPE_PRIMARY has failed error. But when I issue the pkcon refresh force command, after a lot of time, I get an already mentioned error:

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 ...

If I reconnect the PC to the WiFi network, all works as expected.

Wait!

I was using an outdated system. I upgraded it with dnf.
Now if I perform the same command pkcon refresh force as before, using the mobile line, now I get
Fatal error: loading of MD_TYPE_PRIMARY has failed

Yay! :partying_face:

1 Like

@247, I mean that probably a fresh installation of Fedora will not solve your issue.

well that means that something changed in fedora, because was not having this issue weeks ago

i do think at this point, there’s not much we can do…

Hey @247, I have another test for you :sweat_smile:

Could you please edit again these two files?
/etc/yum.repos.d/fedora.repo
/etc/yum.repos.d/fedora-updates.repo

In /etc/yum.repos.d/fedora.repo, in the [fedora] repo-id stanza, comment all the metalink and baseurl lines. Then add this line:
baseurl=https://dl.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/

In /etc/yum.repos.d/fedora-updates.repo, in the [updates] repo-id stanza, also comment all the metalink and baseurl lines. Then add this line:
baseurl=https://dl.fedoraproject.org/pub/fedora/linux/updates/$releasever/Everything/$basearch/

/etc/yum.repos.d/fedora.repo
[fedora]
name=Fedora $releasever - $basearch
baseurl=https://dl.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
# metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
countme=1
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
/etc/yum.repos.d/fedora-updates.repo
[updates]
name=Fedora $releasever - $basearch - Updates
baseurl=https://dl.fedoraproject.org/pub/fedora/linux/updates/$releasever/Everything/$basearch/
# metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
enabled=1
countme=1
repo_gpgcheck=0
type=rpm
gpgcheck=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False

Then, maybe it is pointless, issue this command
sudo rm -rf /var/cache/PackageKit/32/
and reboot.

Afterwards, open a terminal, and again, issue this command:
pkcon -v refresh force

done, things hasn’t changed by a single bit…

Weird things.
As said, this issue happens to me as well using tethering with the mobile phone. Using dl.fedoraproject.org instead of a mirror seemed to work.