Problem in RStudio - Unable to establish connection

When I opened Rstudio, a message stated that "Error: Unable to establish connection with R session"

anyone know how I fix this issue besides some times it does not respond suddenly.

I had the same problem some time ago. These are some of the reasons for this to occur:

  1. Make sure you have instaled R not jus Rstudio
  2. If you have R and Rstudio instaled, and this problem keeps happening, downgrade the version of Rstudio you are using as the latest may have an error

Hope this helps you

This is very unlikely, otherwise, you would be seen much more of this posts around here, this is more likely a system-specific issue. The first thing to try in this case (after making sure you have R properly installed) is to "reset RStudios state".

If this doesn't solve the problem, please try to provide more information so we can try to help you, for example:

System Information:

  • RStudio Edition: (Desktop or Server)
  • RStudio Version:
  • OS Version:
  • R Version:

Also:

  • RStudio diagnostics report:
  • Your sessionInfo():
  • RStudio crash report:
  • RStudio application log files:

Hi all! I am new to R, following a course and trying to figure things out.

Just 3 days ago I installed R and R Studio for the first time and from the first moment this message pops up... "error: Unable to establish connection with R session"

...even when I just type 1+1 in console. Please note that it started even before I did anything or downloaded any Packages...

Here is some info that might help:

R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats graphics grDevices utils datasets
[6] methods base

loaded via a namespace (and not attached):
[1] compiler_3.6.3 tools_3.6.3

I have Windows 10 Home, and a 64-operating system

Hope this helps...Thank you in advance!!

Thanks for your reply
I already try to resetting Rstudio desktop state, but doesnot fix the problem.

system information:
RStudio edition desktop: Version 1.2.5042
OS version windows 10 pro
R version 3.63. 64 bit

log report:
17 Apr 2020 07:18:35 [rdesktop] ERROR Main window closed unexpectedly; LOGGED FROM: auto __cdecl rstudio::desktop::MainWindow::closeEvent::<lambda_9193e8662378f0135bda1ce57e06be4d>::operator ()(class QVariant) const C:\jenkins\workspace\IDE\windows-v1.2\src\cpp\desktop\DesktopMainWindow.cpp:284
17 Apr 2020 07:20:19 [rdesktop] ERROR Main window closed unexpectedly; LOGGED FROM: auto __cdecl rstudio::desktop::MainWindow::closeEvent::<lambda_9193e8662378f0135bda1ce57e06be4d>::operator ()(class QVariant) const C:\jenkins\workspace\IDE\windows-v1.2\src\cpp\desktop\DesktopMainWindow.cpp:284
17 Apr 2020 07:45:12 [rdesktop] ERROR Main window closed unexpectedly; LOGGED FROM: auto __cdecl rstudio::desktop::MainWindow::closeEvent::<lambda_9193e8662378f0135bda1ce57e06be4d>::operator ()(class QVariant) const C:\jenkins\workspace\IDE\windows-v1.2\src\cpp\desktop\DesktopMainWindow.cpp:284
17 Apr 2020 10:56:36 [rdesktop] ERROR Main window closed unexpectedly; LOGGED FROM: auto __cdecl rstudio::desktop::MainWindow::closeEvent::<lambda_9193e8662378f0135bda1ce57e06be4d>::operator ()(class QVariant) const C:\jenkins\workspace\IDE\windows-v1.2\src\cpp\desktop\DesktopMainWindow.cpp:284
17 Apr 2020 10:57:14 [rdesktop] ERROR Main window closed unexpectedly; LOGGED FROM: auto __cdecl rstudio::desktop::MainWindow::closeEvent::<lambda_9193e8662378f0135bda1ce57e06be4d>::operator ()(class QVariant) const C:\jenkins\workspace\IDE\windows-v1.2\src\cpp\desktop\DesktopMainWindow.cpp:284
17 Apr 2020 15:53:05 [rdesktop] ERROR Main window closed unexpectedly; LOGGED FROM: auto __cdecl rstudio::desktop::MainWindow::closeEvent::<lambda_9193e8662378f0135bda1ce57e06be4d>::operator ()(class QVariant) const C:\jenkins\workspace\IDE\windows-v1.2\src\cpp\desktop\DesktopMainWindow.cpp:284
17 Apr 2020 15:54:31 [rdesktop] ERROR Main window closed unexpectedly; LOGGED FROM: auto __cdecl rstudio::desktop::MainWindow::closeEvent::<lambda_9193e8662378f0135bda1ce57e06be4d>::operator ()(class QVariant) const C:\jenkins\workspace\IDE\windows-v1.2\src\cpp\desktop\DesktopMainWindow.cpp:284

There is nothing evident to me, maybe RStudio IDE developers could give you more specific advice but in the meanwhile, you can check for common sources of troubles.

  • Have you modified your Rprofile.site file? If so make sure nothing there could be causing the problem.
  • Delete any .RData file in your current working directory or the default working directory (be aware that you are going to lose the content of your current environment).
  • Try changing to software rendering, you can change it by holding the Ctrl key while opening RStudio, then you should see this menu and change the "Rendering Engine" to "Software".

Thanks for your response but unfortunately, this action doesn't respond. By the way I tried to use old version and fix the problem.

I think the problem with the newer updates.

I also use Windows 10 pro and I have no problem at all with latest versions of RStudio that is why I still think that your problem is system specific.

You could also try the latest preview release to take advantage of the latest bug fixes for RStudio and see if that helps, you can download it from here

Thanks for the suggestion. I did download the new version of R Studio but the problem still continues. R keeps disconnecting all the time.... haven't found any solution yet and that means I have to copy every command I write unless I want to retype it again and again until it decides to connect back to R....

Thank you for the help... will post a comment on the solution of the problem.... when I find it :wink:

Mine is also doing the same thing- they're the latest versions of Rstudio and R (I've removed and reinstalled yesterday again). I've also done the suggestions from above, but it still persists. I really need it up and running, but am at a loss of what else to do?

platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 4
minor 0.0
year 2020
month 04
day 24
svn rev 78286
language R
version.string R version 4.0.0 (2020-04-24)
nickname Arbor Day

Hello -

I am also having this problem and would love some help! I have tried the solutions suggested above and the problem still persists. I also tried to downgrade my Rstudio and this helped for a bit but then the problem came back. I am also working on a Windows system, could it be a problem with Windows compatibility??

At this point your best chance would be to file a bug report on the github repo

Try to follow their template the best you can otherwise your issue is going to be disregarded.

Please tell me which version of R studio and R you have installed

Please let me know which version of R studio should be installed

Hi¡
For me the problem was solved when I downgraded my version of RStudio to RStudio-1.1.463.
I hope this helps you

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