R studio Javascript Alert R encountered a fatal error - r

Issue description
When opening R studio, after about 10 seconds, I get a popup alert:
Javascript Alert-http://127.0.0.1:40055/
R encountered a fatal error.
The session was terminated.
If I click the OK button on the alert I get another alert:
Javascript Alert-http://127.0.0.1:40055/
null
After clicking OK again, I get the error in the console:
Error: Unable to establish connection with R session
I cannot run anything (it just has the flashing cursor permanently). I cannot click any options (e.g. if I click Tools -> Global options, then the drop down closes without doing anything).
What I have tried
Restarting my computer.
Reinstalling R and R studio.
Removing the project and history files associated with the project.
Uninstalling all my packages (I presume unnecessary but I was getting desperate).
Moving the config file mv ~/.config/RStudio ~/backup-RStudio (from https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-Desktop-s-State). I also tried moving .rstudio-desktop, but that didn't exist.
Possibly useful information
The error first started after I tried to compile and run C code in R. I think I made an infinite loop, either way it crashed R and I xkilled it. R still runs fine from the terminal.
Versions
R version 3.6.3 (2020-02-29)
rstudio version 1.4.1103
Ubuntu 20.04.2 LTS
Any help would be much appreciated!

I had a very similar error message:
Javascript Alert: R encountered a fatal error. The session was
terminated.
For me this error occurred after changing from the 64-bit to 32-bit versions of R. I tried:
restarting my machine
uninstalling/reinstalling Rstudio
installing an older version of Rstudio which has been more stable in the past
None of these worked for me, but when I deleted my ".Rhistory" file in my home directory the error message disappeared and I'm now able to run my scripts again.
Additional info:
I'm using Windows 10, Rstudio Desktop 1.4.1717 and R4.1.0 (32 and 64 bit versions)
Update: Rstudio showed the same error message again, but resetting the RStudio Desktop's state helped.

Related

R memory issues after reinstall

I have been running several R scripts without issue until one day I tried to open RStudio and it said "Fatal error: unable to open base package in R." I uninstalled and reinstalled both R and RStudio, which solved that issue. However, now when I run one of the R scripts that I had been running previously, I get a "cannot allocate vector of size" error (this is a modeling script with several models and iterations).
Additionally, when I try to load a very large dataset, I was previously able to load it with the line memory.limit(size=18000). Now, it doesn't let me set it to anything above 4000, so I cannot load the dataset. I get the error "Error in memory.limit(size=18000): don't be silly!: your machine has a 4Gb address limit"
I am currently running RStudio 2021.09.2 and R 4.1.2. Before the reinstall, I believe I was running RStudio 1.4.1106 and R 4.1.0.
Thank you.
I had a very similar issue, and it turned out that after updating RStudio, it defaulted to using the 32-bit version of R instead of the 64-bit one. Once I switched it to the 64-bit one in RStudio, the memory issue stopped.
To do this, in RStudio on Windows go to Tools > Global Options and then change the R version... drop-down to the appropriate one installed on your system.

Fatal error: unable to initialize JIT - R 3.5.1 and RStudio 1.4463

I recently decided to upgrade both R and RStudio on my PC, 64-bit version.
First, I uninstalled the previous versions, RStudio 1.4462 and R 3.4.4, and then I installed R 3.5.1 and RStudio 1.4463, in the order here mentioned.
The installation goes just fine, but when I try to open R from the desktop shortcut I receive an error message saying:
Fatal error - unable to initialize JIT
The same thing happens with RStudio.
I click OK on the message (it's the only thing I can do) and R closes immediately, same for RStudio.
What could cause this issue? I looked around the internet but I couldn't find anything useful.
Not sure the cause of the JIT error, but in case anyone stumbles upon this thread later, I was able to overcome this issue by reinstalling the same version of R (4.1.0 in my case) on my machine, overwriting the old version. Doing so seemed to maintain all my previously installed packages too. Now R & Rstudio works fine on start-up. Give it a try!

Can't open R studio error "retrieving package installation contex"

I can't open r studio.
I tried to start R studio. First the statdart Windows error is appear
RStudio R Session has stopped working
I choose "Close the program". Then Rstudio starting with error
R encaunared fatal error
This session was terminated
But session continues. Next appear "null" and continues. After that appear error
retrieving package installation contex
It is continues long time. After hard closing of session the same situation is repeated.
Before that bad cicle R studio was closed with q() command. And computer was restarted.
How to exit from that cicle?
I replaced .Rhistory file (in working directory) with old version of the file and RStudio started correctly.

Rstudio encountered a Fatal Error on startup

I recently upgraded R to 3.4.3 and RStudio to 1.1.383. After installation I got the <p> R encountered a fatal error.</p>The session was terminated bug.
I've followed the instructions here on fixing startup problems, this similar question on stack overflow, and other RStudio support forums and none have been able to fix the error.
My R version is running fine in the terminal and is the most recent version
When I remove the ".rstudio-desktop", ".Rpofile", and ".Rhistory" files and start Rstudio it no longer uses my themes but now encounters a "Fatal Session" bug but when I restart my session it just keeps getting the bug.
I've restarted my computer and re-installed Rstudio with no luck with anything.
I've included a diagnostic report here; there are a decent number of errors but I'm not sure what they really mean.
Any help would be greatly appreciated.
I was able to fix this by deleting the R and Rstudio apps, the R frameworks, and the rstudio-desktop folder and reinstalling both apps.

R package "repmis" crashes R on library(repmis)

I tried installing a list of packages this morning and had an error which crashed R when I ran library(repmis)
install.packages("repmis")
library(repmis)
I've uninstalled & reinstalled R (on my mac by deleting the app and downloading the new build), but still get an app crash when I run library(repmis).
Can anyone tell me why? And/or how I can more effectively uninstall R to get this package to work again?
Problem solved, I restarted the computer and repeated the procedure above and this time received a prompt to install a Java 6 runtime.
I'm guessing that the dialogue box had issues displaying earlier because of some system printer windows I had open.

Resources