RStudio Desktop IDE Will Not Start

Follow

The R session failed to start.

Below is a list of common start-up problems. If one of the following does not describe your problem, see the information at the bottom to start a new support discussion.

Check the version of R

RStudio requires R version 3.0.1 (or higher) to run. Make sure your current installation meets this requirement or download it here

Note: On Windows, if you have multiple versions of R installed, you can press and hold Ctrl when starting RStudio to select your version of R.

Check for Startup files

Try removing all startup files such as .Rprofile, .Renviron, and .RData from your initial working directory. The R code within these files may be causing an error (see R Code is Not Working). If RStudio successfully starts after removing these files, try to pinpoint which file resulted in the error. If you are able to determine the source of the problem, please notify us with the details. Be sure to include the steps to reproduce this error (including necessary code) and we'll investigate.

RStudio cannot find R

If you installed R to a non-default location, it is possible RStudio cannot find R on your machine. Open a standard console session (RGui, R.app, Terminal, etc) and type the following command at the console:

> Sys.which("R")

The displayed location must be in your search path for RStudio to successfully bind to your R installation.

Note: On Windows, you can force RStudio to bind to a specific version of R by pressing and holding Ctrl when starting RStudio.

Check firewall, proxy settings, and antimalware

Although RStudio does not require internet access, it does use a localhost connection to link your R session with the RStudio IDE. As a result, it is possible a (software-based) firewall, network setting, or antimalware program is blocking access to RStudio. If you have a firewall, HTTP or HTTPS proxy configured, add localhost and 127.0.0.1 to the list of approved Hosts and Domains. After this, try restarting RStudio. If you have antimalware software configured that may be blocking RStudio, please check its settings and whitelist RStudio if necessary.

Check the permissions on the ~/.rstudio-desktop directory

RStudio saves some session files in the ~/.rstudio-desktop directory - if this directory has its permissions changed, RStudio may not be able to read and write to that folder and may fail to start. Check the permissions and make sure that you have read/write/execute permissions to this folder - if not, change the permissions or reset RStudio's state as described below.

Reset RStudio's state

In some cases, it is necessary to reset RStudio's state analogous to a fresh installation. To do this, see the following Knowledge Base article on Resetting RStudio's State. Note, this will delete all temporary files and unsaved changes made in RStudio. In this case, we recommend creating a backup version as described in the Knowledge Base article.

Using Macports R

To use Macports R with RStudio, you need to install the "R-framework" port. For additional information, see the following Knowledge Base article on Using Macports R with RStudio.

Other Start-Up Problems

If you are still unable to start RStudio and you are using the open-source version, please open a new topic in community.rstudio.com and provide any relevant details as noted below.

System information

Upload a diagnostics report and the output from the associated terminal session to a service like Gist and include the link.

Error information

  • General description
  • The output of RStudio.Version()
  • Error messages
  • Log files (See here)
  • Crash Report (See here)
  • Attempted steps taken to fix
  • Have you successfully launched RStudio in the past?

Return to Troubleshooting Guide: Using RStudio

