Error reading fwupd appinfo #32

Closed
iainlane opened this Issue Apr 9, 2016 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

iainlane commented Apr 9, 2016

Hi ximion! Hope you got back okay

fwupd's appinfo can't be read by appstream currently. In sid (install fwupd and appstream, then apt-get update):

(sid-amd64)root@nightingale:/# appstreamcli refresh-index --force --verbose
** (appstreamcli:5971): DEBUG: Refreshing AppStream cache
** (appstreamcli:5971): DEBUG: Reading: /usr/share/app-info/xmls/org.freedesktop.fwupd.xml
** (appstreamcli:5971): DEBUG: WARNING: Invalid component: [Component::UEFI-dummy-dev0]> name: UEFI Updates | package: ? | summary: Enable UEFI Update Functionality
** (appstreamcli:5971): DEBUG: Reading: /var/lib/app-info/yaml/ftp.debian.org_debian_dists_sid_non-free_dep11_Components-amd64.yml.gz
** (appstreamcli:5971): DEBUG: Reading: /var/lib/app-info/yaml/ftp.debian.org_debian_dists_sid_main_dep11_Components-amd64.yml.gz
** (appstreamcli:5971): DEBUG: Reading: /var/lib/app-info/yaml/ftp.debian.org_debian_dists_sid_contrib_dep11_Components-amd64.yml.gz
** (appstreamcli:5971): DEBUG: Detected colliding ids: flcheckers.desktop was already added with the same priority.
** (appstreamcli:5971): DEBUG: Detected colliding ids: flsudoku.desktop was already added with the same priority.
** (appstreamcli:5971): DEBUG: Detected colliding ids: flblocks.desktop was already added with the same priority.
** (appstreamcli:5971): DEBUG: Detected colliding ids: emacs24-term.desktop was already added with the same priority.
** (appstreamcli:5971): DEBUG: zathura-pdf-poppler.desktop extends zathura.desktop, but zathura.desktop was not found.
** (appstreamcli:5971): DEBUG: Removing old rebuild-dir from previous database rebuild.
AppStream cache update completed, but some metadata was ignored due to errors.

If you delete the first component then the warning just moves to the next one.

I assume this is going to break firmware updates?

@ximion ximion added the bug label Apr 11, 2016

@ximion ximion self-assigned this Apr 11, 2016

Owner

ximion commented Apr 11, 2016

This likely won't break fwupd, but it's a bug regardless of that - the firmware components won't be in the cache because of this, which is really bad.
The actual cause is a too strict check on installation candidates, which we do before considering the component as valid. I am inclined to remove that check alltogether, and have software centers do that check instead.
This would also allow us to load metainfo files into the pool and have software centers resolve them to packages using PackageKit (this would be a prerequisite for fixing #3 )

ximion added a commit that referenced this issue Apr 11, 2016

Do not check for installation candidate on minimal validation
The is_valid function should only do minimal validation of the values of
an AppStream component, and having an installation candidate is no
prerequisite for being valid anymore.
(But an id, name and summary are always required, no matter what the
component type is)

This is the first piece needed for resolving #32

ximion added a commit that referenced this issue Apr 11, 2016

Don't check if component has an installation candidate before includi…
…ng it

This is the second part needed before #32 can be resolved.

ximion added a commit that referenced this issue Apr 11, 2016

Quick-check components only when the pool is fully loaded
This ensures we know about all data and can merge components properly if
required, before validating them.
This means we now allow the parsers to throw out invalid components by
default, and it is the callers responsibility now to check for validity.

Another step towards fixing #32

@ximion ximion added the core label Apr 11, 2016

Owner

ximion commented Apr 11, 2016

Crap, this actually does break things severely - not the fwupd stuff, but if things are loaded in the wrong order, this will severely break the components pool itself, due to GNOME Software placing invalid metadata in /usr/share/app-info/xmls/org.gnome.Software.xml.gz now. All stuff mentioned in there will be ignored if this gets loaded prior to the valid data.
I will fix this next, the other changes are prerequisites for this.
Pretty bad timing so short before releasing... I will make this high-priority.

ximion added a commit that referenced this issue Apr 12, 2016

Support the stub data of GNOME Software
I am not sure if the way GNOME Software places invalid data in the
distro metadata directory is actually a sane thing... Especially because
this hijacks the global AppStream namespace and injects new metadata (in
this case, the non-standard "featured" category), which will then be
available to all software centers (which might want to define their own
"featured" apps, e.g. KDE Discover might want to feature its own apps).

At least we don't fail hard on these stub metadata entries now and can -
relatively reliably - filter them out and merge them.

This ŕesolves #32
Owner

ximion commented Apr 12, 2016

This issue should be solved now - can you please test with Git master if that is the case for you too?
These changes were way more invasive than I wanted them to be, but so far I spotted no issues and the testsuite passes.
I am really not sure if GNOME Software is doing a sane thing here with its extra metadata, I'll ask hughsie about that.

Also, I will make an AppStream release this week, or next Monday (next Monday would be a bit more likely atm, I want some more testing of the changes).

@ximion ximion closed this Apr 12, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment