Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RStudio project "cannot find the file specified" on R session restart

Tags:

r

rstudio

I am getting strange and annoying behavior in one (yes, only one) of my RStudio projects. Whenever I restart the R session within this project, I can no longer save any of the files, and when I try to (or RStudio tries to automatically) I get a popup error saying "The system cannot find the file specified" and I have to reopen the project and all of the R scripts.

I looked at the log file, and I see a lot of the following error:

07 Oct 2015 00:52:05 [rsession-Mark] ERROR system error 5 (Access is denied) [path=C:/Users/Mark/GoogleDrive/Research/CEQUAL_event/.Rproj.user/5E5F98D9/sdb/s-26E44539/lock_file];
OCCURRED AT: bool rstudio::core::FilePath::exists() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:308;
LOGGED FROM: bool rstudio::core::FilePath::exists() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:308

It looks like the problem may be in the .Rproj.user folder. So I deleted that and let RStudio regenerate it, but the behavior started right back up again.

I am using Windows 7, RStudio version 0.99.441, and R version 3.2.2.

like image 670
MarkH Avatar asked Oct 07 '15 01:10

MarkH


1 Answers

I think @Jack Wasey is right: Google drive locks files during sync. This causes many issues with other programs as well. There are alternatives from companies that do file syncing for a living, such as dropbox, whose clients don't lock files. With google drive you only have the option to use selective sync and exclude every .Rproj.user folder. Once the RStudio's database is corrupted, moving the project out of the Google drive folder won't be enough - you will need to delete/rename it to have RStudio fix its database.

Summary:

  1. Copy contents from all unsaved files to a temp file outside of RStudio (while clicking away the error message every other second)
  2. Quit Rstudio
  3. Pause Google drive syncing
  4. Rename (or move/delete) the hidden .Rproj.user folder in your project
  5. Reopen the project in Rstudio
  6. Exclude the new .Rproj.user folder from syncing with Google drive (Preferences -> sync only these folders)
  7. Remember that Google drive is free / Become an awesome google developer and fix the issue once and for all
like image 155
jan-glx Avatar answered Oct 20 '22 02:10

jan-glx