Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling renv deletes the package base #835

Closed
markjrieke opened this issue Oct 4, 2021 · 10 comments
Closed

calling renv deletes the package base #835

markjrieke opened this issue Oct 4, 2021 · 10 comments

Comments

@markjrieke
Copy link

@markjrieke markjrieke commented Oct 4, 2021

So I was following along some of the renv vingettes while trying to setup a github Action & I'm not quite sure what happened. I believe I called:

  • renv::status()
  • renv::snapshot()
  • renv::restore()

I then tried to run the workflow, which depends on the tidyverse, and I got an error along the lines of Warning: there is no installed package called tidyverse

I thought that was a bit strange so I ran install.packages("tidyverse"), and it looks like it installed all the packages into the Repo itself. I tried to open a new studio session & it gave me this error:

image

Now I can't open RStudio. I think what's going on is that RStudio is trying to reference the library folder that was created in the repo by renv (which just contains tidyverse packages at this point). All my other packages (and tidyverse packages) are still in the expected folder on my computer. I've got a twofold question:

  • How do I get RStudio working again?
  • What did I do incorrectly beforehand?

Apologies for the lack of a reprex, I can't get into RStudio right now unfortunately!

@markjrieke
Copy link
Author

@markjrieke markjrieke commented Oct 4, 2021

update: I uninstalled/reinstalled R/RStudio & am now back in, but still not sure what I did beforehand (also a bit scared to attempt to recreate the issue!). For the time being, I'm going to just set the workflow to not depend on renv, but I certainly would like to in the future!

@kevinushey
Copy link
Collaborator

@kevinushey kevinushey commented Oct 5, 2021

Unfortunately, without a reproducible example, it's very hard for me to know what went wrong.

@CinnamonJP
Copy link

@CinnamonJP CinnamonJP commented Oct 8, 2021

This problem is also happened in my environment repeatedly (6 times). Finish the process as usual and exit Rstudio and the console normally. The next time I launched the console, surprisingly, all the files in the "base" package (which was of course system installed, not under renv) were removed. The result is a "Fatal error" as shown in the image above.

@kevinushey
Copy link
Collaborator

@kevinushey kevinushey commented Oct 8, 2021

Do you see this issue with a prior release of renv (e.g. renv 0.13.2)? https://cran.r-project.org/src/contrib/Archive/renv/

@CinnamonJP
Copy link

@CinnamonJP CinnamonJP commented Oct 9, 2021

Thank you for your quick reply. I reinstall prior release (0.13.1). I didn't have this issues when I was using version 0.13.1. Is it a problem specific to 0.14.x?

@kevinushey
Copy link
Collaborator

@kevinushey kevinushey commented Oct 9, 2021

It's possible, but until I'm able to reproduce the issue locally I won't know for sure.

@brianwdavis
Copy link

@brianwdavis brianwdavis commented Oct 19, 2021

This happened to me while running renv::init() on a new project with a bad wifi connection, so it was doing heavy lifting to populate the project library. Unfortunately I don't know which version of renv I was running at the time because I had to reinstall R and all libs to recover.

R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

@kevinushey
Copy link
Collaborator

@kevinushey kevinushey commented Oct 19, 2021

Unfortunately I still don't have any good ideas as to what could've caused this to happen. If the problem occurs again please let me know and provide as much detail as possible. (Ideally, I would be able to reproduce this myself locally)

@brianwdavis
Copy link

@brianwdavis brianwdavis commented Oct 19, 2021

I wasn't able to reproduce it a second time either, and my only hunch is that it involved the package installation failing due to the bad wifi connection I was on.

@kevinushey
Copy link
Collaborator

@kevinushey kevinushey commented Dec 9, 2021

#614 made it clear that one way this could happen is if something tries to recursively delete things in the temporary directory when the renv sandbox is active. I've since disabled the sandbox by default to avoid this issue -- hopefully that would imply ultimately fixing the OP's issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants