Gettting "Error Updating the MIME type database - element: Mask is longer than value" after updating with Paru

When updating the system with paru I notice the following error during the MIME Type database update:

:: Running post-transaction hooks...
( 1/10) Creating system user accounts...
( 2/10) Reloading system manager configuration...
( 3/10) Creating temporary files...
( 4/10) Arming ConditionNeedsUpdate...
( 5/10) Updating the MIME type database...
Error in type 'application/x-core' (in /usr/share/mime/packages/freedesktop.org.xml): Error in <match> element: Mask is longer than value.
Error in type 'image/jp2' (in /usr/share/mime/packages/freedesktop.org.xml): Error in <match> element: Mask is longer than value.
Error in type 'image/jpx' (in /usr/share/mime/packages/freedesktop.org.xml): Error in <match> element: Mask is longer than value.
Error in type 'image/jpm' (in /usr/share/mime/packages/freedesktop.org.xml): Error in <match> element: Mask is longer than value.
Error in type 'video/mj2' (in /usr/share/mime/packages/freedesktop.org.xml): Error in <match> element: Mask is longer than value.
Error in type 'image/vnd.adobe.photoshop' (in /usr/share/mime/packages/freedesktop.org.xml): Error in <match> element: Mask is longer than value.
( 6/10) Updating the appstream cache...
✔ Metadata cache was updated successfully.

I’m not sure if something broke upstream with these file types. Thought I would check in here with you all.

Source:
https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/

1 Like

I’m having exactly the same problem with Arch.

Same exact set of errors here after an update with yay.

Good day everyone, this may be a problem with libxml2-2.12.0 as downgrading to 2.11.5 solves the issue. It has been discussed in Arch Linux forums:
https://bbs.archlinux.org/viewtopic.php?pid=2132880#p2132880

and an upstream issue was filled:

3 Likes

Thanks for sharing your findings.

So you downgraded the package (the fix will be in libxml2 2.12.1)

If we downgrade, do we need to regenerate the Mime database with the below command?

update-mime-database ~/.local/share/mime

Just I noticed it did not auto re-generate.

Source:
https://wiki.archlinux.org/title/XDG_MIME_Applications#Shared_MIME_databaseSource

1 Like

You’re welcome, you can try and run manually update-mime-database with -nV triggers to have a more verbose output and only update if MIME-DIR/packages/ or a file in that directory is newer than MIME-DIR/version.
Check out here the functionality:
https://man.archlinux.org/man/update-mime-database.1
shared-mime-info registers a pacman hook to run post-installation.
Also remember that the newer version of libxml2 has a non-deterministic behavior, sometimes results in errors, and other times not.

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