rstudio / rstudio

RStudio is an integrated development environment (IDE) for R
https://posit.co/products/open-source/rstudio/
Other
4.63k stars 1.09k forks source link

RStudio broken again in WSL Ubuntu. #14971

Open abalter opened 1 month ago

abalter commented 1 month ago

System details

RStudio Edition : Desktop
RStudio Version : 

image

OS Version      : 

image

R Version       : 
(base) balter@expiyes:~$ R --version
R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-conda-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.

Steps to reproduce the problem

Download the .deb file.

sudo gdebi <filename>

Describe the problem in detail

RStudio loads, but the UI is unusable. It always opens shifted to the right like in the picture. The window controls don't work. The menu items don't work.

This is how all versions of Rstudio have been for me for at least a year in various versions of Ubuntu under WSL 2 on different machines.

It works for a while, but then something starts to interfere with the UI.

image

(base) balter@expiyes:~$ rstudio
[9820:0715/211451.894720:ERROR:gl_factory.cc(120)] Requested GL implementation (gl=none,angle=none) not found in allowed implementations: [(gl=egl-angle,angle=default),(gl=egl-gles2,angle=none)].
[9820:0715/211451.897254:ERROR:viz_main_impl.cc(198)] Exiting GPU process due to errors during initialization
[9909:0715/211452.447405:ERROR:gl_factory.cc(120)] Requested GL implementation (gl=none,angle=none) not found in allowed implementations: [(gl=egl-angle,angle=default),(gl=egl-gles2,angle=none)].
[9909:0715/211452.453504:ERROR:viz_main_impl.cc(198)] Exiting GPU process due to errors during initialization
[9901:0715/211452.534146:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.

Describe the behavior you expected

I expect RStudio to run properly.

NOTE:

I created a WSL2 instance with Ubuntu 22.04 and installed rstudio-2024.07.0-316-amd64.deb. It runs properly. So this appears to be an issue with RStudio in Ubuntu 24.04.

NOTE 2:

In fact, it's not working. I'm getting the same problem.

However, I managed to find a setting in the config.json file that repeatedly causes the problem. I need to go to sleep. I will update with the information tomorrow.

ronblum commented 1 month ago

@abalter Thank you for raising this. Just to summarize--please let me know if I've got this right.

1) The problem occurs with RStudio Desktop 2024.07.0, but was also failing in previous releases. 2) The problem occurs consistently with Ubuntu 24.04. 3) Thing were briefly working fine with Ubuntu 22.04, but then the problem returned.

Also, if you let us know what setting seemed to be causing the problem, that would be very helpful! After you get some sleep, of course. 😴

ronblum commented 1 month ago

@abalter I'll also check with my colleague who routinely uses WSL, not the version provided directly by Ubuntu, if he's ever seen the problem.

abalter commented 1 month ago

@ronblum -- so I've had this problem multiple times. I think I've probably reported it before. And I could always temporarily fix it by following the "reset rstudio desktop" steps. This time I dug a little deeper and found that I could reproduce the error and also fix it by making a small edit to the ~/.config/rstudio/config.json file.

I am able to reproduce this error in both my Ubuntu 22.04 and 24.04 instances just by installing the current rstudio .deb file from the Posit instructions as well as various files from the "dailies".

I made a video because that somehow seemed easier for my brain right now: https://www.youtube.com/watch?v=Q_0KAsI659o

Would you like me to file this as an explicit bug?

NOTE:

I haven't determined exactly which types of settings changes cause maximize: true and the strange x,y settings to occur. But if I mess with the global settings enough, I can cause it to break. Then I can fix it by manually fixing those settings in config.json.

ronblum commented 1 month ago

@abalter Thank you for the very helpful video, including the helpful comments. I was able to reproduce the problem. I think that "nearly impossible to work with" would be a fine summary. I'll mark this for review.

Side note: The topic of the project that you're working on seems very interesting. 🙂

ronblum commented 1 month ago

Another way to reproduce:

  1. Maximize the window.
  2. Try to unmaximize it
    • IDE goes back to normal size briefly, then back to maximized.
  3. Try to unmaximize it
    • IDE goes back to normal size briefly, then back to maximized and offset.
jthomasmock commented 3 weeks ago

Hi @abalter -- thanks for opening this issue!

It seems you do have a workaround for the time-being (modifying the config.json). I'm putting this one into later for now as we don't currently support WSL and don't yet have it on our roadmap relative to continued support for Windows desktop, Linux, or Mac.

abalter commented 3 weeks ago

Sorry. I'll respond tomorrow 8/1

abalter commented 3 weeks ago

@ronblum --- Nice work finding that. I'm guessing I did those exact steps as well at some point just trying to make the darn thing work.

I'm starting a nonprofit for autistic adults in Oregon.

@jthomasmock --- With recent developments, WSL2 is pretty close to bare-metal Linux. I suspect the issue is arising through X11 emulation. Here are some ideas for tests that would determine if that is correct:

  1. Try MobaXTerm
  2. Try VcXServ
  3. Try using over VNC
  4. Try running a desktop environment

I can't think of any reason why Linux would write weird things to the config.json file in WSL2 vs bare metal other than due some response to the X11 server.