cannot launch rstudio after upgrade

I've just updated rstudio from 2022.07 to 2022.12, and now it won't launch. I've already backed up and removed config dirs and .Rprofile. I have set $RSTUDIO_WHICH_R (which has worked in the past). As you can see here, R loads fine in a terminal:

$ which R
/opt/miniforge3/envs/sys/bin/R
$ echo $RSTUDIO_WHICH_R 
/opt/miniforge3/envs/sys/bin/R
$ R --version
R version 4.2.2 (2022-10-31) -- "Innocent and Trusting"
Copyright (C) 2022 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/.

But running rstudio does not work.

Here is the result of rstudio --run-diagnostics:

$ rstudio --run-diagnostics
[380454:1227/113742.880938:ERROR:gpu_init.cc(481)] Passthrough is not supported, GL is desktop, ANGLE is 

Attempting to launch R session...
 . RSTUDIO_WHICH_R = /opt/miniforge3/envs/sys/bin/R
 . R_HOME = /opt/miniforge3/envs/sys/lib/R
 . R_DOC_DIR = /opt/miniforge3/envs/sys/lib/R/doc
 . R_INCLUDE_DIR = /opt/miniforge3/envs/sys/lib/R/include
 . R_SHARE_DIR = /opt/miniforge3/envs/sys/lib/R/share
 . PATH = /home/maskedusername/.rbenv/shims:/home/maskedusername/.rbenv/bin:/opt/miniforge3/envs/mnedev/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/fsl/bin:/opt/freesurfer/mni/bin:/opt/miniforge3/condabin:/opt/node_global/bin:/opt/fsl/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/miniforge3/envs/sys/bin
 . HOME = /home/maskedusername
/usr/lib/rstudio/resources/app/bin/rsession: error while loading shared libraries: libR.so: cannot open shared object file: No such file or directory

R session launched, attempting to connect on port 27811...

Connected to R session, attempting to initialize...

(node:380411) UnhandledPromiseRejectionWarning: TypeError: Object has been destroyed
    at r (/usr/lib/rstudio/resources/app/.webpack/main/index.js:17:75458)
    at /usr/lib/rstudio/resources/app/.webpack/main/index.js:17:75677
    at async t.handleLocaleCookies (/usr/lib/rstudio/resources/app/.webpack/main/index.js:17:75598)
(Use `rstudio --trace-warnings ...` to show where the warning was created)
(node:380411) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)

it says it cannot open libR.so, but it's definitely there:

$ ls -l /opt/miniforge3/envs/sys/lib/R/lib/libR.so
-rwxrwxr-x 2 maskedusername maskedusername 3777592 Dec 19 03:09 /opt/miniforge3/envs/sys/lib/R/lib/libR.so

Here's the "problem report":

R Session Startup Failure Report

RStudio Version

RStudio 2022.12.0+353 "Elsbeth Geranium " (7d165dcf, 2022-12-03) for Ubuntu Jammy

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2022.12.0+353 Chrome/102.0.5005.167 Electron/19.1.3 Safari/537.36

Error message

[No error available]

Process Output

The R session exited with code 127.

Error output:

/usr/lib/rstudio/resources/app/bin/rsession: error while loading shared libraries: libR.so: cannot open shared object file: No such file or directory

Standard output:

[No output emitted]

Logs

Log File

[No logs available]

What am I doing wrong here? How can I get RStudio to initialize?

This might be a Brand X problem. It may be worth your while to install from the official source, reset the $PATH to raise its precedence and see if the problem persists.

You are correct that using a system-level install of R allows rstudio to launch. But I don't consider that an acceptable solution given that reproducibility of software environments is a best practice for modern science, which means maintaining separate installations of R for different projects. anaconda/conda/mamba are widely used for this purpose, worked before with the 2022.07 version (and prior versions), and should continue to work.

After some more poking around I was able to get a working IDE by installing rstudio-desktop through conda/mamba. It doesn't have the nice OS integrations that the apt package has, and it seems inefficient to have to install copies of the IDE separately into every project's environment, but at least it works. :person_shrugging:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.