14

Whenever I start firefox, steam, and some other gui programs from the terminal, I see this error.

I have searched for possible solutions to this problem, the most common one I found was sudo update-mime-database /usr/share/mime, which runs without printing any errors (or anything at all) for me, but does not change anything.

I tried changing permissions, as suggested here: How to repair broken permissions on files in /usr/share/mime?, however, this also changed nothing.

https://bbs.archlinux.org/viewtopic.php?id=245985

I have very similar issues (it occurs much more often when launched from the command line) to what is described in this arch forum post, however XDG_DATA_DIRS is not set in my .zshrc, nor does it have the flatpak path (it is /home/user/snap/alacritty/46/.local/share:/home/user/snap/alacritty/46:/snap/alacritty/46/usr/share:/usr/share/awesome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop.

If there is any information about my installation that I should provide, please tell me. Thank you.

I am using Ubuntu 20.04.2 LTS, with the awesome window manager, and gnome as my desktop.

The full output of running gnome-calculator is as follows:

(gnome-calculator:4038): Gtk-WARNING **: 06:23:42.942: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Yaru/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Yaru/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
[1]    4038 abort (core dumped)  gnome-calculator
4
  • Please edit the question askubuntu.com/posts/1351607/edit to include type of desktop. Gnome? Or? ... And of course always Ubuntu version : cat etc/issue Commented Jul 13, 2021 at 11:38
  • 1
    "I see this error" What is the error? You only list a "warning" (and those are not errors). "warnings" are intended for developers, not for us users. I would assume this is from a theme that is broken or not intended for your manager. Switch icon theme to a default one and if that solves it you could file a bug report against the theme :-) Commented Jul 13, 2021 at 13:15
  • @Rinzwind I wasn't sure how much of the output was relevant, so I only posted that part. I will edit the post with the example output of a program. Commented Jul 13, 2021 at 13:24
  • 1
    You are one of several people who reported this error over the past several months, and now I am starting to get this error also under XUbuntu 20.04 (XFCE). The fixes suggested here and elsewhere to not work for me. Does anyone have any info about how to fix this, other than what is reported here? Thank you. Commented Jan 19, 2022 at 23:23

5 Answers 5

7

I recently started having this same problem, and none of these suggestions mentioned here worked for me. However, I now discovered the cause of my problem:

I had accidentally set the XDG_DATA_DIRS environment variable to point to a non-existent directory. Once I fixed this and ran the following, this Gtk problem went away ...

export XDG_DATA_DIRS=/path/to/a/real/and/accessible/directory

I also think that completely unsetting XDG_DATA_DIRS could fix the problem, as well.

1
  • 1
    For me, while running ungoogled-chromium from inside an Arch Linux distrobox container the XDG_DATA_DIRS variable was set but it was empty - quitting chromium then issuing unset XDG_DATA_DIRS then re-running chromium prevented the errors. I guess there was/is a fallback - thanks for the pointer @HippoMan :-) btw, this post [[Solved] Could not load pixbuf from icon theme. gdk error crash](bbs.archlinux.org/viewtopic.php?id=261143) may be of help to "clean-up" if you've accidentally made a mess of permissions... Commented Nov 7, 2022 at 17:04
4

I was having the same error as well on my Arch machine. My firefox would crash if I tried open a file from my system in firefox. I found a site which describes a similar issue which fixed my problem: https://namespaceit.com/blog/could-not-find-mime-type-database-in-the-following-locations-usr-local-share-mime-packages-freedesktop.org.xml

Here's the Ubuntu equivalent of what I did:

sudo update-mime-database /usr/share/mime
sudo apt-get install shared-mime-info
4
  • 1
    Thank you. However, I have tried this, and it doesn't work. Can anyone think of any other possible ways to fix this? Commented Jan 19, 2022 at 23:24
  • Yep, same here, tried it and still getting the problem :( Commented Apr 4, 2023 at 4:06
  • 1
    I had a similar issue on Linux Mint, and had to track down the location of gdk-pixbuf-query-loaders on my machine. (it might be in your /usr/bin, but it wasn't for me). Then I ran: sudo /lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache That fixed my problem. Commented Jul 13, 2023 at 13:39
  • 1
    @mmortal03 Your command fixed my almost similar issue with 22.04 Commented Oct 13, 2023 at 7:20
1

I had been dealing with a similar issue ever since going through the 2032 time crisis updates on a rolling testing, and then subsequently trying to use the replacement for Glade (Cambalache).

From that point forward I had gotten nothing but errors like the following:

Failed to load /org/gtk/libgtk/icons/48x48/path/to/icon.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)

Anything GTK-based that leverage icons or similar resources would either crash, fail to load any icons or images and then crash upon certain actions, or - if developing with GTK and/or Webkit2 - builds would fail, running successfully built binaries would crash at runtime, or webkit2 webviews would refuse to load URIs or perform any kind of network activity (load a live webpage, make ajax requests, etc.).

This issue plagued me for over 6 months. I tried everything even reinstalling gnome. I did everything suggested here and elsewhere.

However, the solution was there all along amongst them all. Here are the steps I took:

  1. Fix XDG_DATA_DIRS

    • If you tried installing Cambalache (or similar software having you customize XDG_DATA_DIRS value, you might have overwrote XDG_DADA_DIRS; Ensure you are doing something like this: export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/usr/local/share:~/.local/share
  2. Fix your mime-types

    • Run the following:
    sudo update-mime-database /usr/share/mime
    sudo apt-get install shared-mime-info
    sudo /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache
    

    The last line is necessary if - as a result of errors during system updates along the way (I'm guilty) - apt failed to call gdk-pixbuf-query-loaders --update-cache

  3. Reinstall Pixbuf (and don't forget that as the OS evolves, packages evolve, and developers are constantly changing, packaging teams constantly change, leadership constantly changes; ABI bumps, package names, packaging style, etc., change as a result):

    • Run the following (If you need to, run sudo apt-cache policy libgdk-pixbuf* to find the name of the package for your system. You're looking for differences like libgdk-pixbuf2 or libgdk-pixbuf-2 versus what's available from your distro's repositories. If a developer; grab developer and binary ⇨ in that order.):
    # Only if a developer or need it for building/compiling:
    sudo apt-get install --reinstall libgdk-pixbuf-2.0-dev
    # Everyone else (developer too):
    sudo apt-get install --reinstall libgdk-pixbuf-2.0-0
    

    NOTE: I'm running this on Debian Trixie (11/28/2024)

  4. Don't forget to source (source ~/.bashrc)!

    • It must be run on the terminal from which you are getting the errors when you try to launch a GTK application in error.
    • You can also just restart your computer.
    • If you source another file full of bash additions, source the root bash profile - not the additions.

The issue was resolved for me after that. I was so frusted for so long because I had missed such a simple step (for me, it was #3 and #4).

0

I dont know what the error means tbh. But I just got the error from an Icon theme failure and I just moved the icon theme out of '/usr/share/icons' into another folder(somewhere like Downloads('~/Downloads/...' or Documents'~/Documents/...'). After that your icon theme should revert to the default and you will be able to use calculator. Hope this is relevant to your problem gl.

0

Had a simliar issue with installing putty on macOS and I had to install the icon theme

sudo port install adwaita-icon-theme

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.