Gio info returns (almost) always returns application/octet-stream - affects xdg-open and Loupe

It seems something is wrong in gio when it attempts to detect a file type. It seems almost everything is just application/octet-stream (including pdf, zip, jpg, png). I think this is also the reason why gnome’s new image viewer loupe cannot open any images and errors out with “Could not open image. Unknown image format: application/octet-stream.”. Also xdg-open is broken as a consequence, because it uses gio in the background. It seems almost anything else works properly though on gnome. I don’t even know where to start to debug this. Anyone has any ideas on what to do here?