You are not logged in.

#1 2021-11-27 00:39:41

Thinking
Member
Registered: 2021-11-26
Posts: 3

Installing KDE & AppStream together is broken (cache refresh failed)

(I am posting this in the forums as I don't know whether this is an Arch problem, Pacman problem or an AppStream problem, hopefully someone else knows who to contact about this)

https://i.imgur.com/rTzgcFf.png

The problem is that when installing AppStream together with KDE Plasma, the issue "AppStream system cache refresh failed" appears. This issue does not occur when (re-)installing AppStream separately

In practice this results in the KDE Discover application showing a message about it being "offline" after installing "packagekit-qt5". (Related thread: https://bbs.archlinux.org/viewtopic.php?id=250224)

To fix this, one needs to run: "appstreamcli refresh-cache --force" (without "force" it will say that no update is necessary)

This force cache refresh can happen at any point after installation, before or after installing "packagekit-qt5". From what I can tell everything works afterwards, unfortunately this also means that I can't just run it in verbose mode to get more details on why it fails during installation.

Mod Edit - CoC - Pasting pictures and code

User Edit: Text version:

(17/19) Updating the appstream cache...
AppStream system cache refresh failed. Turn on verbose mode to get detailed issue information.
error: command failed to execute correctly

Last edited by Thinking (2021-11-27 01:17:14)

Offline

#2 2021-11-27 12:31:47

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,916

Re: Installing KDE & AppStream together is broken (cache refresh failed)

That looks like it comes from a alpm hook, but I have no idea which package provides this specific one.

please post the output of

$ ls -l /usr/share/libalpm/hooks/

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2021-11-27 19:57:54

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,098

Re: Installing KDE & AppStream together is broken (cache refresh failed)

Very interesting. This may finally solve the mistery of why some users were getting "Check your connectivity" errors on Discover that were solved by reinstalling appstream (which re-runs the cache updater). This is the output of the cache updater hook with --verbose:

(7/8) Updating the appstream cache...
** (appstreamcli:308): DEBUG: 19:41:12.795: run /usr/bin/appstreamcli: refresh-cache
** (appstreamcli:308): DEBUG: 19:41:12.797: Opening cache file: /root/.cache/appstream/appcache-OI7ZD1.mdb
(appstreamcli:308): GLib-GIO-DEBUG: 19:41:12.797: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ?gio-vfs?
** (appstreamcli:308): DEBUG: 19:41:12.799: Added /usr/share/app-info/xmls to XML metadata search path.
** (appstreamcli:308): DEBUG: 19:41:12.799: Not adding metadata location '/var/lib/app-info': Is no directory
** (appstreamcli:308): DEBUG: 19:41:12.799: Not adding metadata location '/var/cache/app-info': Is no directory
** (appstreamcli:308): DEBUG: 19:41:12.799: Refreshing AppStream system data cache
** (appstreamcli:308): DEBUG: 19:41:12.811: Opening cache file: /var/cache/app-info/cache/en_US.cachepGNUj7C5.tmp
** (appstreamcli:308): DEBUG: 19:41:12.811: Cache set to floating mode.
** (appstreamcli:308): DEBUG: 19:41:12.812: run AsPool:load_collection_data
** (appstreamcli:308): DEBUG: 19:41:12.812: Searching for data in: /usr/share/app-info/xmls
** (appstreamcli:308): DEBUG: 19:41:12.812: Reading: /usr/share/app-info/xmls/community.xml.gz
** (appstreamcli:308): DEBUG: 19:41:12.821: WARNING: Could not parse XML data: Entity: line 1: parser error : Start tag expected, '<' not found
\u001f\x8b\u0008
^

** (appstreamcli:308): DEBUG: 19:41:12.821: Reading: /usr/share/app-info/xmls/core.xml.gz
** (appstreamcli:308): DEBUG: 19:41:12.821: WARNING: Could not parse XML data: Entity: line 1: parser error : Start tag expected, '<' not found
\u001f\x8b\u0008
^

** (appstreamcli:308): DEBUG: 19:41:12.821: Reading: /usr/share/app-info/xmls/extra.xml.gz
** (appstreamcli:308): DEBUG: 19:41:12.825: WARNING: Could not parse XML data: Entity: line 1: parser error : Start tag expected, '<' not found
\u001f\x8b\u0008
^

** (appstreamcli:308): DEBUG: 19:41:12.825: Reading: /usr/share/app-info/xmls/multilib.xml.gz
** (appstreamcli:308): DEBUG: 19:41:12.825: WARNING: Could not parse XML data: Entity: line 1: parser error : Start tag expected, '<' not found
\u001f\x8b\u0008
^

** (appstreamcli:308): DEBUG: 19:41:12.825: Error while updating the in-memory data pool: Metadata files have errors: /usr/share/app-info/xmls/multilib.xml.gz, /usr/share/app-info/xmls/extra.xml.gz, /usr/share/app-info/xmls/core.xml.gz, /usr/share/app-info/xmls/community.xml.gz
** (appstreamcli:308): DEBUG: 19:41:12.825: Cache returned from floating mode (all changes are now persistent)
** (appstreamcli:308): DEBUG: 19:41:12.837: Not clearing user cache: The cache was already empty.
AppStream system cache refresh failed. Turn on verbose mode to get detailed issue information.

which shows that appstream is failing to read the gzipped xml's because it expects them to be uncompressed. Why this fails only the first time one installs appstream+archlinux-appstream-data and works in any subsequent runs is a mistery to me. I guess I'll just install the xml's uncompressed, as the size gain is not that big.

Offline

#4 2021-11-28 09:34:28

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,098

Re: Installing KDE & AppStream together is broken (cache refresh failed)

OK I think I might have found the reason: if shared-mime-info is installed in the same transaction, then the mime info database is not generated until the update-mime-database.hook is run. But pacman runs hooks in alphabetic order, so this is (almost) the last hook to run. In particular, the mimetipe database doesn't exist yet by the time the appstream cache generator hook is run, which makes appstream fail to recognize the appstream data files as compressed xml's.

Offline

Board footer

Powered by FluxBB