r-hub / rhub

R-hub API client
https://r-hub.github.io/rhub/
Other
353 stars 52 forks source link

Problem with "Bad credentials" when running rhub_check(). #628

Closed rolfTurner closed 3 months ago

rolfTurner commented 3 months ago

As usual I am floundering way out of my depth. I hope that that someone might be able to throw me a life-line.

I need to to build a Windoze binary of a package that I am developing. I tried to do this using rhub v2. After a great deal of thrashing around, I managed to follow the instructions in

https://github.com/r-hub/rhub/blob/HEAD/vignettes/rhubv2.Rmd

so as to create a github repository for the package, explicitly:

https://github.com/rolfTurner/kanova

I went to the corresponding local (cloned) directory for the package, started R, and executed

library(rhub)
rhub_check(platforms="windows")

Previously this "worked" up to a point where rhub_check() reported a failure. Today I tried to replicate what I had done, so as as to raise an issue about that failure. Over the intervening time, something has inexplicably gone wrong, and I now cannot even get to square zero:

rhub_check(platforms="windows") ✔ Found git repository at /home/rolf/Desktop/Temp/kanova. ✔ Found GitHub PAT. Error in rhub_check(platforms = "windows"): ! :( Failed to start check: Bad credentials. ℹ If you think this is a bug in the rhub package, please open an issues at https://github.com/r-hub/rhub/issues. Type .Last.error to see the more details.

I am mystified as to why my credentials are "bad". I have set up a "PAT", and I can, e.g., do

 git clone https://github.com/rolfTurner/kanova.git

and obtain what seems to be a valid clone of "kanova", without further input and with no objections about my "credentials".

A web search was unenlightening; the posts that I found seemed to be completely out of date.

The solution to my problem is probably something embarassingly elementary/trivial, but I am bewildered by all of the protocols for github. I am humbly hoping that someone can specify the details of what I need to do, in terms that can understand.

rolfTurner commented 3 months ago

Did some more thrashing around. Found that if I did

gh auth login

and followed some instructions, I got to a state in which there were no more complaints about "Bad credentials". I am not sure what really went on, but I guess that I can consider the issue to be solved.

Apologies for the noise.