Bug 461262 - Error loading AppData file: failed to parse (but passes appstream-util)
Summary: Error loading AppData file: failed to parse (but passes appstream-util)
Status: CLOSED NOT A BUG
Alias: None
Product: Qt/KDE Flatpak Runtime
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-31 19:25 UTC by Tobias Menzi
Modified: 2022-11-02 22:56 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
A small appdata.xml for reproduction (614 bytes, text/plain)
2022-10-31 19:28 UTC, Tobias Menzi
Details
A small manifest for reproduction (556 bytes, application/x-yaml)
2022-10-31 19:28 UTC, Tobias Menzi
Details
Valid appdata.xml file (556 bytes, application/x-yaml)
2022-11-01 21:14 UTC, Tobias Menzi
Details
Valid appdata.xml file (646 bytes, text/xml)
2022-11-01 21:15 UTC, Tobias Menzi
Details
Ultra-valid appdata.xml file (706 bytes, text/xml)
2022-11-01 22:35 UTC, Tobias Menzi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Menzi 2022-10-31 19:25:55 UTC
SUMMARY

STEPS TO REPRODUCE
1. Get the repro manifest + appdata.xml from here: https://git.sr.ht/~tobtobxx/org.example.repro
2. Verify the appdata.xml:
```
$ appstream-util validate-relax org.example.repro.appdata.xml
org.example.repro.appdata.xml: OK
```
3. Try to build the application

OBSERVED RESULT
```
Processing application org.example.repro
Error loading AppData file: failed to parse /app/share/appdata/org.example.repro.appdata.xml: Error on line 15 char 56: <li> already set ',' and tried to replace with ' and '
Error: ERROR: appstream-compose failed: Child process exited with code 1
```

EXPECTED RESULT
No error (try to uncomment the lines with the `org.freedesktop.Platform` platform instead of the kde platform)

SOFTWARE/OS VERSIONS
flatpak: 1.14.0
flatpak-builder: 1.2.2
appstream-util: 0.8.1
kde platform: 6.3 (see manifest)

ADDITIONAL INFORMATION
ref: https://github.com/flatpak/flatpak-builder/issues/496
Comment 1 Tobias Menzi 2022-10-31 19:28:00 UTC
Created attachment 153362 [details]
A small appdata.xml for reproduction
Comment 2 Tobias Menzi 2022-10-31 19:28:20 UTC
Created attachment 153363 [details]
A small manifest for reproduction
Comment 3 Albert Astals Cid 2022-11-01 17:58:55 UTC
I don't understand why you have filed this bug here.
Comment 4 Tobias Menzi 2022-11-01 18:11:28 UTC
> I don't understand why you have filed this bug here.

The issue is about the KDE Flatpak runtime.

From the Flatpak docs[0]:
"The KDE runtime is maintained here[1]."

In the README of the referenced repo[1], you can read this[2]:
"Issues can be reported here:
https://bugs.kde.org/enter_bug.cgi?product=Qt%2FKDE%20Flatpak%20Runtime"

And here I am, having clicked on this link and reported the issue there.
Give me hints to where I went wrong?

[0]: https://docs.flatpak.org/en/latest/available-runtimes.html#kde
[1]: https://invent.kde.org/packaging/flatpak-kde-runtime
[2]: https://invent.kde.org/packaging/flatpak-kde-runtime#getting-to-grips
Comment 5 Nicolas Fella 2022-11-01 19:17:45 UTC
Your appstream file is invalid. This has nothing to do with the KDE runtime.

In particular you have list items without an associated list. Also b tags are not supported by appstream.

See https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description
Comment 6 Tobias Menzi 2022-11-01 21:13:43 UTC
> Your appstream file is invalid.

This is true indeed. Thanks for catching.

Unfortunately, the unexpected behavior does not disappear after fixing. I've attached a fixed appdata.xml, which still triggers this error.

If I've understood the spec you linked correctly, then a <ul> in a <p> is not allowed either. I did try to move the list out of the paragraph, but the same behavior still occurs. In fact, it seems as if a <li> can only contain max. 1 <em> tag.
Comment 7 Tobias Menzi 2022-11-01 21:14:31 UTC
Created attachment 153382 [details]
Valid appdata.xml file
Comment 8 Tobias Menzi 2022-11-01 21:15:31 UTC
Created attachment 153383 [details]
Valid appdata.xml file

Uploaded wrong file.
Comment 9 Nicolas Fella 2022-11-01 21:18:57 UTC
appstreamcli validate org.example.repro.appdata.xml gives

I: org.example.repro:~: content-rating-missing
E: org.example.repro:~: desktop-app-launchable-missing
E: org.example.repro:14: description-para-markup-invalid ul

? Validation failed: errors: 2, infos: 1, pedantic: 1
Comment 10 Tobias Menzi 2022-11-01 22:35:09 UTC
Created attachment 153386 [details]
Ultra-valid appdata.xml file

Fixed all the (unrelated) appstreamcli validate errors.
Comment 11 Tobias Menzi 2022-11-01 22:37:02 UTC
Error 1 (desktop-app-launchable-missing) is unrelated. Fixed it nevertheless in the new appdata.xml version.

Error 2 is what I've written about in the previous message:
> I did try to move the list out of the paragraph, but the same behavior still occurs.

The new appdata.xml now also passes appstreamcli validate with no errors AND THE BUG STILL OCCURS.

Please do not just close this issue, as the bug is still present.
Comment 12 Albert Astals Cid 2022-11-02 22:56:17 UTC
Our Sdks are still based on 21.08, if you use

runtime: org.freedesktop.Platform
runtime-version: '21.08'

you'll get the same error, this is not our bug.