rhub icon indicating copy to clipboard operation
rhub copied to clipboard

Bad error message in `list_my_checks`

Open dmurdoch opened this issue 4 years ago • 13 comments

I have run several checks on rgl recently, using the maintainer email [email protected]. If I run list_my_checks() without specifying that email address, email defaults to [email protected], which account has been verified according to validate_email(), but I get the error:

> list_my_checks()
Error in query("LIST BUILDS EMAIL", params = list(email = email, token = email_get_token(email))) : 
  Email address not validated

The message should probably say something like

No checks found for email [email protected]

instead.

dmurdoch avatar Jan 29 '20 15:01 dmurdoch

Are you sure that [email protected] has the right token? E.g. if you re-validated it on another machine, then it will not have the right token on this one, because one email address can only have one token currently.

gaborcsardi avatar Jan 29 '20 15:01 gaborcsardi

That's not the issue. I'm only using one machine. Just to be sure, I just re-validated it and got the same result.

dmurdoch avatar Jan 29 '20 16:01 dmurdoch

Just did some tracing. The message Email address not validated is in raw characters in response$content received from the call to GET() in query() called from list_my_checks():

Browse[3]> rawToChar(response$content)
[1] "{\"result\":\"error\",\"message\":\"Email address not validated\"}"

dmurdoch avatar Jan 29 '20 16:01 dmurdoch

According to the server the @gmail.com email is pending validation. Does validate_email() finish successfully for you?

gaborcsardi avatar Jan 29 '20 16:01 gaborcsardi

I don't remember seeing a problem. I will try again now:

> library(rhub)
> validate_email()

── Choose email address to (re)validate (or 0 to exit) 

1: ✓  [email protected]
2: ✓  [email protected]
3:    New email address

Selection: 2
Please check your emails for the R-hub access token.
Token: 1ce53...d7d7f3a8f
Token added for ‘[email protected]

Looks as though it worked (I edited out the middle of the token, that's not what I received).

dmurdoch avatar Jan 29 '20 16:01 dmurdoch

Not sure what I've done wrong, but I'm again getting the message

> list_my_checks()
Error in query("LIST BUILDS EMAIL", params = list(email = email, token = email_get_token(email))) : 
  Email address not validated

It's using the [email protected] address, which has been validated (and re-validated a few minutes ago).

dmurdoch avatar Nov 18 '20 20:11 dmurdoch

Run rhub::list_validated_emails() and make sure that the token is the one you received in the last email after you have run rhub::validate_email()

On Wed, Nov 18, 2020 at 8:19 PM dmurdoch [email protected] wrote:

Not sure what I've done wrong, but I'm again getting the message

list_my_checks() Error in query("LIST BUILDS EMAIL", params = list(email = email, token = email_get_token(email))) : Email address not validated

It's using the [email protected] address, which has been validated (and re-validated a few minutes ago).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/r-hub/rhub/issues/334#issuecomment-729929719, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFBGQH73IMLYGA7CHOYWQDSQQT47ANCNFSM4KNG3PXQ .

gaborcsardi avatar Nov 18 '20 20:11 gaborcsardi

Yes, same token in both cases. I just removed my older email address (that I rarely use; it's not the one given by whoami::email_address()) so it only lists one, and I get the most recent token but no luck with list_my_checks().

dmurdoch avatar Nov 18 '20 20:11 dmurdoch

Found the error. I went back through old emails, and found a token that worked, the one that was validated on Jan 29 (i.e. 10 months ago). More recently validated ones from this afternoon did not work. I'll save all of them, in case it's just a case of slow updates.

dmurdoch avatar Nov 18 '20 21:11 dmurdoch

I'm experiencing the same problem. I've used rhub while back, and now I'm getting all sort of strange errors. I've revalidated my email but I cannot get it to work for some reason. Although my email is freshly validated, I'll get this:

> rhub::list_my_checks()
Error in get_endpoint(endpoint, params) : 
  Cannot find token, email address is not validated?

And none of my builds go through. Any thoughts?

amirmasoudabdol avatar Apr 16 '21 10:04 amirmasoudabdol

Investigating...

gaborcsardi avatar Apr 16 '21 11:04 gaborcsardi

This is indeed a bug in list_my_checks(), if you validate a new address, list_my_check() does not work until you submit a checks.

I have fixed your case now, please try again.

As for the checks, they should go through eventually. If you see them in list_my_checks() then there is no need to resubmit them.

gaborcsardi avatar Apr 16 '21 11:04 gaborcsardi

It seems some of my build went thought but I guess that's because of your intervention, right? Before that, they looked pretty much stuck!

amirmasoudabdol avatar Apr 16 '21 11:04 amirmasoudabdol