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

renv::restore() fails to download private GitHub Repositories #1722

Open
jyotishkarc opened this issue Oct 14, 2023 · 2 comments
Open

renv::restore() fails to download private GitHub Repositories #1722

jyotishkarc opened this issue Oct 14, 2023 · 2 comments

Comments

@jyotishkarc
Copy link

jyotishkarc commented Oct 14, 2023

I have a private repository (say, repo-Y) within an organization (say, org-X). I use that in a project that is synced on three places, viz.

  • My personal computer (running Windows 11)
  • The remote GitHub repository
  • A Sun Grid computer cluster (running Linux)

Since there are collaborators, we use renv to keep track of all the packages that we are using. I had a previous version of the package/repository installed on my own computer. Now, through a personal access token, I successfully re-installed repo-Y through devtools::install_github('org-X/repo-Y') on my own machine, and of course did a renv::snapshot() after that. I pushed the updated renv.lock file to the remote repository, and pulled from the cluster.

Now, since I wanted to have the latest version of repo-Y there as well, I did a renv::restore(). However, it produced an error very similar to this issue. The inputs and a shortened output is as follows:

> renv::restore()
The following package(s) will be updated:

# CRAN -----------------------------------------------------------------------
- bslib         [0.4.2 -> 0.5.1]
- cachem        [1.0.6 -> 1.0.8]
- codetools     [0.2-18 -> 0.2-19]
.
.
.
- survival      [3.4-0 -> 3.5-7]
- withr         [2.5.0 -> 2.5.1]
- yaml          [2.3.6 -> 2.3.7]

# GitHub ---------------------------------------------------------------------
- repo-Y        [0.0.0.9000 -> org-X/repo-Y@HEAD]
- tinytex       [rstudio/tinytex@HEAD: 60587ad7 -> 8af916a2]

Do you want to proceed? [Y/n]: Y

# Downloading packages -------------------------------------------------------
- Downloading lattice from CRAN ...             OK [file is up to date]
- Downloading MASS from CRAN ...                OK [file is up to date]
- Downloading tinytex from GitHub ...           OK [50.5 Kb in 1.8s]
- Downloading codetools from CRAN ...           OK [file is up to date]
- Downloading repo-Y from GitHub ...            ERROR [curl: (22) The requested URL returned error: 404 ]
Error: error downloading 'https://api.github.com/repos/org-X/repo-Y/tarball/f5b4540804fd46ac24a30636f08fdb9b901ed816' [curl: (22) The requested URL returned error: 404 ]
Traceback (most recent calls last):
8: renv::restore()
7: renv_restore_run_actions(project, diff, current, lockfile, rebuild)
6: retrieve(packages)
5: handler(package, renv_retrieve_impl(package))
4: renv_retrieve_impl(package)
3: renv_retrieve_github(record)
2: renv_retrieve_package(record, url, path)
1: stop(status)

Initially, I suspected that it might be an issue with my Git configuration itself. That's why, I tried devtools::devtools::install_git('[email protected]:org-X/repo-Y.git' and it got installed! But once again, renv::restore() produced the same error as mentioned above.

I request the developers to kindly have a look into this matter. Please let me know if some additional information is required. Thanks a lot.

@orderlyquant
Copy link

I was having similar problems and after reading #1723, ran renv::install("gitcreds"). The "github" issues went away after this. I agree with #1723 that this should be made more explicit to the user.

@kevinushey
Copy link
Collaborator

4c24748 should make it more clear if / when gitcreds is needed.

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

3 participants