r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
331 stars 152 forks source link

Could include source of credential error for gitlab/github pats #678

Open charlie-gallagher opened 2 years ago

charlie-gallagher commented 2 years ago

I was installing a package on GitLab with dependencies on GitHub and started getting credentials errors:

> remotes::install_gitlab("my/repo/lives/here")

## Using GitLab PAT from envvar GITLAB_PAT
## Downloading GitLab repo ixisdigital/data-science/ixverse/ixpress@HEAD
## from URL https://gitlab.com/api/v4/projects/22539828/repository/archive.tar.gz?sha=HEAD
## Error: Failed to install 'ixpress' from GitLab:
##  HTTP error 401.
##   Bad credentials
## 
##   Rate limit remaining: 57/60
##   Rate limit reset at: 2021-12-10 16:17:22 UTC

My GL PAT was current but my GH PAT was expired -- however, because the error never mentioned GH, I spent a while thinking there was something wrong with my GL PAT (I didn't know about the github dependencies).

Would it be a simple task to add the source of an error like this?