RStudio launches and immediately crashes: Qt, Wayland, and X11 could be the culprits

Hi.

My RStudio installation is not working.

The problem

  • If I use the Gnome launcher (super key and then choose the app), a black window briefly (~1 second) opens and closes. That’s it.
  • If I open the terminal and type “RStudio”, the very same behavior happens, except I also get these messages on the terminal:
TTY detected. Printing informational message about logging configuration. Logging configuration loaded from '/etc/xdg:/home/agua/.nix-profile/etc/xdg:/etc/profiles/per-user/agua/etc/xdg:/nix/var/nix/profiles/default/etc/xdg:/run/current-system/sw/etc/xdg:/nix/store/z9rfyhx98qda8prk3p3296clyjhdkv98-gnome-settings-daemon-44.1/etc/xdg/rstudio/logging.conf'. Logging to '/home/agua/.local/share/rstudio/log/rdesktop.log'.
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
/nix/store/g5irs0pl552wrac1l4rclcb3nmlf0fiq-gvfs-1.50.4/lib/gvfs/libgvfscommon.so: undefined symbol: g_task_set_static_name
Failed to load module: /nix/store/g5irs0pl552wrac1l4rclcb3nmlf0fiq-gvfs-1.50.4/lib/gio/modules/libgvfsdbus.so
libGL error: MESA-LOADER: failed to open iris: /nix/store/2j8jqmnd9l7plihhf713yf291c9vyqjm-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/5zzbdhg945bafahn0x9xwsx8rm1f615d-llvm-15.0.7-lib/lib/libLLVM-15.so) (search paths /run/opengl-driver/lib/dri, suffix _dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast: /nix/store/2j8jqmnd9l7plihhf713yf291c9vyqjm-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/5zzbdhg945bafahn0x9xwsx8rm1f615d-llvm-15.0.7-lib/lib/libLLVM-15.so) (search paths /run/opengl-driver/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.
QGLXContext: Failed to create dummy context
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile) 
[3:3:0100/000000.968048:ERROR:zygote_linux.cc(607)] Zygote could not fork: process_type renderer numfds 3 child_pid -1
[3:3:0100/000000.968132:ERROR:zygote_linux.cc(639)] write: Broken pipe (32)
Aborted (core dumped)

Some details

  • I just upgraded to 23.05.
  • I could use RStudio before (the upgrade?).
  • My configuration.nix is the same since the previous stable channel on Nix. I haven’t touched it.
  • On my configuration.nix file, I have rstudioWrapper, rPackages.tidyverse, and rPackages.snakecase installed. This way of installing R packages, even though it didn’t appear on the documentation, worked. I have tried uninstalling both rPackages and rebuild, with no success.
  • I tried commenting out the rstudioWrapper and adding rstudio, so that after a rebuild I could see whether it was that particular package that gave me a problem. I was not lucky. Both packages give me the black screen and the errors.

I searched online and saw changing the window manager could help. I’ll try fiddling around with this. Would activating Wayland be helpful? Would it be problematic? I’ll search, but for now, this is in my configuration.nix regarding my window manager:

  # Enable the X11 windowing system.
  services.xserver.enable = true;
        
  # Enable the GNOME Desktop Environment.
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;
        
  # Configure keymap in X11
  services.xserver = {
    layout = "us";
    xkbVariant = "";
  };

My hope

I upgraded my Nix channel because Tutanota Desktop was not working. This prevents me from going back to the previous state.

Ideally, I could fix the RStudio issue on its own.

I’m thinking about reinstalling NixOS from scratch, in case there are some settings that I’ve been dragging since the previous NixOS version. I would only copy and paste my programs from the configuration.nix. Maybe this is unnecessary…

Regardless, any help would be appreciated.

Thanks!