-
Notifications
You must be signed in to change notification settings - Fork 152
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
Error using install_github()
and install_deps()
: Error: Failed to install 'unknown package' from GitHub. HTTP error 401. Bad credentials.
#659
Comments
The PAT is used to increase the rate limits, not for increased access. Unauthenticated access only allows for 60 API calls an hour, which can be easily exhausted in CI settings, particularly because CI systems often share IP addresses. I would suggest you create a GitHub PAT without any scopes and use that in your GitLab CI, relying on the bundled PAT is fragile. |
That's helpful, thanks. Setting the PAT manually now lets my install the package from the publicly available GitHub repo without an error:
However, I'm still getting an error when trying to run
|
I would instead set the |
That solved the problem. Many thanks! |
This seems to be a recurrence of issue #641. I'm trying to install an R package from a publicly available GitHub repo using
install_github()
from the{remotes}
package, and am trying to install R packages from CRAN usinginstall_deps()
. I'm doing this in the context of a Docker image (rocker/geospatial
) using a GitLab runner that that will output a book to GitLab Pages using{bookdown}
. However, I receive an error when trying to install an R package ({uroc}
) from a publicly available GitHub repo (https://github.com/evwalz/uroc) and when installing dependencies from CRAN. Note that I used to receive a similar error in{remotes}
2.4.0, but commit 77966d4 in{remotes}
2.4.1 temporarily fixed it. It was working for me for a while when I upgraded to{remotes}
2.4.1. However, it stopped working for me again.Using R 4.1.1 on a GitLab Runner and
{remotes}
2.4.1, here's the error I receive:Note that I'm not also getting a similar error when trying to install R package dependencies from CRAN:
Interestingly, I can install these packages fine when running the code locally. And when I run the Docker container locally, the packages install fine, as well. So it appears to be some interaction of the Docker container with the GitLab runner.
For instance, in Issue #638, the user was able to fix the HTTP error 401 on GitHub Actions by defining GITHUB_PAT with the job's token:
The user in the other thread noted that it seems that relying on the bundled PAT is not robust. However, I'm not sure how to do that in the context of a GitLab runner (not GitHub Actions) in my
.gitlab-ci.yml
file. Also, please note that I'm trying to download an R package from a publicly available GitHub repo and packages from CRAN, so they shouldn't require a Personal Access Token (PAT).Here is my
.gitlab-ci.yml
file:Here's my
sessionInfo()
:The text was updated successfully, but these errors were encountered: