Are 'flatpak search' and 'flatpak list' broken in Rocky 9.3?

Anyone else having wacky results from flatpak search and flatpak list? I think I’m encountering the bugs mentionned here.

Is there a clean way to upgrade the flatpak package to 1.13 or above on a Rocky Linux 9 system?

Any plans by RHEL/Rocky to update the flatpak package in the repos? Is it supposed to stay frozen for the lifetime of the EL9 release?

I’m pretty sure I’m using the latest flatpak package from the Rocky repos:

rpm -q flatpak
flatpak-1.12.8-1.el9.x86_64

I can’t get flatpak search to work.

flatpak search flatseal

F: Failed to parse /var/lib/flatpak/appstream/flathub/x86_64/active/appstream.xml.gz file: Error on line 4065 char 29: <p> already set '
      Organic Maps is a free Android & iOS offline maps app for travelers,
      tourists, hikers, drivers and cyclists.
      It uses crowd-sourced OpenStreetMap data and is developed with love by
      ' and tried to replace with ' ('
No matches found

I can’t get flatpak list to output app names reliably either (for example the Warehouse app shows as ‘Heliguy’):

 [albert@localhost ~]$ flatpak list --app --columns name,app
Name                               Application ID
Cassidy James Blaede               com.github.cassidyjames.clairvoyant
Flatseal                           com.github.tchx84.Flatseal
Heliguy                            io.github.flattool.Warehouse
Video Trimmer                      org.gnome.gitlab.YaLTeR.VideoTrimmer
[albert@localhost ~]$

The flatpak search bug is mildly annoying since most app searching happens in the Software app (or on flathub.org).

The flatpak list bug is more annoying because sometimes the app id and the app name are completely different. It is very convenient to ‘grep’ the app name to get the app id.

Any suggestions anyone?

Xavier

Upstream issue:
https://issues.redhat.com/browse/RHEL-28856

1 Like

Thanks for the link. So I guess it’s up to Red Hat to figure a solution and Rocky will replicate it eventually?

Somewhat correct. Anyone can find and contribute a solution, but due to our 1:1 / bug-for-bug compatibility goal, Rocky Linux will not implement the fix until it is implemented in RHEL.

I also found this thread: [Bug]: F: Failed to parse /var/lib/flatpak/appstream/gnome/x86_64/active/appstream.xml.gz file: Error on line 1906 char 29: <p> already set ' · Issue #5434 · flatpak/flatpak · GitHub

If I am understanding correctly either flatpak or appstream-glib would need to be updated - which is unlikely to happen because rocky/rhel would only update those packages in this release for critical bugfixes.

Which means flatpak search and list will be broken in rocky until there is a new distribution version (like rocky 10 for example) that uses newer versions of flatpak.

For what it’s worth, I think Debian is affected too:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1037214

Which seems kind of wrong of flatpak in my opinion. I get the long term support release philosophy of distros and the reluctance for them to upgrade to major versions of things. It defeats one of the main goals of flatpak to be able to easily install these packages cross platform by breaking backwards compatibility. I know it only breaks search and list but that is pretty important - without it I am reluctant to use them at all because I can’t search for anything. Flatpak shouldn’t have done this or should revert to the old way in my opinion.

Its easy to complain but the reality is more complex as it looks like. Software components have dependencies, its in the rare cases that just the component can be upgraded. The default is, that you need to upgrade the dependencies as well, and that brings you to a situation where a significant part of the distro must be upgraded. Therefore backports are done → Security Backporting Practice - Red Hat Customer Portal

It seems that a new libappstream-glib package will arrive that resolves this - be patient.

I had the same issue on a test VM that I was working on today.

Here’s what I did to get it to work:

  1. gunzipped the /var/lib/flatpak/appstream/flathub/x86_64/active/appstream.xml.gz file.

  2. I used sed to strip out the <code> </code> and <em> </em> tags from the /var/lib/flatpak/appstream/flathub/x86_64/active/appstream.xml file.

  3. gzipped the /var/lib/flatpak/appstream/flathub/x86_64/active/appstream.xml

and then flatpak search ran OK.

I figured it wouldn’t really hurt to remove the “code” and “em” tags as long as I was able to search. Again, this was a test box, not in production.

FYI this affects Rocky 9.4 as well:

[jmpaul@localhost ~]$ cat /etc/os-release | grep VERSION
VERSION="9.4 (Blue Onyx)"
VERSION_ID="9.4"
ROCKY_SUPPORT_PRODUCT_VERSION="9.4"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"

[jmpaul@localhost ~]$ flatpak --version
Flatpak 1.12.8
[jmpaul@localhost ~]$ sudo flatpak search mosh
F: Failed to parse /var/lib/flatpak/appstream/flathub/x86_64/active/appstream.xml.gz file: Error on line 4875 char 29: <p> already set '
      Organic Maps is a free Android & iOS offline maps app for travelers,
      tourists, hikers, drivers and cyclists.
      It uses crowd-sourced OpenStreetMap data and is developed with love by
      ' and tried to replace with ' ('
No matches found

I was able to work around this issue using the following commands, based on the steps @jarak08 took:

cp /var/lib/flatpak/appstream/flathub/x86_64/active/appstream.xml.gz /tmp
gunzip /tmp/appstream.xml.gz
sed -i 's/<\/\?code>//g; s/<\/\?em>//g' /tmp/appstream.xml
gzip /tmp/appstream.xml
sudo cp /tmp/appstream.xml.gz /var/lib/flatpak/appstream/flathub/x86_64/active/appstream.xml.gz

After this, flatpak seems to work properly:

[jmpaul@localhost ~]$ sudo flatpak search mosh
Name              Description                                Application ID                  Version                           Branch         Remotes
Mosh              The Mobile Shell                           org.mosh.mosh                   1.4.0                             stable         flathub
WezTerm           Powerful terminal and multiplexer          org.wezfurlong.wezterm          20240203-110809-5046fc22          stable         flathub
SSH-MITM          SSH-MITM - ssh audits made simple          at.ssh_mitm.server              4.1.0                             stable         flathub

@linuxtek-canada - JFI, unfortunately this will not survive the next flatpak metadata update.
A bug fix is on the way …

The flatpak package got updated.

flatpak search now works as expected!

flatpak list is still broken on my machine (it lists the developer name where it should list the app name).

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.