Reputation: 123
I am having an issue starting RStudio (desktop) that I did not have before.
When I fire-up RStudio, within seconds, the grey screen freezes with the following error message:
RStudio Initialization Error Unable to establish connection with R session
Once I click 'OK', I get the following two error messages:
RStudio Unexpected exception: The complexity of the regular expression exceeded predefined bounds...
and...
R encountered a fatal error. The session was terminated.
Any help in resolving these errors is much appreciated.
The "unexpected exception" error reads as though something's going wrong with RStudio trying to run something it's loading automatically as it is starting up. So, the related question is: how can I start RStudio fresh without opening any of the previous files/code/data?
I have tried uninstalling and reinstalling both R and RStudio, and R is installed fine (I can open and work on the R console).
I am working with:
Thank you!
Upvotes: 3
Views: 7893
Reputation: 21
As a FYI to anybody who tried the solution above without success, I ended up updating/reinstalling the xfun
package (install.packages("xfun")
), which resolved this issue for me when resetting my RStudio state did not.
Upvotes: 2
Reputation: 123
Just received word from the RStudio team and their solution worked for me.
Indeed, RStudio is crashing while attempting to open a file you had opened from a previous session. You should be able to work around this by resetting your RStudio state.
The instructions to reset RStudio are here. Relevant excerpts:
RStudio Desktop stores your custom settings and options in a hidden directory called RStudio-Desktop. If this directory does not exist, RStudio will create it on start up. This directory includes user settings, log files, and other state information. Removing (or renaming) this directory will reset RStudio's state analogous to a fresh installation.
We recommend renaming this directory to create a backup version instead of completely deleting it. This allows you to save your settings, in case you want to revert back to them. Additionally, if you experienced a crash or RStudio failed to start, this directory may contain vital information for determining the source of the error. In this case, we recommend renaming this directory to backup-rstudio-desktop and sending it along if asked by RStudio Support.
So, simply removing the ~/.rstudio-desktop
file (actually, renaming it to ~/backup-rstudio-desktop
so that I have a backup) just solved the start-up issue!
Upvotes: 6