Electron apps broken after update

I updated my BIOS for the first time in years, and now half of the GNU packages don’t work. Working examples: Firefox and Steam. Broken examples: VS Code and Obsidian. I tried rolling back to an earlier version of NixOS but with the same problems.

The obvious newbie solution is to remove and then reinstall any faulty programs, but that didn’t work. It’s something deeper. Maybe in hardware-configuration.nix?

I’m lost. Where should I start looking to find the root cause?

nix-shell -p nix-info --run "nix-info -m

  • system: "x86_64-linux"
  • host os: Linux 6.6.47, NixOS, 24.05 (Uakari), 24.05.4248.2527da1ef492
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.18.5
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

To regenerate your config, you should do sudo nixos-generate-config /

I’m curious, what is the error that you’re getting when you try to run the faulty apps e.g. from console?

Since NixOS tries to guarantee reproducibility, this is doomed to not work. Unless there is a config/cache issue ofc.

Launching from the console:

[ian@nixos:~/.nixos_working]$ obsidian

2024-08-31 20:04:04 Loading updated app package /home/ian/.config/obsidian/obsidian-1.6.7.asar
2024-08-31 20:04:04 Checking for update using Github
2024-08-31 20:04:04 Success.
2024-08-31 20:04:04 Latest version is 1.6.7
2024-08-31 20:04:04 App is up to date.
DRM kernel driver ‘nvidia-drm’ in use. NVK requires nouveau.
[8590:0831/140404.811290:ERROR:shared_image_representation.cc(316)] Unable to initialize SkSurface
[8590:0831/140404.811354:ERROR:gpu_service_impl.cc(1105)] Exiting GPU process because some drivers can’t recover from errors. GPU process will restart shortly.
[8303:0831/140404.827313:ERROR:gpu_process_host.cc(993)] GPU process exited unexpectedly: exit_code=8704
DRM kernel driver ‘nvidia-drm’ in use. NVK requires nouveau.
[8627:0831/140405.045219:ERROR:shared_image_representation.cc(316)] Unable to initialize SkSurface
[8627:0831/140405.045266:ERROR:gpu_service_impl.cc(1105)] Exiting GPU process because some drivers can’t recover from errors. GPU process will restart shortly.
[8595:0831/140405.047599:ERROR:command_buffer_proxy_impl.cc(127)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[8303:0831/140405.061297:ERROR:gpu_process_host.cc(993)] GPU process exited unexpectedly: exit_code=8704
DRM kernel driver ‘nvidia-drm’ in use. NVK requires nouveau.
[8648:0831/140405.246260:ERROR:shared_image_representation.cc(316)] Unable to initialize SkSurface
[8648:0831/140405.246321:ERROR:gpu_service_impl.cc(1105)] Exiting GPU process because some drivers can’t recover from errors. GPU process will restart shortly.
[8595:0831/140405.248936:ERROR:command_buffer_proxy_impl.cc(319)] GPU state invalid after WaitForGetOffsetInRange.
[8303:0831/140405.263242:ERROR:gpu_process_host.cc(993)] GPU process exited unexpectedly: exit_code=8704
DRM kernel driver ‘nvidia-drm’ in use. NVK requires nouveau.

It appears Obsidian is actually launching, but the first window does not appear. If I open a second window, it appears. I’ve been getting these DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau. consistently even before this mess. I can’t seem to solve Nvidia GPU issues completely, even with everything mostly working.

Strangely, if I log out of my profile, and into a dummy user, Obsidian launches normally.

Launching VS Code:
[ian@nixos:~/.nixos_working]$ code .

Warning: ‘ozone-platform-hint’ is not in the list of known options, but still passed to Electron/Chromium.
Warning: ‘enable-features’ is not in the list of known options, but still passed to Electron/Chromium.

Code errors are different from Obsidian. It just doesn’t launch at all. Unless I’m getting the launch terms wrong. code . is what I used in windows before starting this migration.

And, just to keep things fun: a different set of errors for Discord:
[ian@nixos:~/.nixos_working]$ discord

[Nix] Disabling updates already done
Discord 0.0.63
Starting app.
Starting updater.
2024-08-31T20:08:39.029Z [Modules] Modules initializing
2024-08-31T20:08:39.029Z [Modules] Distribution: remote
2024-08-31T20:08:39.029Z [Modules] Host updates: disabled
2024-08-31T20:08:39.029Z [Modules] Module updates: enabled
2024-08-31T20:08:39.029Z [Modules] Module install path: /home/ian/.config/discord/0.0.63/modules
2024-08-31T20:08:39.029Z [Modules] Module installed file path: /home/ian/.config/discord/0.0.63/modules/installed.json
2024-08-31T20:08:39.029Z [Modules] Module download path: /home/ian/.config/discord/0.0.63/modules/pending
splashScreen.initSplash(false)
CDM component API found
blackbox: 2024-08-31T20:08:39.193Z 0


CDM completed with status: cdm-ready-success
blackbox: 2024-08-31T20:08:39.210Z 1 Discord starting: {“releaseChannel”:“stable”,“version”:“0.0.63”}, modulepath: /home/ian/.config/discord/0.0.63/modules
blackbox: 2024-08-31T20:08:39.215Z 2 :white_check_mark: webContents.created web1 “”
blackbox: 2024-08-31T20:08:39.219Z 3 :white_check_mark: window.created win1 “discord”
[8879:0831/140839.232850:ERROR:wayland_event_watcher.cc(68)] Fatal Wayland communication error: Connection reset by peer.
[8879:0831/140839.232897:FATAL:electron_browser_main_parts.cc(502)] Failed to shutdown.
Trace/breakpoint trap (core dumped)

What other apps are broken, I’m noticing that all of these ones are electron apps (though i’m not sure what steam is?), maybe some electron dependency got screwed up with the change

Steam is CEF, not electron, so that tracks

I had never heard of an Electron app until now, so that’s something.

I’ve just tried switching from linuxPackage (6.6) to linuxPackage_latest (6.10). The problems persists.

Hear are my next set of “trying things and hoping something works”:

  1. Switch DEs from GNOME to KDE
  2. Rolling back the BIOS update
  3. Wiping the HDD and starting again
  4. Giving up all hope and returning to my Microsoft overlords :face_vomiting:

1 and 2 do not seem like particularly fruitful options.
If they’re only electron apps affected, you can try deleting ~/.config/<whatever>/GPUCache, sometimes that helps (most electron apps store their data in ~/.config)

Tried: deleted the entire folder contents for Discord, Elements, and Obsidian as found in the ~/.config and ~./local folders
Result: no change. The contents were replaced after reboot and running the applications again.

I’m moving on to Option 3: erase the hard drive and start again.

UDPATE:
I’m closer to the problem. After wiping the drive and rebuilding system VS Code ran fine, except I was receiving a Keyring error. Something like “Keyring does not match login password”. It rejected my login password although it’s the only one I’ve set up since starting.

This post suggested the fix was:

environment.variables.XDG_RUNTIME_DIR = "/run/user/$UID"; # set the runtime directory

I tried that, which then caused VS Code to stop working with the same error as previously:
[ian@nixos:~/.nixos_working]$ code .

Warning: ‘ozone-platform-hint’ is not in the list of known options, but still passed to Electron/Chromium.
Warning: ‘enable-features’ is not in the list of known options, but still passed to Electron/Chromium.

I then removed the above line and ran nixos-rebuild, but the problem hasn’t resolved. Note, I also tried with, and without, the other code block referenced:

  services.gnome.gnome-keyring.enable = true;
  programs.seahorse.enable = true; # enable the graphical frontend
  environment.systemPackages = [ pkgs.libsecret ]; # libsecret api needed
  security.pam.services.gdm.enableGnomeKeyring = true; # load gnome-keyring at startup

which all seems to provide me with the correct keyring configuration
ps aux | grep gnome-keyring-daemon

user1 1968 0.0 0.0 311520 6708 ? Sl 15:06 0:00 /nix/store/grp8lr0h0hwflb21arri2yddkbjjzv2c-gnome-keyring-46.2/bin/gnome-keyring-daemon --daemonize --login
user1 3883 0.0 0.0 6684 2688 pts/0 S+ 15:08 0:00 grep gnome-keyring-daemon

Any ideas on where to start?