Comments

  • Avatar
    Phillip Wilshire

    Need help getting error: The R session process exited with code -1073740791.

  • Avatar
    Wladimir de Masi, Jr.

    Hi, Phillip would you please log a support ticket and provide us with your available logs so we can help you better?

  • Avatar
    amelie briane

    Hello, I have the same issue. I tried re-installing R and Rstudio but it is still the same. The last work I did was updating R to 4.2 and starting to create package

  • Avatar
    jin

    Need help

    ## R Session Startup Failure Report

    ### RStudio Version

    RStudio 2022.07.1+554, "Spotted Wakerobin" (7872775e, 2022-07-22) for Windows

    Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

    ### Error message

    [No error available]

    ### Process Output

    The R session exited with code 1.

    Error output:

    ```
    [4480:3248:20220823,213955.468:ERROR crash_report_database_win.cc:586] CreateDirectory C:/Users/而댄벂??/AppData/Local/R/crashpad_database: 파일 이름, 디렉터리 이름 또는 볼륨 레이블 구문이 잘못되었습니다. (123)

    ```

    Standard output:

    ```
    [No output emitted]
    ```

    ### Logs

    *C:/Users/컴퓨터1/AppData/Local/RStudio/log/rsession-컴퓨터1.log*

    ```
    2022-08-23T12:39:55.470473Z [rsession-컴퓨터1] ERROR system error 2 (������ ������ ã�� �� �����ϴ�); OCCURRED AT class rstudio::core::Error __cdecl rstudio::core::crash_handler::initialize(enum rstudio::core::crash_handler::ProgramMode) src/cpp/core/CrashHandler.cpp:322; LOGGED FROM: int __cdecl main(int,char *const []) C:\Users\jenkins\workspace\ide\open-source-pipeline\spotted-wakerobin\src\cpp\session\SessionMain.cpp:2007
    2022-08-23T12:39:55.598564Z [rsession-컴퓨터1] ERROR system error 2 (������ ������ ã�� �� �����ϴ�); OCCURRED AT class rstudio::core::Error __cdecl rstudio::core::crash_handler::initialize(enum rstudio::core::crash_handler::ProgramMode) src/cpp/core/CrashHandler.cpp:322; LOGGED FROM: int __cdecl main(int,char *const []) C:\Users\jenkins\workspace\ide\open-source-pipeline\spotted-wakerobin\src\cpp\session\SessionMain.cpp:2057
    2022-08-23T12:39:55.598564Z [rsession-컴퓨터1] ERROR system error 2 (������ ������ ã�� �� �����ϴ�); OCCURRED AT class rstudio::core::Error __cdecl rstudio::core::crash_handler::initialize(enum rstudio::core::crash_handler::ProgramMode) src/cpp/core/CrashHandler.cpp:322; LOGGED FROM: int __cdecl main(int,char *const []) C:\Users\jenkins\workspace\ide\open-source-pipeline\spotted-wakerobin\src\cpp\session\SessionMain.cpp:2057

    ```

  • Avatar
    Seohyun Ji

    Need help getting error: 19784:19876:20220912,234936.573:ERROR crash_report_database_win.cc:586

  • Avatar
    harwester

    After trying dozens of various fixes and advises on similar issues I'm still having trouble starting Rstudio for the past 6 weeks. First I get the "R not found" window, but after pasting the libR.so into R shared library (/usr/local/lib/R/lib) I get this:

    Process Output:
    The R session exited with code 2.

    Error output:
    unable to initialize the JIT

    And when I delete libR.so from R shared library I get the "R not found" window again. I posted my issues in the community (https://community.rstudio.com/t/r-not-found-r-shared-library-usr-local-lib-r-lib-libr-so-not-found-if-this-is-a-custom-build-of-r-was-it-built-with-the-enable-r-shlib-option/148750/3), but after no responses the topic was closed and when I posted a similar one it was deleted as spam... I'm using linux only for 2yrs and I'm still a rookie as well as in R, and it seems I can't solve this issue.

  • Avatar
    Cecil Singh

    Hi Amelie,

    It might be worth raising this as a ticket with our support team here:
    https://support.posit.co/hc/en-us/requests/new

  • Avatar
    Cecil Singh

    Hi Jin and Seohyun,

    It looks like you're both getting the same error so I'll group your queries into the single response. This looks like a crash report is being generated. There are a number of causes for this, but the most common use case is due to special characters on your local machine.

    You can verify this by creating a local user account with only ASCII characters in the name. When you launch RStudio with this user, you shouldn't see the same issue. Do you mind trying this and letting me know if that resolves the issue?

    This community post contains more detail:
    https://community.rstudio.com/t/rstudio-not-starting-due-to-special-characters-finnish-after-rstudio-update-july-2022/143206/7

    I hope this helps!

  • Avatar
    Cecil Singh

    Hi Harwester.

    It looks like you're referring to linux directories here! Note that this article is for RStudio Desktop Pro, as opposed to RStudio server.

    If there is only one user that runs into this error, then the most likely causes are (1) an R session that cannot be loaded or (2) an issue in your environment. Let's look into each of these possibilities.

    (1) Is the user able to access the Home page of the server via http://:/home? Can the user start a new session from there?

    For context, when you log into RStudio Server, it will first authenticate you, then attempt to load your most recent R session. If that session has become corrupt or otherwise cannot be loaded, you won't be able to complete the login process. However, you should still be able to see the Home page, since no R session is loaded when you log into that page.

    We also recommend that you reset the user state for your username with the instructions here: https://support.rstudio.com/hc/en-us/articles/218730228-Resetting-a-user-s-state-on-RStudio-Server. This will clear out your user sessions and let you log in cleanly (this won't clear the files on disk; it only clears out the workspace information RStudio stores - that article explains in detail).

    (2) Is there anything in your Linux bash profile that may interfere with RStudio's ability to launch an R session on your behalf? This section of the admin guide explains how R sessions are launched: https://docs.rstudio.com/ide/server-pro/r-sessions.html#customizing-session-launches. If there is anything R-related in your bash profile that is invalid to the R installation on the server, RStudio won't be able to launch an R session on your behalf.

    To test, you can disable execution of the shell profiles on the entire server by setting the rsession-no-profile option to 1 in /etc/rstudio/rserver.conf and then restarting the server. For example:

    /etc/rstudio/rserver.conf
    rsession-no-profile=1

    This will turn it off for everyone on the server, so if you actually rely on those profiles to set up user environments, you may want to remove that line after the test is complete.

    I hope this helps point you in the right direction!

  • Avatar
    harwester

    Hi Cecil,
    I guess there's been a misunderstanding. I don't know why you assumed I'm using RStudio Server because I don't. For the past 5yrs I use only RStudio Desktop mainly for data visualization and some statistical analysis in Windows until I finally moved exclusively to Linux Mint 2 yrs ago. So the solutions you're referring to aren't very helpful. But thanks anyway, at least someone finally replied.

  • Avatar
    Cecil Singh

    Hi Harwester,

    My apologies! Given the file paths I had assumed you were using RStudio server on Linux - my bad! Typically, with this error message, resetting user state should help resolve this issue:
    https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-Desktop-s-State

    Failing that, upgrading to the latest version of RStudio desktop certainly helps in the cases I've seen.