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

Invalid or expired token. #141

Closed
jcmundy opened this issue Nov 21, 2017 · 3 comments
Closed

Invalid or expired token. #141

jcmundy opened this issue Nov 21, 2017 · 3 comments

Comments

@jcmundy
Copy link

jcmundy commented Nov 21, 2017

I keep getting the following error instead of a browser and log-in:

Auto-refreshing stale OAuth token.
Error in $<-.data.frame(*tmp*, app, value = "google") :
replacement has 1 row, data has 0
In addition: Warning message:
89 - Invalid or expired token.

@mkearney
Copy link
Collaborator

mkearney commented Nov 21, 2017

@jcmundy That probably means you've got an ".httr-oauth" file in your current working directory. I need to include an additional check that can catch this error, but until I do...you should be able to avoid this error by removing the ".httr-oauth" file.

file.remove(".httr-oauth")

If there's not an ".httr-oauth" file, that'll return a warning like this:

> file.remove(".httr-oauth")
[1] FALSE
Warning message:
In file.remove(".httr-oauth") :
  cannot remove file '.httr-oauth', reason 'No such file or directory'

Otherwise, you may have to restart your R session once the file is removed. Then, <fingers crossed>, everything should work fine. And once it does, it should save the path/token for future use (avoiding future instances where you may have an ".httr-oauth" file in a working directory while using rtweet).

@AmeliaMN
Copy link

AmeliaMN commented Feb 5, 2018

This solution worked for me (restarting my R session was required).

@jcmundy
Copy link
Author

jcmundy commented Feb 5, 2018

Ah yes, it looks like I never responded. This also worked for me and I have been successfully using rtweet since. Thanks!

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

4 participants