Rstudio Hangs git project

Hello RStudio community,

My RStudio hangs when I am trying to work within an Rproject which is version controlled by git. I first noticed the issue a few day ago and I haven't been able to troubleshoot. I have read many requests for similar issues on this website and stackoverflow/exchange that haven't been resolved. In an attempt to fix I have done the following: updated Rstudio to version 1.2.5042, updated R to version 4.0, switched my rendering engine to software, created a new .Rproj.user folder, and investigated my R request log. I do not know much about the log, but it appears the git_all_status is taking a significant amount of time. I am currently waiting for something to run in console (no stop sign or responses to esc or ctrl+c) and the log claims git_all_status is active. I think my problem is possibly related to this thread: https://github.com/rstudio/rstudio/issues/2141, but I do not really know what that thread is suggesting to do as a solution. Also, I am working on a MAC and not Windows. Any advice would be greatly appreciated!

You need to provide some more information for us to help. When do you run into the problem? When setting up a project based on a Git repository, when trying to clone it, or when you are running it? Can you clone the Git repository using the terminal?

That is part of the problem is there is not much consistency in when it occurs except for it appears to only be happening in one of two projects that I frequently work in. My general workflow is as I'm editing in a script I will use CMD+Enter to run something, then when it is sent to the console it hangs up. However, there is no one function that seems to cause the problem to occur.

I can clone the repository from GitHub in terminal

In that case, it is probably unrelated to the fact that you are using Git for the project. I run into the same problem when I, for example, are trying to view a complex data frame. Next time it happens can you check the Activity Manager and whether rsession is running to 100% of CPU.

I have been checking the Activity monitor constantly. I haven't thought that it was an issue because the CPU load has been low. For example currently I have been waiting for at least 30 minutes for Rstudio to respond. The CPU load for User is ~17% and the rsession is using 100% of that. Will it still cause a hang up if I am not maxing my CPU? Also, I have been running larger jobs in terms of object sizes within this project for weeks before this issue started.

To follow up, the R log for the hang up is all saying git_all_status (active). Do you have any resources for understanding this R log? I have tried just googling git_all_status and there are no results.

Not directly. You could try to start a new project without the Git part and see if you run into the same problem. The connection to Git should not represent a problem unless you are actively communicating with the Git repository. This is more likely a problem with the R script and RStudio. Lot of people seem to have things hang, sometime apparently randomly (not that that helps you very much).

I think the git_all_status(active) in the log is indicating that Rstudio is trying to actively communicate with git. I've read on a couple other threads that Rstudio automatically runs git status (e.g., see this comment)

Do you happen to have large files under version control in your project? There are precedents of sessions hanging because of this.

No, I do not. The project folder on my computer is 2.6 MB

But the git status command should not be called when you run a line of code, which is what you said caused the problem. To be certain, set up a new project, copy everything but the Git information over and try whether you get the same problem. If you do, it is definitely not the Git part.

We've had some issues of this form reported when the .git directory became un-hidden, for some reason. Is that directory marked as hidden in your project? (Sorry, this may not be relevant unless you're running on Windows.)

Does git status run in a timely manner from a terminal, outside of RStudio? You might also check whether there is a file .git/index.lock -- if that exists, you might try removing it.

In terminal, git status runs instantly. I have a .git/index file, but it doesn't appear to have an extension.

I will add for completeness that I did have an html file open that is part of the project when the issue happened today and probably for a majority of the other instances, but I can't guarantee.

I appreciate the discussion and agree that it is probably specific to this project so transferring the scripts to a new project space would be the best way forward. It would be nice to be able to troubleshoot, but there are so many inconsistencies that I might not be able to communicate the right information.

Not sure if this is related, or whether this problem has been fixed, but Rstudio can be very slow if your git repo is on a remote server/shared drive. It runs git commands in the background to keep the git pane up to date, and this remote nature can make it very slow. Maybe here a git status that is occurring in the background is lagging?

The repo is not on a remote server or shared drive, but thanks!

I reached out to @lbergmans of this thread and he sent me to a follow up on github where the issue was tracked down to use of the Rfast package. I will be removing all instances of Rfast from project

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