NixOS unusable - no fonts displayed - freedesktop - Fontconfig warning: FcPattern object weight does not accept value [50 200)

almost nothing works anymore

  • kate
  • keepassxc
  • terminal

no fonts are getting shown … only boxes


error examples:


kate

kf5.kservice.services: The desktop entry file "/run/current-system/sw/share/applications/qemu.desktop" has Type= "Application" but no Exec line
kf5.kservice.sycoca: Invalid Service :  "/run/current-system/sw/share/applications/qemu.desktop"
Fontconfig warning: FcPattern object weight does not accept value [50 200)
Segmentation fault (core dumped)

here is a hint that this could be related to changes in freedesktop
freedesktop

Hi,
might be unrelated but… Few days ago I encounter a similar
font issue after a rebuild. A simple fc-cache -fr as users
and root, reboot, and the issue is gone. It was only on one
machine (my not-much-used laptop) so I think it was a transient
problem, then I here another one with similar problem.

– Ingmar

1 Like

Unfortunately, there were multiple regressions when running apps from unstable on 20.03. They should be fixed now but if you encountered the issue your font cache was corrupted and you need to delete ~/.cache/fontconfig.

You should not need to run fc-cache -r as the NixOS module already generates a fontconfig cache. You will only need it when running apps built against incompatible fontconfig versions but you would need to run fc-cache from the same fontconfig package that the programs are linked against and that is just too annoying IMO. Instead I would recommend just updating 20.03 and unstable channels to the latest respective revision and deleting the cache directory.

I could not test both ways
so I did rm -rf ~/.cache/fontconfig

the system state is not yet fixed
– system (eg. apps - like cpu monitor, terminal, browser) is freezing again and again


I don’t know if it is related but I would think so

nix-channel --update

these derivations will be built:
  /nix/store/ajhpj9prr57qqmralhcj01iaq37q3rg2-home-manager-20.03.drv
building '/nix/store/ajhpj9prr57qqmralhcj01iaq37q3rg2-home-manager-20.03.drv'...
error: unsupported builtin function 'unpack-channel'
error: unsupported builtin function 'unpack-channel'
builder for '/nix/store/ajhpj9prr57qqmralhcj01iaq37q3rg2-home-manager-20.03.drv' failed with exit code 1
error: --- Error ----------------------------------------------------------------------------------------------------------------------------------- nix-build
build of '/nix/store/ajhpj9prr57qqmralhcj01iaq37q3rg2-home-manager-20.03.drv' failed
error: --- Error --------------------------------------------------------------------------------------------------------------------------------- nix-channel
program '/nix/store/4mm13plq4fa1w4whkmqbplw10b1x1hhy-nix-2.4pre20200622_334e26b/bin/nix-build' failed with exit code 100

Do you by chance use nixFlakes with channels in home-manager? I would suggest either going fully to flakes or otherwise avoiding channels while the regression is being resolved: https://github.com/nix-community/home-manager/issues/1080

I deleted nixFlakes
(thanks for the advise)


after
switch
garbage collection
switch

it appears to be working again.

it comes again?!
What could be the cause?


does it come back after ever hm-switch?

even without nixFlakes it is freezing (ever few seconds)

there is a(nother) warning
I don’t know where it comes from?

Fontconfig warning: "/etc/fonts/fonts.conf", line 86: unknown element "blank"

That looks like you are still using the old version of NixOS 20.03. You need to upgrade to a revision that includes nixos/fontconfig: Fix compatibility with unstable apps by jtojnar · Pull Request #97441 · NixOS/nixpkgs · GitHub and then remove the cache.

I updated the channel (and removed the cache)
what else would I have to do?


would would be the way to inspect all meta data of the current channel?

I stumbled upon this issue last week.

Jumping on unstable (and staying there) bypassed the issue for me.

I did not perform any manual mitigation.

would would you do/have you done “in code”?