[SRU] appstream-glib can't handle em or code tags, breaking Flathub

Bug #2023215 reported by Matthias Klumpp
26
This bug affects 2 people
Affects Status Importance Assigned to Milestone
appstream-glib (Ubuntu)
Fix Released
High
Unassigned
Focal
Fix Committed
High
Jeremy Bícha
Jammy
Fix Released
High
Jeremy Bícha

Bug Description

[ Impact ]

 * Currently, any application that is using modern AppStream metadata containing <em>/<code> tags in their description, and that is still using the deprecated appstream-glib will fail to parse this data.
 * Unfortunately, this affects some high-visibility applications now, like Flatpak, which are unable to perform proper searches. See https://github.com/flatpak/flatpak/issues/5434 for reference.
 * This kind of issue may potentially affect more tools as well.

[ Test Plan ]

1. Open a terminal and run
sudo apt install flatpak

2. Then run
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

3. Run
flatpak search meld

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

4. Install the updated appstream-glib packages.

5. Restart your computer then log back in.

6. Open a terminal and run
flatpak search meld

The working output looks something like
Name Description Application ID Version Branch Remotes
Meld Compare and merge your files org.gnome.meld 3.22.0 stable flathub

[ Where problems could occur ]

 * The reverse-dependencies for appstream-glib in Ubuntu Jammy are:
  flatpak-tests
  unity
  libmalcontent-ui-0-0
  libappstream-glib-dev
  gir1.2-appstreamglib-1.0
  appstream-util
  flatpak

 * Flatpak should continue to work, and there should be no new errors in GNOME/Unity.

[ Other Info ]

 * None. Updating this should mainly help Flatpak users and should have no ill effects on any other component of the OS.

* This issue was fixed upstream in appstream-glib 0.8.1 which is available in Ubuntu 22.10 and newer releases.

Revision history for this message
Matthias Klumpp (ximion) wrote :
Revision history for this message
Robie Basak (racb) wrote :

I think this should probably be fixed in SRUs together with bug 2006110 and verified together. See my comment 6 there for further comment.

Jeremy Bícha (jbicha)
description: updated
description: updated
Changed in appstream-glib (Ubuntu):
status: New → Fix Released
Changed in appstream-glib (Ubuntu Jammy):
importance: Undecided → High
Changed in appstream-glib (Ubuntu):
importance: Undecided → High
Changed in appstream-glib (Ubuntu Jammy):
status: New → In Progress
assignee: nobody → Jeremy Bícha (jbicha)
Revision history for this message
Jeremy Bícha (jbicha) wrote :

Robie, I updated the bug title and test case. At this point, I do not believe the "appstream" source package needs to be updated to fix this issue. We can ignore bug 2006110 for this issue.

description: updated
summary: - [SRU] Update to 0.7.18-2ubuntu0.1 for jammy
+ [SRU] appstream-glib can't handle em or code tags, breaking Flatpak
summary: - [SRU] appstream-glib can't handle em or code tags, breaking Flatpak
+ [SRU] appstream-glib can't handle em or code tags, breaking Flathub
Revision history for this message
Jeremy Bícha (jbicha) wrote :

I have uploaded this fix to the unapproved queue for Jammy. It will need to be manually reviewed by a member of the Ubuntu SRU Team before it will be available as a proposed update.

I updated debian/changelog to include this Launchpad bug number since that is a requirement for Ubuntu Stable Release Updates.

I am unsubscribing ubuntu-sponsors now. Please feel to resubscribe if you have anything else that needs to be sponsored.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Matthias, or anyone else affected,

Accepted appstream-glib into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/appstream-glib/0.7.18-2ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in appstream-glib (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Jeremy Bícha (jbicha)
Changed in appstream-glib (Ubuntu Focal):
importance: Undecided → High
status: New → In Progress
assignee: nobody → Jeremy Bícha (jbicha)
Revision history for this message
Jeremy Bícha (jbicha) wrote :

I successfully completed the test case using appstream-glib 0.7.18-2ubuntu1 on Ubuntu 22.04 LTS.

tags: added: focal jammy verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package appstream-glib - 0.7.18-2ubuntu1

---------------
appstream-glib (0.7.18-2ubuntu1) jammy; urgency=medium

  * Add support-em-code.patch, improve-em-code-handling.patch:
    - Do not fail parsing when encountering valid <em> or <code>
      elements in AppStream XML. This fixes Flathub. (LP: #2023215)

 -- Matthias Klumpp <email address hidden> Wed, 07 Jun 2023 17:42:20 +0200

Changed in appstream-glib (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for appstream-glib has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Matthias, or anyone else affected,

Accepted appstream-glib into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/appstream-glib/0.7.16-1ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in appstream-glib (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
removed: verification-done
Jeremy Bícha (jbicha)
description: updated
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Output of step 3 in Focal with flatpak 1.6.5-0ubuntu0.4 was

--->
Meld Compare and merge your files org.gnome.meld 3.22.0 stable flathub
<---

tags: added: verification-failed-focal
removed: verification-needed-focal
Revision history for this message
Chris Halse Rogers (raof) wrote :

Oops! Looks like the last commenter meant to set this into the verification-done state, rather than -failed, as they've got correct output.

Fixing and releasing.

tags: added: verification-done-focal
removed: verification-failed-focal verification-needed
tags: added: verification-needed-focal
removed: verification-done-focal
Revision history for this message
Chris Halse Rogers (raof) wrote :

Ooof, double oops. That's the *flatpak* version they've described, not the appstream-glib version they've tested.

Nathan Teodosio: could you (or someone else) double-check that this is fixed specifically by appstream-glib 0.7.16-1ubuntu2 in Focal?

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : [appstream-glib/focal] verification still needed

The fix for this bug has been awaiting testing feedback in the -proposed repository for focal for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Revision history for this message
Jeremy Bícha (jbicha) wrote :

The test case is no longer valid because Flathub reverted their changes. I need to work with the Flathub administrators to get a replacement test case.

I request that this SRU stay in -proposed a bit longer.

Revision history for this message
Matthias Klumpp (ximion) wrote :

Oh no, I thought this was live!
As far as I know, Flathub might be switching to modern AppStream again soon (if it didn't do that already even).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.