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 t
This was happening to me as well, but curiously only when I was using Project files (.Rproj - not stand alone R scripts). It was driving me crazy.
I found that buried in the settings (Tools -> Global Options -> Git/SVN) there was a setting "Enable Version Control Interface for RStudio Projects). I guess I had turned that option on when I was messing with my settings and then forgot about it since I don't normally use project files.
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:
.Rproj.user
folder in your project.Rproj.user
folder from syncing with Google drive (Preferences -> sync only these folders)May not be related but might be helpful to someone else. I was getting the same error (over and over) and finally realized that I had an R session open from days ago, that had eventually gotten stuck. It was running in the background with a "Fatal Error" message waiting for me to click OK. When I closed that session everything started working again.