This has started a couple of weeks ago. I get this message on launching Rstudio:
Warning message:
File monitoring failed for project at "/directory/of/last/opened/project"
Error 24 (Too many open files)
Features disabled: R source file indexing, Connect, Diagnostics
It is pretty consistent and I think it is telling the truth, i.e. that an operating system out of file handles warning has been triggered by launching Rstudio (and hence R). I say that because if I launch Rstudio after running a lot of other things it's 100% reliable but if I launch Rstudio before other things it doesn't come up.
If I am just launching R from the command line I never see it and no other programs seem to create it. I assume that it's the combination of R and Rstudio that is greedy enough for file handles to trigger this.
I am reporting it here for a few reasons:
I suspect it's useful for the Posit team to know of it
I am surprised that the message references the last opened project despite that project not being opened and often not being at all the most recent thing I had used in Rstudio
I am hoping that someone has some advice about how to up the ulimits to avoid the message (and the loss of Rstudio features).
I am running Rstudio (Free version, 2024.12.0 Build 4672024.12.0 Build 467) on Tuxedo.os (Linux tuxedo-os 6.11.0-108014-tuxedo #15~24.04.1tux2 SMP PREEMPT_DYNAMIC Fri Jan 17 14:36:48 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux) I had ulimit -n at 1024 and ulimit -s at 8192
With a lot of searching around what appear to be outdated instructions about how to reset these limits and a some reboots of the machine I can confirm I have not got these at 33000 and 8192 and the message has gone away.
I hope this is useful to someone, somewhere at some point!
[Replying to my own post.] This has been completely consistent two months and I've had no suggestions here and not found anything very useful searching the web. However, I think I have just cracked it: it happens if I don't close a project before quitting Rstudio. I have never closed projects in the past as I have always quit Rstudio when I've finished work in/on a project. I had assumed that quitting Rstudio closed the open project. In fact that seems to be what https://docs.posit.co/ide/user/ide/guide/code/projects.html says is the case.
However, if I explicitly close the project before quitting the message does not appear when I reopen Rstudio. Opening R in the project folder does not produce the message but I don't think Rgui uses projects does it?
As far as I can see, the "Error 24" message is itself an error and a complete red herring as Rstudio is nowhere near opening too many file handles when the message appears. Has anyone else seen this? If it's only me, I'm not sure it's worth a bug report but I think it is a bug in Rstudio if perhaps peculiar to Linux or even to my Linux or even my machine!
I have had exactly the same issue for many months. The only thing that helps is closing all RStudio instances and/or rebooting computer. It's extremely annoying, and I have no idea how to fix it. I tried increasing the ulimit, but that didn't help at all.
FYI, I also work on Linux.
Thanks config-i1! It is somehow reassuring to know it's not unique to my set up. I have tried to explore the issue a bit more and I think all I have got is:
for me it is not perfectly reproducible
it doesn't happen if I have closed any project open before quitting Rstudio and if I restart Rstudio not in a project directory
it generally happens when I start Rstudio by double clicking on a .Rproj file though that no longer seems to be 100% reliable
So I remain baffled by this. I am pretty well 100% sure it has nothing to do with the usual causes of a Linux error 24 as clearly Rstudio is not using a huge number of handles when it happens. Equally, we have both pushed up the ulimits and that hasn't changed it for either of us.
I suspect the warnings about what is disabled are also false. Have you seen any impacts suggesting that they are correct?
For the moment I resigning myself to ignoring it when it comes up and I am not noticing ill effects but I'd much prefer it if someone in Posit who knows the innards of its project handling and what sorts of interactions with the OS might generate false error 24 messages would look into it. I will do a bug report in the next week or so when I can find time.
In my case, it does something: it switches off some of Rstudio functionality. I remember in some case, I couldn't jump to a specific function, when Ctrl+clicking on its name. I don't remember other examples, but there was something definitely.
And just FYI for other people, my ulimit -n is 524288 and ulimit -s at 8192, so there's no way I have too many open files... I'm sure this is the Rstudio issue.